diff -Nru sumo-0.15.0~dfsg/Makefile.am sumo-0.16.0~dfsg/Makefile.am --- sumo-0.15.0~dfsg/Makefile.am 2012-03-13 22:17:50.000000000 +0000 +++ sumo-0.16.0~dfsg/Makefile.am 2012-12-03 11:27:48.000000000 +0000 @@ -7,8 +7,10 @@ pydoc: rm -rf docs/pydoc mkdir docs/pydoc - cd docs/pydoc \ - && PYTHONPATH="../../tools" python -c "import pydoc, traci, sumolib; [pydoc.writedoc(m) for m in [traci, sumolib, sumolib.net] + traci._modules.values()]" + cd docs/pydoc && \ + for i in `find ../../tools/traci ../../tools/sumolib -name "*.py" -not -executable | sed 's,../../tools/,,;s,/,.,g;s,.py,,;s,.__init__,,'`; do \ + PYTHONPATH="../../tools" python -c "import $$i, pydoc; pydoc.writedoc($$i)"; \ + done doxygen: rm -rf docs/doxygen @@ -21,21 +23,32 @@ man: rm -rf docs/man mkdir docs/man - for exe in sumo dfrouter duarouter jtrrouter activitygen od2trips netconvert netgen polyconvert; do help2man -N bin/$$exe > docs/man/$$exe.1; done + help2man -N -n "A microscopic road traffic simulation" bin/sumo > docs/man/sumo.1 + help2man -N -n "Builds vehicle routes for SUMO using detector values" bin/dfrouter > docs/man/dfrouter.1 + help2man -N -n "Shortest path router and DUE computer for the microscopic road traffic simulation SUMO" bin/duarouter > docs/man/duarouter.1 + help2man -N -n "Router for the microscopic road traffic simulation SUMO based on junction turning ratios" bin/jtrrouter > docs/man/jtrrouter.1 + help2man -N -n "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO" bin/activitygen > docs/man/activitygen.1 + help2man -N -n "Importer of O/D-matrices for the road traffic simulation SUMO" bin/od2trips > docs/man/od2trips.1 + help2man -N -n "Road network importer / builder for the road traffic simulation SUMO" bin/netconvert > docs/man/netconvert.1 + help2man -N -n "Road network generator for the microscopic road traffic simulation SUMO" bin/netgenerate > docs/man/netgenerate.1 + help2man -N -n "Importer of polygons and POIs for the road traffic simulation SUMO" bin/polyconvert > docs/man/polyconvert.1 + help2man -N -n "TraCITestClient for the road traffic simulation SUMO" bin/TraCITestClient > docs/man/TraCITestClient.1 +dist-hook: abs_distdir=`pwd`/$(distdir) dist-hook: - abs_distdir="`pwd`/$(distdir)" \ - && cd $(srcdir) \ - && for f in `find build tools tests/complex/tutorial -name .svn -prune -o -type d -print`; do mkdir -p $$abs_distdir/$$f; done \ - && mkdir -p $$abs_distdir/docs \ - && find tests/complex/tutorial -regex ".*\.\(xml\|txt\|sumocfg\|netccfg\|py\)" -print0 | xargs -0 cp --parents --target-directory $$abs_distdir \ - && mv $$abs_distdir/tests/complex/tutorial $$abs_distdir/docs \ - && rm -rf $$abs_distdir/tests \ - && tests/extractTest.py -i -f tests/examples.txt -o $$abs_distdir/docs \ - && find build -regex ".*\.\(vcproj\|vsprops\|vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $$abs_distdir \ - && ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f > ../tools_filelist; true ) \ - && xargs cp --parents --target-directory $$abs_distdir < tools_filelist \ - && cp tools_filelist $$abs_distdir + cd $(srcdir) ; \ + if test -d tests; then \ + for f in `find build tools tests/complex/tutorial -name .svn -prune -o -type d -print`; do mkdir -p $(abs_distdir)/$$f; done ; \ + mkdir -p $(abs_distdir)/docs ; \ + find tests/complex/tutorial -regex ".*\.\(xml\|txt\|sumocfg\|netccfg\|py\)" -print0 | xargs -0 cp -v --parents --target-directory $(abs_distdir) ; \ + mv -v ${abs_distdir}/tests/complex/tutorial $(abs_distdir)/docs ; \ + rm -rf $(abs_distdir)/tests ; \ + tests/extractTest.py -i -f tests/examples.txt -o $(abs_distdir)/docs ; \ + find build -regex ".*\.\(vcproj\|vsprops\|vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \ + ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f > ../tools_filelist; true ) ; \ + xargs cp --parents --target-directory $(abs_distdir) < tools_filelist ; \ + cp tools_filelist $(abs_distdir) ; \ + fi; dist-doc: doc cd $(srcdir) @@ -75,7 +88,7 @@ tests/extractTest.py -f tests/examples.txt sumo$(EXEEXT) netconvert$(EXEEXT) \ - netgen$(EXEEXT) duarouter$(EXEEXT) \ + netgenerate$(EXEEXT) duarouter$(EXEEXT) \ dfrouter$(EXEEXT) jtrrouter$(EXEEXT) \ od2trips$(EXEEXT) polyconvert$(EXEEXT) \ sumo-gui$(EXEEXT): diff -Nru sumo-0.15.0~dfsg/Makefile.in sumo-0.16.0~dfsg/Makefile.in --- sumo-0.15.0~dfsg/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -124,6 +124,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -154,6 +155,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -188,6 +190,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -221,7 +224,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -729,8 +731,10 @@ pydoc: rm -rf docs/pydoc mkdir docs/pydoc - cd docs/pydoc \ - && PYTHONPATH="../../tools" python -c "import pydoc, traci, sumolib; [pydoc.writedoc(m) for m in [traci, sumolib, sumolib.net] + traci._modules.values()]" + cd docs/pydoc && \ + for i in `find ../../tools/traci ../../tools/sumolib -name "*.py" -not -executable | sed 's,../../tools/,,;s,/,.,g;s,.py,,;s,.__init__,,'`; do \ + PYTHONPATH="../../tools" python -c "import $$i, pydoc; pydoc.writedoc($$i)"; \ + done doxygen: rm -rf docs/doxygen @@ -743,21 +747,32 @@ man: rm -rf docs/man mkdir docs/man - for exe in sumo dfrouter duarouter jtrrouter activitygen od2trips netconvert netgen polyconvert; do help2man -N bin/$$exe > docs/man/$$exe.1; done + help2man -N -n "A microscopic road traffic simulation" bin/sumo > docs/man/sumo.1 + help2man -N -n "Builds vehicle routes for SUMO using detector values" bin/dfrouter > docs/man/dfrouter.1 + help2man -N -n "Shortest path router and DUE computer for the microscopic road traffic simulation SUMO" bin/duarouter > docs/man/duarouter.1 + help2man -N -n "Router for the microscopic road traffic simulation SUMO based on junction turning ratios" bin/jtrrouter > docs/man/jtrrouter.1 + help2man -N -n "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO" bin/activitygen > docs/man/activitygen.1 + help2man -N -n "Importer of O/D-matrices for the road traffic simulation SUMO" bin/od2trips > docs/man/od2trips.1 + help2man -N -n "Road network importer / builder for the road traffic simulation SUMO" bin/netconvert > docs/man/netconvert.1 + help2man -N -n "Road network generator for the microscopic road traffic simulation SUMO" bin/netgenerate > docs/man/netgenerate.1 + help2man -N -n "Importer of polygons and POIs for the road traffic simulation SUMO" bin/polyconvert > docs/man/polyconvert.1 + help2man -N -n "TraCITestClient for the road traffic simulation SUMO" bin/TraCITestClient > docs/man/TraCITestClient.1 +dist-hook: abs_distdir=`pwd`/$(distdir) dist-hook: - abs_distdir="`pwd`/$(distdir)" \ - && cd $(srcdir) \ - && for f in `find build tools tests/complex/tutorial -name .svn -prune -o -type d -print`; do mkdir -p $$abs_distdir/$$f; done \ - && mkdir -p $$abs_distdir/docs \ - && find tests/complex/tutorial -regex ".*\.\(xml\|txt\|sumocfg\|netccfg\|py\)" -print0 | xargs -0 cp --parents --target-directory $$abs_distdir \ - && mv $$abs_distdir/tests/complex/tutorial $$abs_distdir/docs \ - && rm -rf $$abs_distdir/tests \ - && tests/extractTest.py -i -f tests/examples.txt -o $$abs_distdir/docs \ - && find build -regex ".*\.\(vcproj\|vsprops\|vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $$abs_distdir \ - && ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f > ../tools_filelist; true ) \ - && xargs cp --parents --target-directory $$abs_distdir < tools_filelist \ - && cp tools_filelist $$abs_distdir + cd $(srcdir) ; \ + if test -d tests; then \ + for f in `find build tools tests/complex/tutorial -name .svn -prune -o -type d -print`; do mkdir -p $(abs_distdir)/$$f; done ; \ + mkdir -p $(abs_distdir)/docs ; \ + find tests/complex/tutorial -regex ".*\.\(xml\|txt\|sumocfg\|netccfg\|py\)" -print0 | xargs -0 cp -v --parents --target-directory $(abs_distdir) ; \ + mv -v ${abs_distdir}/tests/complex/tutorial $(abs_distdir)/docs ; \ + rm -rf $(abs_distdir)/tests ; \ + tests/extractTest.py -i -f tests/examples.txt -o $(abs_distdir)/docs ; \ + find build -regex ".*\.\(vcproj\|vsprops\|vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \ + ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f > ../tools_filelist; true ) ; \ + xargs cp --parents --target-directory $(abs_distdir) < tools_filelist ; \ + cp tools_filelist $(abs_distdir) ; \ + fi; dist-doc: doc cd $(srcdir) @@ -797,7 +812,7 @@ tests/extractTest.py -f tests/examples.txt sumo$(EXEEXT) netconvert$(EXEEXT) \ - netgen$(EXEEXT) duarouter$(EXEEXT) \ + netgenerate$(EXEEXT) duarouter$(EXEEXT) \ dfrouter$(EXEEXT) jtrrouter$(EXEEXT) \ od2trips$(EXEEXT) polyconvert$(EXEEXT) \ sumo-gui$(EXEEXT): diff -Nru sumo-0.15.0~dfsg/aclocal.m4 sumo-0.16.0~dfsg/aclocal.m4 --- sumo-0.15.0~dfsg/aclocal.m4 2012-03-14 00:11:45.000000000 +0000 +++ sumo-0.16.0~dfsg/aclocal.m4 2012-12-04 00:13:16.000000000 +0000 @@ -22,7 +22,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -58,7 +60,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -87,6 +89,7 @@ # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -103,6 +106,8 @@ AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -139,7 +144,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -159,6 +164,9 @@ m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -181,10 +189,13 @@ dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -200,7 +211,6 @@ _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -214,23 +224,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -271,6 +264,28 @@ ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -423,7 +438,7 @@ # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -433,7 +448,7 @@ # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -532,12 +547,20 @@ LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -548,9 +571,9 @@ # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -558,16 +581,38 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -577,20 +622,11 @@ AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -616,7 +652,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -661,15 +697,13 @@ # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -699,6 +733,7 @@ # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING @@ -731,15 +766,12 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - _LT_PROG_XSI_SHELLFNS + _LT_PROG_REPLACE_SHELLFNS - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -845,11 +877,13 @@ AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -954,6 +988,31 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -981,7 +1040,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1001,7 +1060,11 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -1009,7 +1072,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1025,203 +1088,142 @@ fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE([AC_LANG_PROGRAM],[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1250,7 +1252,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1368,14 +1370,47 @@ ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1402,10 +1437,19 @@ esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1430,15 +1474,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1478,7 +1522,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1541,6 +1585,11 @@ lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1605,8 +1654,8 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1657,7 +1706,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1698,7 +1747,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1707,7 +1762,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1883,16 +1942,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2051,6 +2110,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2059,16 +2119,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2081,7 +2148,7 @@ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2101,7 +2168,13 @@ if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2189,7 +2262,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2220,8 +2293,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2242,36 +2316,83 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2358,6 +2479,19 @@ hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2400,8 +2534,10 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) @@ -2459,7 +2595,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -2468,16 +2604,21 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2486,7 +2627,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2719,6 +2860,8 @@ The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2831,6 +2974,7 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2952,6 +3096,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -2960,8 +3109,8 @@ fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3013,16 +3162,18 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3052,6 +3203,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3060,11 +3215,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3086,7 +3241,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3164,6 +3319,21 @@ ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3171,7 +3341,11 @@ _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3228,7 +3402,19 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3241,13 +3427,13 @@ AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3262,6 +3448,67 @@ dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + # LT_LIB_M # -------- @@ -3270,7 +3517,7 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3298,7 +3545,12 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3315,6 +3567,7 @@ m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3382,8 +3635,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3419,6 +3672,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3440,7 +3694,7 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3452,6 +3706,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3463,7 +3729,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3489,15 +3755,15 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3530,6 +3796,13 @@ AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3540,6 +3813,8 @@ _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3551,7 +3826,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3602,6 +3876,11 @@ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3651,6 +3930,12 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3707,7 +3992,7 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3740,8 +4025,8 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3803,7 +4088,7 @@ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3907,6 +4192,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3949,6 +4240,13 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3991,7 +4289,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4012,7 +4310,13 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4024,25 +4328,25 @@ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; @@ -4074,7 +4378,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4131,9 +4435,11 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4152,6 +4458,8 @@ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4172,6 +4480,7 @@ m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4180,27 +4489,35 @@ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4263,7 +4580,33 @@ esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4281,6 +4624,7 @@ fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4296,11 +4640,12 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4336,10 +4681,12 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4357,6 +4704,11 @@ fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4372,7 +4724,7 @@ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4382,15 +4734,16 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4401,13 +4754,17 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4423,17 +4780,17 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4447,8 +4804,8 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4466,8 +4823,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4513,8 +4870,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4554,8 +4911,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4642,9 +5001,9 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4653,14 +5012,19 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4692,20 +5056,63 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4743,7 +5150,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4751,7 +5158,7 @@ hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4766,8 +5173,8 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -4785,16 +5192,16 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4806,7 +5213,14 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4834,28 +5248,34 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], [ - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ]) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4917,17 +5337,17 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4937,13 +5357,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -4956,9 +5376,9 @@ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5134,36 +5554,38 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5228,8 +5650,6 @@ to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5240,6 +5660,8 @@ [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5329,37 +5751,22 @@ ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5381,6 +5788,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5412,6 +5821,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5429,6 +5839,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5450,8 +5861,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5483,7 +5894,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5592,10 +6003,10 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5604,14 +6015,19 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5641,28 +6057,75 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5704,6 +6167,11 @@ gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5728,11 +6196,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5793,7 +6261,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5803,10 +6271,10 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5836,7 +6304,7 @@ case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5847,9 +6315,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5860,7 +6328,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5878,7 +6346,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5915,26 +6383,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5942,7 +6410,7 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5961,9 +6429,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5983,13 +6451,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6058,7 +6526,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6093,15 +6561,15 @@ case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6117,17 +6585,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6137,7 +6605,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6173,7 +6641,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6194,7 +6662,7 @@ esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6214,14 +6682,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6232,7 +6700,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6286,6 +6754,10 @@ CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6341,6 +6813,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6355,6 +6828,29 @@ ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6363,6 +6859,7 @@ # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6413,6 +6910,13 @@ }; _LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6424,7 +6928,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6433,13 +6937,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6459,8 +6972,10 @@ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6496,6 +7011,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6532,7 +7048,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6576,32 +7092,16 @@ ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6620,6 +7120,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6659,7 +7161,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6713,38 +7217,24 @@ GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6763,6 +7253,8 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6802,7 +7294,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6858,7 +7352,8 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6895,10 +7390,12 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6908,6 +7405,8 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) @@ -6923,7 +7422,8 @@ AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG @@ -6958,9 +7458,11 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6973,7 +7475,8 @@ GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -7032,6 +7535,15 @@ AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7123,8 +7635,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7163,222 +7675,177 @@ ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -_LT_EOF -esac +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac ]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -7493,7 +7960,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -7501,13 +7968,13 @@ esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -7865,31 +8332,31 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3018 ltversion.m4 +# serial 3293 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3018]) +m4_define([LT_PACKAGE_VERSION], [2.4]) +m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3018' +[macro_version='2.4' +macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -7959,7 +8426,6 @@ m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -7972,6 +8438,13 @@ m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) diff -Nru sumo-0.15.0~dfsg/bin/Makefile.am sumo-0.16.0~dfsg/bin/Makefile.am --- sumo-0.15.0~dfsg/bin/Makefile.am 2012-01-28 00:02:20.000000000 +0000 +++ sumo-0.16.0~dfsg/bin/Makefile.am 2012-09-25 22:06:11.000000000 +0000 @@ -1,45 +1,78 @@ if WITH_GUI -GUI_APPS = sumo-gui -if MESOSIM +GUI_APP = sumo-gui +if INTERNAL NETEDIT_APP = netedit -MAROUTER_APP = marouter endif endif +if INTERNAL +MAROUTER_APP = marouter +endif + if TRACI -TRACI_TESTCLIENT_APPS = TraCITestClient +TRACI_TESTCLIENT_APP = TraCITestClient endif -DISTCLEANFILES = sumo sumoD dfrouter dfrouterD duarouter duarouterD jtrrouter jtrrouterD netconvert netconvertD netgen netgenD od2trips od2tripsD polyconvert polyconvertD activitygen activitygenD sumo-unittest sumo-unittestD sumo-gui sumo-guiD TraCITestClient TraCITestClientD meso mesoD meso-gui meso-guiD netedit neteditD marouter marouterD +CLEANFILES = sumo sumoD meso mesoD \ +sumo-gui sumo-guiD meso-gui meso-guiD \ +dfrouter dfrouterD dfrouterInt dfrouterIntD \ +duarouter duarouterD duarouterInt duarouterIntD \ +jtrrouter jtrrouterD jtrrouterInt jtrrouterIntD \ +netconvert netconvertD netconvertInt netconvertIntD \ +netgenerate netgenerateD netgenerateInt netgenerateIntD \ +od2trips od2tripsD od2tripsInt od2tripsIntD \ +polyconvert polyconvertD polyconvertInt polyconvertIntD \ +activitygen activitygenD activitygenInt activitygenIntD \ +TraCITestClient TraCITestClientD TraCITestClientInt TraCITestClientIntD \ +sumo-unittest sumo-unittestD \ +netedit neteditD marouter marouterD -all: sumo dfrouter duarouter jtrrouter netconvert netgen od2trips polyconvert activitygen $(GUI_APPS) $(NETEDIT_APP) $(MAROUTER_APP) $(TRACI_TESTCLIENT_APPS) +all: sumo dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert activitygen $(GUI_APP) $(NETEDIT_APP) $(MAROUTER_APP) $(TRACI_TESTCLIENT_APP) sumo: ../src/sumo cp ../src/sumo ./`echo sumo | sed '$(transform)'` if [ ! -e sumo -a -e meso ]; then ln -s meso sumo; fi if [ ! -e sumoD -a -e mesoD ]; then ln -s mesoD sumoD; fi dfrouter: ../src/dfrouter/dfrouter cp ../src/dfrouter/dfrouter ./`echo dfrouter | sed '$(transform)'` + if [ ! -e dfrouter -a -e dfrouterInt ]; then ln -s dfrouterInt dfrouter; fi + if [ ! -e dfrouterD -a -e dfrouterIntD ]; then ln -s dfrouterIntD dfrouterD; fi duarouter: ../src/duarouter/duarouter cp ../src/duarouter/duarouter ./`echo duarouter | sed '$(transform)'` + if [ ! -e duarouter -a -e duarouterInt ]; then ln -s duarouterInt duarouter; fi + if [ ! -e duarouterD -a -e duarouterIntD ]; then ln -s duarouterIntD duarouterD; fi jtrrouter: ../src/jtrrouter/jtrrouter cp ../src/jtrrouter/jtrrouter ./`echo jtrrouter | sed '$(transform)'` + if [ ! -e jtrrouter -a -e jtrrouterInt ]; then ln -s jtrrouterInt jtrrouter; fi + if [ ! -e jtrrouterD -a -e jtrrouterIntD ]; then ln -s jtrrouterIntD jtrrouterD; fi netconvert: ../src/netconvert cp ../src/netconvert ./`echo netconvert | sed '$(transform)'` -netgen: ../src/netgen/netgen - cp ../src/netgen/netgen ./`echo netgen | sed '$(transform)'` + if [ ! -e netconvert -a -e netconvertInt ]; then ln -s netconvertInt netconvert; fi + if [ ! -e netconvertD -a -e netconvertIntD ]; then ln -s netconvertIntD netconvertD; fi +netgenerate: ../src/netgen/netgenerate + cp ../src/netgen/netgenerate ./`echo netgenerate | sed '$(transform)'` + if [ ! -e netgenerate -a -e netgenerateInt ]; then ln -s netgenerateInt netgenerate; fi + if [ ! -e netgenerateD -a -e netgenerateIntD ]; then ln -s netgenerateIntD netgenerateD; fi od2trips: ../src/od2trips/od2trips cp ../src/od2trips/od2trips ./`echo od2trips | sed '$(transform)'` + if [ ! -e od2trips -a -e od2tripsInt ]; then ln -s od2tripsInt od2trips; fi + if [ ! -e od2tripsD -a -e od2tripsIntD ]; then ln -s od2tripsIntD od2tripsD; fi polyconvert: ../src/polyconvert/polyconvert cp ../src/polyconvert/polyconvert ./`echo polyconvert | sed '$(transform)'` + if [ ! -e polyconvert -a -e polyconvertInt ]; then ln -s polyconvertInt polyconvert; fi + if [ ! -e polyconvertD -a -e polyconvertIntD ]; then ln -s polyconvertIntD polyconvertD; fi activitygen: ../src/activitygen/activitygen cp ../src/activitygen/activitygen ./`echo activitygen | sed '$(transform)'` -$(GUI_APPS): ../src/$(GUI_APPS) - cp ../src/$(GUI_APPS) ./`echo $(GUI_APPS) | sed '$(transform)'` - if [ ! -e sumo-gui -a -e meso-gui ]; then ln -s meso-gui sumo-gui; fi - if [ ! -e sumo-guiD -a -e meso-guiD ]; then ln -s meso-guiD sumo-guiD; fi + if [ ! -e activitygen -a -e activitygenInt ]; then ln -s activitygenInt activitygen; fi + if [ ! -e activitygenD -a -e activitygenIntD ]; then ln -s activitygenIntD activitygenD; fi +$(GUI_APP): ../src/$(GUI_APP) + cp ../src/$(GUI_APP) ./`echo $(GUI_APP) | sed '$(transform)'` + if [ ! -e $(GUI_APP) -a -e meso-gui ]; then ln -s meso-gui $(GUI_APP); fi + if [ ! -e $(GUI_APP)D -a -e meso-guiD ]; then ln -s meso-guiD $(GUI_APP)D; fi $(NETEDIT_APP): ../src/netedit/$(NETEDIT_APP) cp ../src/netedit/$(NETEDIT_APP) ./`echo $(NETEDIT_APP) | sed '$(transform)'` $(MAROUTER_APP): ../src/marouter/$(MAROUTER_APP) cp ../src/marouter/$(MAROUTER_APP) ./`echo $(MAROUTER_APP) | sed '$(transform)'` -$(TRACI_TESTCLIENT_APPS): ../src/traci_testclient/$(TRACI_TESTCLIENT_APPS) - cp ../src/traci_testclient/$(TRACI_TESTCLIENT_APPS) ./`echo $(TRACI_TESTCLIENT_APPS) | sed '$(transform)'` +$(TRACI_TESTCLIENT_APP): ../src/traci_testclient/$(TRACI_TESTCLIENT_APP) + cp ../src/traci_testclient/$(TRACI_TESTCLIENT_APP) ./`echo $(TRACI_TESTCLIENT_APP) | sed '$(transform)'` + if [ ! -e $(TRACI_TESTCLIENT_APP) -a -e $(TRACI_TESTCLIENT_APP)Int ]; then ln -s $(TRACI_TESTCLIENT_APP)Int $(TRACI_TESTCLIENT_APP); fi + if [ ! -e $(TRACI_TESTCLIENT_APP)D -a -e $(TRACI_TESTCLIENT_APP)IntD ]; then ln -s $(TRACI_TESTCLIENT_APP)IntD $(TRACI_TESTCLIENT_APP)D; fi diff -Nru sumo-0.15.0~dfsg/bin/Makefile.in sumo-0.16.0~dfsg/bin/Makefile.in --- sumo-0.15.0~dfsg/bin/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/bin/Makefile.in 2012-12-04 00:13:18.000000000 +0000 @@ -69,6 +69,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -99,6 +100,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -133,6 +135,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -166,7 +169,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -186,11 +188,24 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@WITH_GUI_TRUE@GUI_APPS = sumo-gui -@MESOSIM_TRUE@@WITH_GUI_TRUE@NETEDIT_APP = netedit -@MESOSIM_TRUE@@WITH_GUI_TRUE@MAROUTER_APP = marouter -@TRACI_TRUE@TRACI_TESTCLIENT_APPS = TraCITestClient -DISTCLEANFILES = sumo sumoD dfrouter dfrouterD duarouter duarouterD jtrrouter jtrrouterD netconvert netconvertD netgen netgenD od2trips od2tripsD polyconvert polyconvertD activitygen activitygenD sumo-unittest sumo-unittestD sumo-gui sumo-guiD TraCITestClient TraCITestClientD meso mesoD meso-gui meso-guiD netedit neteditD marouter marouterD +@WITH_GUI_TRUE@GUI_APP = sumo-gui +@INTERNAL_TRUE@@WITH_GUI_TRUE@NETEDIT_APP = netedit +@INTERNAL_TRUE@MAROUTER_APP = marouter +@TRACI_TRUE@TRACI_TESTCLIENT_APP = TraCITestClient +CLEANFILES = sumo sumoD meso mesoD \ +sumo-gui sumo-guiD meso-gui meso-guiD \ +dfrouter dfrouterD dfrouterInt dfrouterIntD \ +duarouter duarouterD duarouterInt duarouterIntD \ +jtrrouter jtrrouterD jtrrouterInt jtrrouterIntD \ +netconvert netconvertD netconvertInt netconvertIntD \ +netgenerate netgenerateD netgenerateInt netgenerateIntD \ +od2trips od2tripsD od2tripsInt od2tripsIntD \ +polyconvert polyconvertD polyconvertInt polyconvertIntD \ +activitygen activitygenD activitygenInt activitygenIntD \ +TraCITestClient TraCITestClientD TraCITestClientInt TraCITestClientIntD \ +sumo-unittest sumo-unittestD \ +netedit neteditD marouter marouterD + all: all-am .SUFFIXES: @@ -288,11 +303,11 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -377,37 +392,55 @@ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am -all: sumo dfrouter duarouter jtrrouter netconvert netgen od2trips polyconvert activitygen $(GUI_APPS) $(NETEDIT_APP) $(MAROUTER_APP) $(TRACI_TESTCLIENT_APPS) +all: sumo dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert activitygen $(GUI_APP) $(NETEDIT_APP) $(MAROUTER_APP) $(TRACI_TESTCLIENT_APP) sumo: ../src/sumo cp ../src/sumo ./`echo sumo | sed '$(transform)'` if [ ! -e sumo -a -e meso ]; then ln -s meso sumo; fi if [ ! -e sumoD -a -e mesoD ]; then ln -s mesoD sumoD; fi dfrouter: ../src/dfrouter/dfrouter cp ../src/dfrouter/dfrouter ./`echo dfrouter | sed '$(transform)'` + if [ ! -e dfrouter -a -e dfrouterInt ]; then ln -s dfrouterInt dfrouter; fi + if [ ! -e dfrouterD -a -e dfrouterIntD ]; then ln -s dfrouterIntD dfrouterD; fi duarouter: ../src/duarouter/duarouter cp ../src/duarouter/duarouter ./`echo duarouter | sed '$(transform)'` + if [ ! -e duarouter -a -e duarouterInt ]; then ln -s duarouterInt duarouter; fi + if [ ! -e duarouterD -a -e duarouterIntD ]; then ln -s duarouterIntD duarouterD; fi jtrrouter: ../src/jtrrouter/jtrrouter cp ../src/jtrrouter/jtrrouter ./`echo jtrrouter | sed '$(transform)'` + if [ ! -e jtrrouter -a -e jtrrouterInt ]; then ln -s jtrrouterInt jtrrouter; fi + if [ ! -e jtrrouterD -a -e jtrrouterIntD ]; then ln -s jtrrouterIntD jtrrouterD; fi netconvert: ../src/netconvert cp ../src/netconvert ./`echo netconvert | sed '$(transform)'` -netgen: ../src/netgen/netgen - cp ../src/netgen/netgen ./`echo netgen | sed '$(transform)'` + if [ ! -e netconvert -a -e netconvertInt ]; then ln -s netconvertInt netconvert; fi + if [ ! -e netconvertD -a -e netconvertIntD ]; then ln -s netconvertIntD netconvertD; fi +netgenerate: ../src/netgen/netgenerate + cp ../src/netgen/netgenerate ./`echo netgenerate | sed '$(transform)'` + if [ ! -e netgenerate -a -e netgenerateInt ]; then ln -s netgenerateInt netgenerate; fi + if [ ! -e netgenerateD -a -e netgenerateIntD ]; then ln -s netgenerateIntD netgenerateD; fi od2trips: ../src/od2trips/od2trips cp ../src/od2trips/od2trips ./`echo od2trips | sed '$(transform)'` + if [ ! -e od2trips -a -e od2tripsInt ]; then ln -s od2tripsInt od2trips; fi + if [ ! -e od2tripsD -a -e od2tripsIntD ]; then ln -s od2tripsIntD od2tripsD; fi polyconvert: ../src/polyconvert/polyconvert cp ../src/polyconvert/polyconvert ./`echo polyconvert | sed '$(transform)'` + if [ ! -e polyconvert -a -e polyconvertInt ]; then ln -s polyconvertInt polyconvert; fi + if [ ! -e polyconvertD -a -e polyconvertIntD ]; then ln -s polyconvertIntD polyconvertD; fi activitygen: ../src/activitygen/activitygen cp ../src/activitygen/activitygen ./`echo activitygen | sed '$(transform)'` -$(GUI_APPS): ../src/$(GUI_APPS) - cp ../src/$(GUI_APPS) ./`echo $(GUI_APPS) | sed '$(transform)'` - if [ ! -e sumo-gui -a -e meso-gui ]; then ln -s meso-gui sumo-gui; fi - if [ ! -e sumo-guiD -a -e meso-guiD ]; then ln -s meso-guiD sumo-guiD; fi + if [ ! -e activitygen -a -e activitygenInt ]; then ln -s activitygenInt activitygen; fi + if [ ! -e activitygenD -a -e activitygenIntD ]; then ln -s activitygenIntD activitygenD; fi +$(GUI_APP): ../src/$(GUI_APP) + cp ../src/$(GUI_APP) ./`echo $(GUI_APP) | sed '$(transform)'` + if [ ! -e $(GUI_APP) -a -e meso-gui ]; then ln -s meso-gui $(GUI_APP); fi + if [ ! -e $(GUI_APP)D -a -e meso-guiD ]; then ln -s meso-guiD $(GUI_APP)D; fi $(NETEDIT_APP): ../src/netedit/$(NETEDIT_APP) cp ../src/netedit/$(NETEDIT_APP) ./`echo $(NETEDIT_APP) | sed '$(transform)'` $(MAROUTER_APP): ../src/marouter/$(MAROUTER_APP) cp ../src/marouter/$(MAROUTER_APP) ./`echo $(MAROUTER_APP) | sed '$(transform)'` -$(TRACI_TESTCLIENT_APPS): ../src/traci_testclient/$(TRACI_TESTCLIENT_APPS) - cp ../src/traci_testclient/$(TRACI_TESTCLIENT_APPS) ./`echo $(TRACI_TESTCLIENT_APPS) | sed '$(transform)'` +$(TRACI_TESTCLIENT_APP): ../src/traci_testclient/$(TRACI_TESTCLIENT_APP) + cp ../src/traci_testclient/$(TRACI_TESTCLIENT_APP) ./`echo $(TRACI_TESTCLIENT_APP) | sed '$(transform)'` + if [ ! -e $(TRACI_TESTCLIENT_APP) -a -e $(TRACI_TESTCLIENT_APP)Int ]; then ln -s $(TRACI_TESTCLIENT_APP)Int $(TRACI_TESTCLIENT_APP); fi + if [ ! -e $(TRACI_TESTCLIENT_APP)D -a -e $(TRACI_TESTCLIENT_APP)IntD ]; then ln -s $(TRACI_TESTCLIENT_APP)IntD $(TRACI_TESTCLIENT_APP)D; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru sumo-0.15.0~dfsg/build/msvc10/Release.props sumo-0.16.0~dfsg/build/msvc10/Release.props --- sumo-0.15.0~dfsg/build/msvc10/Release.props 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/Release.props 2012-12-04 00:26:11.000000000 +0000 @@ -20,6 +20,7 @@ Level3 + Fast false diff -Nru sumo-0.15.0~dfsg/build/msvc10/activitygen/activitygen.vcxproj sumo-0.16.0~dfsg/build/msvc10/activitygen/activitygen.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/activitygen/activitygen.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/activitygen/activitygen.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -31,24 +55,6 @@ MFCProj - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -86,77 +92,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F - - - $(XERCES_DEBUG_LIB);ws2_32.lib - .\Debug/activitygenD.exe - - - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Release/activitygen.exe - - - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/activitygenF.exe - - - - - X64 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 - - diff -Nru sumo-0.15.0~dfsg/build/msvc10/dfrouter/dfrouter.vcxproj sumo-0.16.0~dfsg/build/msvc10/dfrouter/dfrouter.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/dfrouter/dfrouter.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/dfrouter/dfrouter.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -32,24 +56,6 @@ MFCProj - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -87,77 +93,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64F - $(ProjectName)64 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(OutDir)$(ProjectName)D.exe - - - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Release/dfrouter.exe - - - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/dfrouterF.exe - - - - - X64 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 - - diff -Nru sumo-0.15.0~dfsg/build/msvc10/duarouter/duarouter.vcxproj sumo-0.16.0~dfsg/build/msvc10/duarouter/duarouter.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/duarouter/duarouter.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/duarouter/duarouter.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -27,28 +51,10 @@ - {90205628-51D7-4194-9FC0-7D74C35A3471} + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9} MFCProj - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -58,6 +64,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -75,6 +101,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -89,74 +135,7 @@ <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F - - - $(XERCES_DEBUG_LIB);ws2_32.lib - .\Debug/duarouterD.exe - - - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Release/duarouter.exe - - - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/duarouterF.exe - - - - - X64 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 - - diff -Nru sumo-0.15.0~dfsg/build/msvc10/exe.props sumo-0.16.0~dfsg/build/msvc10/exe.props --- sumo-0.15.0~dfsg/build/msvc10/exe.props 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/exe.props 2012-12-04 00:26:11.000000000 +0000 @@ -2,13 +2,58 @@ <_ProjectFileVersion>10.0.30319.1 + Application + $(ProjectName)D + $(ProjectName)64D + $(ProjectName)F + $(ProjectName)64 + $(ProjectName)64F + $(ProjectName)Int + $(ProjectName)IntD + $(ProjectName)Int64 + $(ProjectName)Int64D + $(ProjectName)IntF + $(ProjectName)IntF64 + + + $(XERCES_DEBUG_LIB);ws2_32.lib + + + + + $(XERCES_LIB);ws2_32.lib + + + + + $(XERCES_LIB);ws2_32.lib + + + + + $(XERCES_LIB);ws2_32.lib + + + + + $(XERCES_LIB);ws2_32.lib + + + + + $(XERCES_DEBUG_LIB);ws2_32.lib + + xcopy /Y $(TargetPath) ..\..\..\bin\ - IF EXIST .svn/entries ..\..\..\tools\build\version.py + ..\..\..\tools\build\version.py + + $(OutDir)$(TargetName).exe + - \ No newline at end of file + diff -Nru sumo-0.15.0~dfsg/build/msvc10/guisim/guisim.vcxproj sumo-0.16.0~dfsg/build/msvc10/guisim/guisim.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/guisim/guisim.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/guisim/guisim.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,28 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalFastbuild Win32 - - MesoRelease + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease x64 @@ -48,36 +56,6 @@ sumo-gui - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -87,18 +65,18 @@ - + - + - + - + @@ -117,18 +95,18 @@ - + - + - + - + @@ -141,69 +119,43 @@ + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - meso-gui - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - meso-guiD - meso-gui64 - meso-gui64D - $(ProjectName)64 - $(ProjectName)64F + meso-gui + meso-guiD + meso-gui64 + meso-gui64D + meso-guiF + meso-gui64F $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)sumo-guiD.exe $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)sumo-gui64D.exe $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)sumo-gui.exe Windows mainCRTStartup @@ -211,47 +163,46 @@ $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)sumo-gui64.exe - + - $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\MesoRelease\y_libmesogui.lib;$(OSG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\MesoRelease\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\MesoRelease\y_libmesosim.lib - $(OutDir)meso-gui.exe + $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\InternalRelease\y_libmesogui.lib;$(OSG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\InternalRelease\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\InternalRelease\y_libmesosim.lib - + - $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\x64\MesoRelease\y_libmesogui.lib;$(OSG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\x64\MesoRelease\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\MesoRelease\y_libmesosim.lib - $(OutDir)meso-gui64.exe + $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\x64\InternalRelease\y_libmesogui.lib;$(OSG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\x64\InternalRelease\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\InternalRelease\y_libmesosim.lib - + - $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\MesoDebug\y_libmesogui.lib;$(OSG_DEBUG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\MesoDebug\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\MesoDebug\y_libmesosim.lib - $(OutDir)meso-guiD.exe + $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\InternalDebug\y_libmesogui.lib;$(OSG_DEBUG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\InternalDebug\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\InternalDebug\y_libmesosim.lib - + - $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\x64\Debug\y_libmesogui.lib;$(OSG_DEBUG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\x64\MesoDebug\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\MesoDebug\y_libmesosim.lib - $(OutDir)meso-gui64D.exe + $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\x64\InternalDebug\y_libmesogui.lib;$(OSG_DEBUG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\x64\InternalDebug\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\InternalDebug\y_libmesosim.lib $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)sumo-guiF.exe - - X64 - $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)sumo-gui64F.exe - MachineX64 + + + + + $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\InternalRelease\y_libmesogui.lib;$(OSG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\InternalFastbuild\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\InternalFastbuild\y_libmesosim.lib + + + + + $(PROJ_LIB);$(PYTHON_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesogui\InternalRelease\y_libmesogui.lib;$(OSG_LIB);$(MSBuildProjectDirectory)\..\y_osgview\x64\InternalFastbuild\y_osgview.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\InternalFastbuild\y_libmesosim.lib diff -Nru sumo-0.15.0~dfsg/build/msvc10/internal.props sumo-0.16.0~dfsg/build/msvc10/internal.props --- sumo-0.15.0~dfsg/build/msvc10/internal.props 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/internal.props 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,11 @@ + + + + <_ProjectFileVersion>10.0.30319.1 + + + + HAVE_OSG;HAVE_INTERNAL;%(PreprocessorDefinitions) + + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/internal.sln sumo-0.16.0~dfsg/build/msvc10/internal.sln --- sumo-0.15.0~dfsg/build/msvc10/internal.sln 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/internal.sln 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,1461 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sumo-gui", "guisim\guisim.vcxproj", "{F1904C42-F231-4B9D-AD80-E2971969AFA0}" + ProjectSection(ProjectDependencies) = postProject + {308BEB29-142B-4088-BD41-80E273E20D3A} = {308BEB29-142B-4088-BD41-80E273E20D3A} + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0} = {F5218B3F-4CE3-47F7-8A3D-41683281EAA0} + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684} = {3CD3D44A-7809-485C-B7A9-D5FDE0C31684} + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sumo", "sumo\sumo.vcxproj", "{08C90F3F-95F3-46C7-8D87-63AF6DF5558C}" + ProjectSection(ProjectDependencies) = postProject + {308BEB29-142B-4088-BD41-80E273E20D3A} = {308BEB29-142B-4088-BD41-80E273E20D3A} + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libgui", "y_libgui\y_libgui.vcxproj", "{C9CC8A55-BCF5-44D8-9E22-55EA09757C60}" + ProjectSection(ProjectDependencies) = postProject + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} = {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libguinetload", "y_libguinetload\y_libguinetload.vcxproj", "{B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libguisim", "y_libguisim\y_libguisim.vcxproj", "{9046260E-78AA-4458-BE80-0747860A0F70}" + ProjectSection(ProjectDependencies) = postProject + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} = {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libmesogui", "y_libmesogui\y_libmesogui.vcxproj", "{3CD3D44A-7809-485C-B7A9-D5FDE0C31684}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libmesosim", "y_libmesosim\y_libmesosim.vcxproj", "{308BEB29-142B-4088-BD41-80E273E20D3A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libmicrosim", "y_libmicrosim\y_libmicrosim.vcxproj", "{2A069662-6B6F-40D7-A808-211F9C9A4AAE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetload", "y_libnetload\y_libnetload.vcxproj", "{5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_output", "z_libmicrosim_output\z_libmicrosim_output.vcxproj", "{CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_traffic_lights", "z_libmicrosim_traffic_lights\z_libmicrosim_traffic_lights.vcxproj", "{AF2015D2-2412-4355-87FB-E0D88B0A5FBA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_common", "z_libutils_common\z_libutils_common.vcxproj", "{72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_foxtools", "z_libutils_foxtools\z_libutils_foxtools.vcxproj", "{ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_geom", "z_libutils_geom\z_libutils_geom.vcxproj", "{334DF447-D0B3-4CEA-9693-F755EB11C18F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_iodevices", "z_libutils_iodevices\z_libutils_iodevices.vcxproj", "{FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_options", "z_libutils_options\z_libutils_options.vcxproj", "{EE29AF87-7317-488D-BF6D-EC422D1DBAD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_xml", "z_libutils_xml\z_libutils_xml.vcxproj", "{508F0BFF-83FE-444C-9509-A359BCA83BC4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_importio", "z_libutils_importio\z_libutils_importio.vcxproj", "{9FCF1CAF-0189-4242-88BA-47706E741119}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_actions", "z_libmicrosim_actions\z_libmicrosim_actions.vcxproj", "{A54D4A8B-9520-40F0-B8CB-152BF506CB47}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_logging", "z_libmicrosim_logging\z_libmicrosim_logging.vcxproj", "{0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_trigger", "z_libmicrosim_trigger\z_libmicrosim_trigger.vcxproj", "{26F88652-2664-4CE7-8292-6BD37EE6C3AD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_div", "z_libutils_gui_div\z_libutils_gui_div.vcxproj", "{E3AB9C37-6B5A-4D8C-88F3-DF750A493511}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_settings", "z_libutils_gui_settings\z_libutils_gui_settings.vcxproj", "{8C2F733C-1C8E-45C9-A546-17EF0146718D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_images", "z_libutils_gui_images\z_libutils_gui_images.vcxproj", "{5F818AF6-963E-40B3-93F3-35E145FDE30B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_nvwa", "zz_foreign_nvwa\zz_foreign_nvwa.vcxproj", "{FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_tcpip", "zz_foreign_tcpip\zz_foreign_tcpip.vcxproj", "{492B0B5A-0BBE-49BA-82E6-70A82DBC242F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_polyfonts", "zz_foreign_polyfonts\zz_foreign_polyfonts.vcxproj", "{306768A4-B73E-4B81-9EC0-B4836EFE0504}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_gl2ps", "zz_foreign_gl2ps\zz_foreign_gl2ps.vcxproj", "{272D2367-13FE-45C2-84AD-8480861DB43E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_windows", "z_libutils_gui_windows\z_libutils_gui_windows.vcxproj", "{25AF2C06-8B08-4B33-8775-657E27C304D9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_tracker", "z_libutils_gui_tracker\z_libutils_gui_tracker.vcxproj", "{67E76D22-3C3E-44FC-9253-3FE583DB7848}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_globjects", "z_libutils_gui_globjects\z_libutils_gui_globjects.vcxproj", "{39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_events", "z_libutils_gui_events\z_libutils_gui_events.vcxproj", "{F574684D-2052-46AB-99B9-AFD5DA2174A6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libgui_dialogs", "z_libgui_dialogs\z_libgui_dialogs.vcxproj", "{80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_optional_libtraciserver", "z_optional_libtraciserver\z_optional_libtraciserver.vcxproj", "{00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netedit", "netedit\netedit.vcxproj", "{813B2D7E-CC23-4650-892F-553B1AFD912C}" + ProjectSection(ProjectDependencies) = postProject + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6} = {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6} + {25AF2C06-8B08-4B33-8775-657E27C304D9} = {25AF2C06-8B08-4B33-8775-657E27C304D9} + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20} = {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20} + {F7F13336-3E29-4219-8580-A17C71E69718} = {F7F13336-3E29-4219-8580-A17C71E69718} + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511} = {E3AB9C37-6B5A-4D8C-88F3-DF750A493511} + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6} = {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6} + {8C2F733C-1C8E-45C9-A546-17EF0146718D} = {8C2F733C-1C8E-45C9-A546-17EF0146718D} + {334DF447-D0B3-4CEA-9693-F755EB11C18F} = {334DF447-D0B3-4CEA-9693-F755EB11C18F} + {F574684D-2052-46AB-99B9-AFD5DA2174A6} = {F574684D-2052-46AB-99B9-AFD5DA2174A6} + {272D2367-13FE-45C2-84AD-8480861DB43E} = {272D2367-13FE-45C2-84AD-8480861DB43E} + {50B2C273-2B6A-4A3A-BE24-83E3202DE180} = {50B2C273-2B6A-4A3A-BE24-83E3202DE180} + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6} = {EE29AF87-7317-488D-BF6D-EC422D1DBAD6} + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8} = {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8} + {306768A4-B73E-4B81-9EC0-B4836EFE0504} = {306768A4-B73E-4B81-9EC0-B4836EFE0504} + {9FCF1CAF-0189-4242-88BA-47706E741119} = {9FCF1CAF-0189-4242-88BA-47706E741119} + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD} = {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD} + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3} = {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3} + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1} = {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1} + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47} = {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47} + {91422FEF-2369-45E6-87AA-8B38709AD823} = {91422FEF-2369-45E6-87AA-8B38709AD823} + {91422FEF-2369-45E6-87AA-8B38709AD824} = {91422FEF-2369-45E6-87AA-8B38709AD824} + {5F818AF6-963E-40B3-93F3-35E145FDE30B} = {5F818AF6-963E-40B3-93F3-35E145FDE30B} + {508F0BFF-83FE-444C-9509-A359BCA83BC4} = {508F0BFF-83FE-444C-9509-A359BCA83BC4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetbuild", "y_libnetbuild\y_libnetbuild.vcxproj", "{BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetimport", "y_libnetimport\y_libnetimport.vcxproj", "{91422FEF-2369-45E6-87AA-8B38709AD823}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libnetimport_vissim", "z_libnetimport_vissim\z_libnetimport_vissim.vcxproj", "{F7F13336-3E29-4219-8580-A17C71E69718}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_distribution", "z_libutils_distribution\z_libutils_distribution.vcxproj", "{F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_eulerspiral", "zz_foreign_eulerspiral\zz_foreign_eulerspiral.vcxproj", "{50B2C273-2B6A-4A3A-BE24-83E3202DE180}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetwrite", "y_libnetwrite\y_libnetwrite.vcxproj", "{91422FEF-2369-45E6-87AA-8B38709AD824}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_osgview", "y_osgview\y_osgview.vcxproj", "{F5218B3F-4CE3-47F7-8A3D-41683281EAA0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marouter", "marouter\marouter.vcxproj", "{90205628-51D7-4194-9FC0-7D74C35A3471}" + ProjectSection(ProjectDependencies) = postProject + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D} = {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_librouter", "y_librouter\y_librouter.vcxproj", "{A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "activitygen", "activitygen\activitygen.vcxproj", "{3DAC2EC1-D265-4F66-8442-A006E50DC95F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dfrouter", "dfrouter\dfrouter.vcxproj", "{171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "duarouter", "duarouter\duarouter.vcxproj", "{8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jtrrouter", "jtrrouter\jtrrouter.vcxproj", "{43569450-FB3D-46EA-B9AB-CE92295C5570}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netconvert", "netconvert\netconvert.vcxproj", "{4589198B-EBD4-4811-B778-8AE270AEE0CD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netgenerate", "netgenerate\netgenerate.vcxproj", "{F241CA03-4AB1-4BB0-8151-7AF078E2BC06}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "od2trips", "od2trips\od2trips.vcxproj", "{39392259-4561-44C0-98F1-64CA4396C025}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "polyconvert", "polyconvert\polyconvert.vcxproj", "{CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TraciTestClient", "traci-testclient\Traci_TestClient.vcxproj", "{46274B55-07FE-4911-B4C0-D8B43A203B4A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_rtree", "zz_foreign_rtree\zz_foreign_rtree.vcxproj", "{25FDF327-EB7A-484A-96BC-AF2DB089D6F4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libinternal", "y_libinternal\y_libinternal.vcxproj", "{09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Fastbuild|Win32 = Fastbuild|Win32 + Fastbuild|x64 = Fastbuild|x64 + InternalDebug|Win32 = InternalDebug|Win32 + InternalDebug|x64 = InternalDebug|x64 + InternalFastbuild|Win32 = InternalFastbuild|Win32 + InternalFastbuild|x64 = InternalFastbuild|x64 + InternalRelease|Win32 = InternalRelease|Win32 + InternalRelease|x64 = InternalRelease|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|Win32.ActiveCfg = Debug|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|Win32.Build.0 = Debug|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|x64.ActiveCfg = Debug|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|x64.Build.0 = Debug|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Release|Win32.ActiveCfg = Release|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Release|Win32.Build.0 = Release|Win32 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Release|x64.ActiveCfg = Release|x64 + {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Release|x64.Build.0 = Release|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Debug|Win32.ActiveCfg = Debug|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Debug|Win32.Build.0 = Debug|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Debug|x64.ActiveCfg = Debug|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Debug|x64.Build.0 = Debug|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Release|Win32.ActiveCfg = Release|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Release|Win32.Build.0 = Release|Win32 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Release|x64.ActiveCfg = Release|x64 + {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Release|x64.Build.0 = Release|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|Win32.ActiveCfg = Debug|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|Win32.Build.0 = Debug|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|x64.ActiveCfg = Debug|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|x64.Build.0 = Debug|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|Win32.ActiveCfg = Release|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|Win32.Build.0 = Release|Win32 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|x64.ActiveCfg = Release|x64 + {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|x64.Build.0 = Release|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|Win32.ActiveCfg = Debug|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|Win32.Build.0 = Debug|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|x64.ActiveCfg = Debug|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|x64.Build.0 = Debug|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|Win32.ActiveCfg = Release|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|Win32.Build.0 = Release|Win32 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|x64.ActiveCfg = Release|x64 + {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|x64.Build.0 = Release|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.Debug|Win32.ActiveCfg = Debug|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.Debug|Win32.Build.0 = Debug|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.Debug|x64.ActiveCfg = Debug|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.Debug|x64.Build.0 = Debug|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.Release|Win32.ActiveCfg = Release|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.Release|Win32.Build.0 = Release|Win32 + {9046260E-78AA-4458-BE80-0747860A0F70}.Release|x64.ActiveCfg = Release|x64 + {9046260E-78AA-4458-BE80-0747860A0F70}.Release|x64.Build.0 = Release|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Debug|Win32.ActiveCfg = InternalDebug|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Debug|x64.ActiveCfg = InternalDebug|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Fastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Fastbuild|x64.ActiveCfg = InternalRelease|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Release|Win32.ActiveCfg = InternalRelease|Win32 + {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Release|x64.ActiveCfg = InternalRelease|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.Debug|Win32.ActiveCfg = InternalDebug|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.Debug|x64.ActiveCfg = InternalDebug|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.Fastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.Fastbuild|x64.ActiveCfg = InternalRelease|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {308BEB29-142B-4088-BD41-80E273E20D3A}.Release|Win32.ActiveCfg = InternalRelease|Win32 + {308BEB29-142B-4088-BD41-80E273E20D3A}.Release|x64.ActiveCfg = InternalRelease|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Debug|Win32.Build.0 = Debug|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Debug|x64.ActiveCfg = Debug|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Debug|x64.Build.0 = Debug|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Release|Win32.ActiveCfg = Release|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Release|Win32.Build.0 = Release|Win32 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Release|x64.ActiveCfg = Release|x64 + {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Release|x64.Build.0 = Release|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|Win32.ActiveCfg = Debug|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|Win32.Build.0 = Debug|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|x64.ActiveCfg = Debug|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|x64.Build.0 = Debug|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|Win32.ActiveCfg = Release|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|Win32.Build.0 = Release|Win32 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|x64.ActiveCfg = Release|x64 + {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|x64.Build.0 = Release|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Debug|Win32.Build.0 = Debug|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Debug|x64.ActiveCfg = Debug|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Debug|x64.Build.0 = Debug|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Release|Win32.ActiveCfg = Release|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Release|Win32.Build.0 = Release|Win32 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Release|x64.ActiveCfg = Release|x64 + {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Release|x64.Build.0 = Release|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Debug|Win32.ActiveCfg = Debug|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Debug|Win32.Build.0 = Debug|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Debug|x64.ActiveCfg = Debug|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Debug|x64.Build.0 = Debug|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalDebug|Win32.Build.0 = Debug|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalDebug|x64.ActiveCfg = Debug|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalDebug|x64.Build.0 = Debug|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalRelease|Win32.Build.0 = Release|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalRelease|x64.ActiveCfg = Release|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.InternalRelease|x64.Build.0 = Release|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Release|Win32.ActiveCfg = Release|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Release|Win32.Build.0 = Release|Win32 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Release|x64.ActiveCfg = Release|x64 + {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Release|x64.Build.0 = Release|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|Win32.ActiveCfg = Debug|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|Win32.Build.0 = Debug|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|x64.ActiveCfg = Debug|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|x64.Build.0 = Debug|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalDebug|Win32.Build.0 = Debug|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalDebug|x64.ActiveCfg = Debug|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalDebug|x64.Build.0 = Debug|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalRelease|Win32.Build.0 = Release|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalRelease|x64.ActiveCfg = Release|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.InternalRelease|x64.Build.0 = Release|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|Win32.ActiveCfg = Release|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|Win32.Build.0 = Release|Win32 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|x64.ActiveCfg = Release|x64 + {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|x64.Build.0 = Release|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|Win32.ActiveCfg = Debug|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|Win32.Build.0 = Debug|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|x64.ActiveCfg = Debug|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|x64.Build.0 = Debug|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalDebug|Win32.Build.0 = Debug|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalDebug|x64.ActiveCfg = Debug|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalDebug|x64.Build.0 = Debug|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalRelease|Win32.Build.0 = Release|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalRelease|x64.ActiveCfg = Release|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.InternalRelease|x64.Build.0 = Release|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|Win32.ActiveCfg = Release|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|Win32.Build.0 = Release|Win32 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|x64.ActiveCfg = Release|x64 + {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|x64.Build.0 = Release|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|Win32.ActiveCfg = Debug|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|Win32.Build.0 = Debug|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|x64.ActiveCfg = Debug|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|x64.Build.0 = Debug|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalDebug|Win32.Build.0 = Debug|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalDebug|x64.ActiveCfg = Debug|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalDebug|x64.Build.0 = Debug|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalRelease|Win32.Build.0 = Release|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalRelease|x64.ActiveCfg = Release|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.InternalRelease|x64.Build.0 = Release|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|Win32.ActiveCfg = Release|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|Win32.Build.0 = Release|Win32 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|x64.ActiveCfg = Release|x64 + {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|x64.Build.0 = Release|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|Win32.Build.0 = Debug|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|x64.ActiveCfg = Debug|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|x64.Build.0 = Debug|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalDebug|Win32.Build.0 = Debug|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalDebug|x64.ActiveCfg = Debug|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalDebug|x64.Build.0 = Debug|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalRelease|Win32.Build.0 = Release|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalRelease|x64.ActiveCfg = Release|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.InternalRelease|x64.Build.0 = Release|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|Win32.ActiveCfg = Release|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|Win32.Build.0 = Release|Win32 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|x64.ActiveCfg = Release|x64 + {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|x64.Build.0 = Release|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|Win32.Build.0 = Debug|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|x64.ActiveCfg = Debug|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|x64.Build.0 = Debug|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalDebug|Win32.Build.0 = Debug|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalDebug|x64.ActiveCfg = Debug|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalDebug|x64.Build.0 = Debug|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalRelease|Win32.Build.0 = Release|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalRelease|x64.ActiveCfg = Release|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.InternalRelease|x64.Build.0 = Release|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|Win32.ActiveCfg = Release|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|Win32.Build.0 = Release|Win32 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|x64.ActiveCfg = Release|x64 + {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|x64.Build.0 = Release|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|Win32.ActiveCfg = Debug|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|Win32.Build.0 = Debug|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|x64.ActiveCfg = Debug|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|x64.Build.0 = Debug|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalDebug|Win32.Build.0 = Debug|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalDebug|x64.ActiveCfg = Debug|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalDebug|x64.Build.0 = Debug|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalRelease|Win32.Build.0 = Release|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalRelease|x64.ActiveCfg = Release|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.InternalRelease|x64.Build.0 = Release|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|Win32.ActiveCfg = Release|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|Win32.Build.0 = Release|Win32 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|x64.ActiveCfg = Release|x64 + {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|x64.Build.0 = Release|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|Win32.ActiveCfg = Debug|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|Win32.Build.0 = Debug|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|x64.ActiveCfg = Debug|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|x64.Build.0 = Debug|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalDebug|Win32.Build.0 = Debug|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalDebug|x64.ActiveCfg = Debug|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalDebug|x64.Build.0 = Debug|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalRelease|Win32.Build.0 = Release|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalRelease|x64.ActiveCfg = Release|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.InternalRelease|x64.Build.0 = Release|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|Win32.ActiveCfg = Release|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|Win32.Build.0 = Release|Win32 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|x64.ActiveCfg = Release|x64 + {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|x64.Build.0 = Release|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Debug|Win32.ActiveCfg = Debug|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Debug|Win32.Build.0 = Debug|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Debug|x64.ActiveCfg = Debug|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Debug|x64.Build.0 = Debug|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalDebug|Win32.Build.0 = Debug|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalDebug|x64.ActiveCfg = Debug|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalDebug|x64.Build.0 = Debug|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalRelease|Win32.Build.0 = Release|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalRelease|x64.ActiveCfg = Release|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.InternalRelease|x64.Build.0 = Release|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Release|Win32.ActiveCfg = Release|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Release|Win32.Build.0 = Release|Win32 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Release|x64.ActiveCfg = Release|x64 + {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Release|x64.Build.0 = Release|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Debug|Win32.ActiveCfg = Debug|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Debug|Win32.Build.0 = Debug|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Debug|x64.ActiveCfg = Debug|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Debug|x64.Build.0 = Debug|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalDebug|Win32.Build.0 = Debug|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalDebug|x64.ActiveCfg = Debug|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalDebug|x64.Build.0 = Debug|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalRelease|Win32.Build.0 = Release|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalRelease|x64.ActiveCfg = Release|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.InternalRelease|x64.Build.0 = Release|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Release|Win32.ActiveCfg = Release|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Release|Win32.Build.0 = Release|Win32 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Release|x64.ActiveCfg = Release|x64 + {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Release|x64.Build.0 = Release|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Debug|Win32.ActiveCfg = Debug|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Debug|Win32.Build.0 = Debug|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Debug|x64.ActiveCfg = Debug|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Debug|x64.Build.0 = Debug|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Release|Win32.ActiveCfg = Release|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Release|Win32.Build.0 = Release|Win32 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Release|x64.ActiveCfg = Release|x64 + {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Release|x64.Build.0 = Release|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|Win32.ActiveCfg = Debug|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|Win32.Build.0 = Debug|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|x64.ActiveCfg = Debug|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|x64.Build.0 = Debug|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalDebug|Win32.Build.0 = Debug|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalDebug|x64.ActiveCfg = Debug|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalDebug|x64.Build.0 = Debug|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalRelease|Win32.Build.0 = Release|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalRelease|x64.ActiveCfg = Release|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.InternalRelease|x64.Build.0 = Release|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|Win32.ActiveCfg = Release|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|Win32.Build.0 = Release|Win32 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|x64.ActiveCfg = Release|x64 + {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|x64.Build.0 = Release|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|Win32.ActiveCfg = Debug|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|Win32.Build.0 = Debug|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|x64.ActiveCfg = Debug|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|x64.Build.0 = Debug|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|Win32.ActiveCfg = Release|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|Win32.Build.0 = Release|Win32 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|x64.ActiveCfg = Release|x64 + {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|x64.Build.0 = Release|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|Win32.ActiveCfg = Debug|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|Win32.Build.0 = Debug|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|x64.ActiveCfg = Debug|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|x64.Build.0 = Debug|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalDebug|Win32.Build.0 = Debug|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalDebug|x64.ActiveCfg = Debug|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalDebug|x64.Build.0 = Debug|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalRelease|Win32.Build.0 = Release|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalRelease|x64.ActiveCfg = Release|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.InternalRelease|x64.Build.0 = Release|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|Win32.ActiveCfg = Release|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|Win32.Build.0 = Release|Win32 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|x64.ActiveCfg = Release|x64 + {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|x64.Build.0 = Release|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|Win32.Build.0 = Debug|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|x64.ActiveCfg = Debug|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|x64.Build.0 = Debug|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalDebug|Win32.Build.0 = Debug|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalDebug|x64.ActiveCfg = Debug|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalDebug|x64.Build.0 = Debug|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalRelease|Win32.Build.0 = Release|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalRelease|x64.ActiveCfg = Release|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.InternalRelease|x64.Build.0 = Release|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|Win32.ActiveCfg = Release|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|Win32.Build.0 = Release|Win32 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|x64.ActiveCfg = Release|x64 + {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|x64.Build.0 = Release|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|Win32.ActiveCfg = Debug|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|Win32.Build.0 = Debug|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|x64.ActiveCfg = Debug|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|x64.Build.0 = Debug|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalDebug|Win32.Build.0 = Debug|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalDebug|x64.ActiveCfg = Debug|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalDebug|x64.Build.0 = Debug|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalRelease|Win32.Build.0 = Release|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalRelease|x64.ActiveCfg = Release|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.InternalRelease|x64.Build.0 = Release|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|Win32.ActiveCfg = Release|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|Win32.Build.0 = Release|Win32 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|x64.ActiveCfg = Release|x64 + {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|x64.Build.0 = Release|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|Win32.ActiveCfg = Debug|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|Win32.Build.0 = Debug|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|x64.ActiveCfg = Debug|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|x64.Build.0 = Debug|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalDebug|Win32.Build.0 = Debug|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalDebug|x64.ActiveCfg = Debug|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalDebug|x64.Build.0 = Debug|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalRelease|Win32.Build.0 = Release|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalRelease|x64.ActiveCfg = Release|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.InternalRelease|x64.Build.0 = Release|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|Win32.ActiveCfg = Release|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|Win32.Build.0 = Release|Win32 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|x64.ActiveCfg = Release|x64 + {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|x64.Build.0 = Release|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|Win32.ActiveCfg = Debug|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|Win32.Build.0 = Debug|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|x64.ActiveCfg = Debug|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|x64.Build.0 = Debug|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalDebug|Win32.Build.0 = Debug|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalDebug|x64.ActiveCfg = Debug|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalDebug|x64.Build.0 = Debug|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalRelease|Win32.Build.0 = Release|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalRelease|x64.ActiveCfg = Release|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.InternalRelease|x64.Build.0 = Release|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|Win32.ActiveCfg = Release|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|Win32.Build.0 = Release|Win32 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|x64.ActiveCfg = Release|x64 + {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|x64.Build.0 = Release|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|Win32.ActiveCfg = Debug|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|Win32.Build.0 = Debug|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|x64.ActiveCfg = Debug|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|x64.Build.0 = Debug|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|Win32.ActiveCfg = Release|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|Win32.Build.0 = Release|Win32 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|x64.ActiveCfg = Release|x64 + {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|x64.Build.0 = Release|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|Win32.ActiveCfg = Debug|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|Win32.Build.0 = Debug|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|x64.ActiveCfg = Debug|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|x64.Build.0 = Debug|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalDebug|Win32.Build.0 = Debug|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalDebug|x64.ActiveCfg = Debug|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalDebug|x64.Build.0 = Debug|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalRelease|Win32.Build.0 = Release|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalRelease|x64.ActiveCfg = Release|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.InternalRelease|x64.Build.0 = Release|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|Win32.ActiveCfg = Release|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|Win32.Build.0 = Release|Win32 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|x64.ActiveCfg = Release|x64 + {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|x64.Build.0 = Release|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|Win32.ActiveCfg = Debug|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|Win32.Build.0 = Debug|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|x64.ActiveCfg = Debug|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|x64.Build.0 = Debug|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalDebug|Win32.Build.0 = Debug|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalDebug|x64.ActiveCfg = Debug|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalDebug|x64.Build.0 = Debug|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalRelease|Win32.Build.0 = Release|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalRelease|x64.ActiveCfg = Release|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.InternalRelease|x64.Build.0 = Release|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|Win32.ActiveCfg = Release|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|Win32.Build.0 = Release|Win32 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|x64.ActiveCfg = Release|x64 + {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|x64.Build.0 = Release|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|Win32.ActiveCfg = Debug|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|Win32.Build.0 = Debug|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|x64.ActiveCfg = Debug|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|x64.Build.0 = Debug|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalDebug|Win32.Build.0 = Debug|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalDebug|x64.ActiveCfg = Debug|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalDebug|x64.Build.0 = Debug|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalRelease|Win32.Build.0 = Release|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalRelease|x64.ActiveCfg = Release|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.InternalRelease|x64.Build.0 = Release|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|Win32.ActiveCfg = Release|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|Win32.Build.0 = Release|Win32 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|x64.ActiveCfg = Release|x64 + {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|x64.Build.0 = Release|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|Win32.ActiveCfg = Debug|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|Win32.Build.0 = Debug|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|x64.ActiveCfg = Debug|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|x64.Build.0 = Debug|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|Win32.ActiveCfg = Release|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|Win32.Build.0 = Release|Win32 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|x64.ActiveCfg = Release|x64 + {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|x64.Build.0 = Release|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Debug|Win32.ActiveCfg = Debug|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Debug|Win32.Build.0 = Debug|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Debug|x64.ActiveCfg = Debug|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Debug|x64.Build.0 = Debug|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Release|Win32.ActiveCfg = Release|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Release|Win32.Build.0 = Release|Win32 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Release|x64.ActiveCfg = Release|x64 + {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Release|x64.Build.0 = Release|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.Debug|Win32.ActiveCfg = InternalDebug|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.Debug|x64.ActiveCfg = InternalDebug|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.Release|Win32.ActiveCfg = InternalRelease|Win32 + {813B2D7E-CC23-4650-892F-553B1AFD912C}.Release|x64.ActiveCfg = InternalRelease|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|Win32.ActiveCfg = Debug|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|Win32.Build.0 = Debug|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|x64.ActiveCfg = Debug|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|x64.Build.0 = Debug|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalDebug|Win32.Build.0 = Debug|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalDebug|x64.ActiveCfg = Debug|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalDebug|x64.Build.0 = Debug|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalRelease|Win32.Build.0 = Release|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalRelease|x64.ActiveCfg = Release|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.InternalRelease|x64.Build.0 = Release|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|Win32.ActiveCfg = Release|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|Win32.Build.0 = Release|Win32 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|x64.ActiveCfg = Release|x64 + {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|x64.Build.0 = Release|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|Win32.ActiveCfg = Debug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|Win32.Build.0 = Debug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|x64.ActiveCfg = Debug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|x64.Build.0 = Debug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|Win32.ActiveCfg = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|Win32.Build.0 = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|x64.ActiveCfg = Release|x64 + {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|x64.Build.0 = Release|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|Win32.ActiveCfg = Debug|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|Win32.Build.0 = Debug|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|x64.ActiveCfg = Debug|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|x64.Build.0 = Debug|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalDebug|Win32.Build.0 = Debug|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalDebug|x64.ActiveCfg = Debug|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalDebug|x64.Build.0 = Debug|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalRelease|Win32.Build.0 = Release|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalRelease|x64.ActiveCfg = Release|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.InternalRelease|x64.Build.0 = Release|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.Release|Win32.ActiveCfg = Release|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.Release|Win32.Build.0 = Release|Win32 + {F7F13336-3E29-4219-8580-A17C71E69718}.Release|x64.ActiveCfg = Release|x64 + {F7F13336-3E29-4219-8580-A17C71E69718}.Release|x64.Build.0 = Release|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|Win32.ActiveCfg = Debug|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|Win32.Build.0 = Debug|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|x64.ActiveCfg = Debug|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|x64.Build.0 = Debug|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalDebug|Win32.Build.0 = Debug|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalDebug|x64.ActiveCfg = Debug|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalDebug|x64.Build.0 = Debug|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalRelease|Win32.Build.0 = Release|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalRelease|x64.ActiveCfg = Release|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.InternalRelease|x64.Build.0 = Release|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|Win32.ActiveCfg = Release|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|Win32.Build.0 = Release|Win32 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|x64.ActiveCfg = Release|x64 + {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|x64.Build.0 = Release|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|Win32.ActiveCfg = Debug|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|Win32.Build.0 = Debug|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|x64.ActiveCfg = Debug|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|x64.Build.0 = Debug|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalDebug|Win32.Build.0 = Debug|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalDebug|x64.ActiveCfg = Debug|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalDebug|x64.Build.0 = Debug|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalRelease|Win32.Build.0 = Release|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalRelease|x64.ActiveCfg = Release|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.InternalRelease|x64.Build.0 = Release|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|Win32.ActiveCfg = Release|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|Win32.Build.0 = Release|Win32 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|x64.ActiveCfg = Release|x64 + {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|x64.Build.0 = Release|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|Win32.ActiveCfg = Debug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|Win32.Build.0 = Debug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|x64.ActiveCfg = Debug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|x64.Build.0 = Debug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalDebug|Win32.Build.0 = Debug|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalDebug|x64.ActiveCfg = Debug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalDebug|x64.Build.0 = Debug|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalRelease|Win32.Build.0 = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalRelease|x64.ActiveCfg = Release|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.InternalRelease|x64.Build.0 = Release|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|Win32.ActiveCfg = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|Win32.Build.0 = Release|Win32 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|x64.ActiveCfg = Release|x64 + {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|x64.Build.0 = Release|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Debug|Win32.ActiveCfg = InternalDebug|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Debug|x64.ActiveCfg = InternalDebug|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Fastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Fastbuild|x64.ActiveCfg = InternalRelease|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Release|Win32.ActiveCfg = InternalRelease|Win32 + {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Release|x64.ActiveCfg = InternalRelease|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|Win32.ActiveCfg = InternalDebug|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|x64.ActiveCfg = InternalDebug|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|Win32.ActiveCfg = InternalRelease|Win32 + {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|x64.ActiveCfg = InternalRelease|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|Win32.ActiveCfg = Debug|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|Win32.Build.0 = Debug|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|x64.ActiveCfg = Debug|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|x64.Build.0 = Debug|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalFastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalFastbuild|Win32.Build.0 = InternalRelease|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalFastbuild|x64.ActiveCfg = InternalRelease|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalFastbuild|x64.Build.0 = InternalRelease|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|Win32.ActiveCfg = Release|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|Win32.Build.0 = Release|Win32 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|x64.ActiveCfg = Release|x64 + {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|x64.Build.0 = Release|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Debug|Win32.ActiveCfg = Debug|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Debug|Win32.Build.0 = Debug|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Debug|x64.ActiveCfg = Debug|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Debug|x64.Build.0 = Debug|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Release|Win32.ActiveCfg = Release|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Release|Win32.Build.0 = Release|Win32 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Release|x64.ActiveCfg = Release|x64 + {3DAC2EC1-D265-4F66-8442-A006E50DC95F}.Release|x64.Build.0 = Release|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Debug|Win32.ActiveCfg = Debug|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Debug|Win32.Build.0 = Debug|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Debug|x64.ActiveCfg = Debug|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Debug|x64.Build.0 = Debug|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Release|Win32.ActiveCfg = Release|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Release|Win32.Build.0 = Release|Win32 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Release|x64.ActiveCfg = Release|x64 + {171F8F50-AC6B-4FBC-9F6C-32C65F0A310C}.Release|x64.Build.0 = Release|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|Win32.Build.0 = Debug|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|x64.ActiveCfg = Debug|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|x64.Build.0 = Debug|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|Win32.ActiveCfg = Release|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|Win32.Build.0 = Release|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|x64.ActiveCfg = Release|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|x64.Build.0 = Release|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Debug|Win32.ActiveCfg = Debug|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Debug|Win32.Build.0 = Debug|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Debug|x64.ActiveCfg = Debug|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Debug|x64.Build.0 = Debug|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Release|Win32.ActiveCfg = Release|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Release|Win32.Build.0 = Release|Win32 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Release|x64.ActiveCfg = Release|x64 + {43569450-FB3D-46EA-B9AB-CE92295C5570}.Release|x64.Build.0 = Release|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Debug|Win32.ActiveCfg = Debug|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Debug|Win32.Build.0 = Debug|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Debug|x64.ActiveCfg = Debug|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Debug|x64.Build.0 = Debug|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Release|Win32.ActiveCfg = Release|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Release|Win32.Build.0 = Release|Win32 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Release|x64.ActiveCfg = Release|x64 + {4589198B-EBD4-4811-B778-8AE270AEE0CD}.Release|x64.Build.0 = Release|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Debug|Win32.ActiveCfg = Debug|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Debug|Win32.Build.0 = Debug|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Debug|x64.ActiveCfg = Debug|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Debug|x64.Build.0 = Debug|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Release|Win32.ActiveCfg = Release|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Release|Win32.Build.0 = Release|Win32 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Release|x64.ActiveCfg = Release|x64 + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06}.Release|x64.Build.0 = Release|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.Debug|Win32.ActiveCfg = Debug|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.Debug|Win32.Build.0 = Debug|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.Debug|x64.ActiveCfg = Debug|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.Debug|x64.Build.0 = Debug|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.Release|Win32.ActiveCfg = Release|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.Release|Win32.Build.0 = Release|Win32 + {39392259-4561-44C0-98F1-64CA4396C025}.Release|x64.ActiveCfg = Release|x64 + {39392259-4561-44C0-98F1-64CA4396C025}.Release|x64.Build.0 = Release|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Debug|Win32.ActiveCfg = Debug|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Debug|Win32.Build.0 = Debug|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Debug|x64.ActiveCfg = Debug|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Debug|x64.Build.0 = Debug|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Release|Win32.ActiveCfg = Release|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Release|Win32.Build.0 = Release|Win32 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Release|x64.ActiveCfg = Release|x64 + {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5}.Release|x64.Build.0 = Release|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Debug|Win32.ActiveCfg = Debug|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Debug|Win32.Build.0 = Debug|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Debug|x64.ActiveCfg = Debug|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Debug|x64.Build.0 = Debug|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Fastbuild|x64.ActiveCfg = Release|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Release|Win32.ActiveCfg = Release|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Release|Win32.Build.0 = Release|Win32 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Release|x64.ActiveCfg = Release|x64 + {46274B55-07FE-4911-B4C0-D8B43A203B4A}.Release|x64.Build.0 = Release|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Debug|Win32.ActiveCfg = Debug|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Debug|Win32.Build.0 = Debug|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Debug|x64.ActiveCfg = Debug|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Debug|x64.Build.0 = Debug|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalDebug|Win32.ActiveCfg = Debug|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalDebug|Win32.Build.0 = Debug|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalDebug|x64.ActiveCfg = Debug|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalDebug|x64.Build.0 = Debug|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalFastbuild|Win32.ActiveCfg = Release|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalFastbuild|Win32.Build.0 = Release|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalFastbuild|x64.ActiveCfg = Fastbuild|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalFastbuild|x64.Build.0 = Fastbuild|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalRelease|Win32.ActiveCfg = Release|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalRelease|Win32.Build.0 = Release|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalRelease|x64.ActiveCfg = Release|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.InternalRelease|x64.Build.0 = Release|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Release|Win32.ActiveCfg = Release|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Release|Win32.Build.0 = Release|Win32 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Release|x64.ActiveCfg = Release|x64 + {25FDF327-EB7A-484A-96BC-AF2DB089D6F4}.Release|x64.Build.0 = Release|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.Debug|Win32.ActiveCfg = InternalDebug|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.Debug|x64.ActiveCfg = InternalDebug|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.Fastbuild|Win32.ActiveCfg = InternalRelease|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.Fastbuild|x64.ActiveCfg = InternalRelease|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalDebug|Win32.ActiveCfg = InternalDebug|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalDebug|Win32.Build.0 = InternalDebug|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalDebug|x64.ActiveCfg = InternalDebug|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalDebug|x64.Build.0 = InternalDebug|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalFastbuild|Win32.ActiveCfg = InternalFastbuild|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalFastbuild|Win32.Build.0 = InternalFastbuild|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalFastbuild|x64.ActiveCfg = InternalFastbuild|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalFastbuild|x64.Build.0 = InternalFastbuild|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalRelease|Win32.ActiveCfg = InternalRelease|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalRelease|Win32.Build.0 = InternalRelease|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalRelease|x64.ActiveCfg = InternalRelease|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.InternalRelease|x64.Build.0 = InternalRelease|x64 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.Release|Win32.ActiveCfg = InternalRelease|Win32 + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3}.Release|x64.ActiveCfg = InternalRelease|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -Nru sumo-0.15.0~dfsg/build/msvc10/jtrrouter/jtrrouter.vcxproj sumo-0.16.0~dfsg/build/msvc10/jtrrouter/jtrrouter.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/jtrrouter/jtrrouter.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/jtrrouter/jtrrouter.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -30,24 +54,6 @@ {43569450-FB3D-46EA-B9AB-CE92295C5570} - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -63,11 +69,24 @@ + + + + + + + + + + + + + @@ -80,100 +99,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64F - $(ProjectName)64 - - - 0x0407 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - .\Debug/jtrrouterD.exe - - - - - 0x0407 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - .\Release/jtrrouter.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/jtrrouterF.exe - - - - - X64 - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 - - diff -Nru sumo-0.15.0~dfsg/build/msvc10/marouter/marouter.vcxproj sumo-0.16.0~dfsg/build/msvc10/marouter/marouter.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/marouter/marouter.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/marouter/marouter.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -1,28 +1,28 @@  - - Debug + + InternalDebug Win32 - - Debug + + InternalDebug x64 - - Fastbuild + + InternalFastbuild Win32 - - Fastbuild + + InternalFastbuild x64 - - Release + + InternalRelease Win32 - - Release + + InternalRelease x64 @@ -31,132 +31,57 @@ MFCProj - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - + - + + - + + - + - + + - + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F + $(ProjectName)D + $(ProjectName)64D + $(ProjectName) + $(ProjectName)64 + $(ProjectName)F + $(ProjectName)64F - - - $(XERCES_DEBUG_LIB);ws2_32.lib - .\Debug/marouterD.exe - - - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Release/marouter.exe - - - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/marouterF.exe - - - - - X64 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 - - diff -Nru sumo-0.15.0~dfsg/build/msvc10/meso.props sumo-0.16.0~dfsg/build/msvc10/meso.props --- sumo-0.15.0~dfsg/build/msvc10/meso.props 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/meso.props 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ - - - - <_ProjectFileVersion>10.0.30319.1 - - - - HAVE_OSG;HAVE_MESOSIM;%(PreprocessorDefinitions) - - - \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/meso.sln sumo-0.16.0~dfsg/build/msvc10/meso.sln --- sumo-0.15.0~dfsg/build/msvc10/meso.sln 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/meso.sln 1970-01-01 00:00:00.000000000 +0000 @@ -1,932 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sumo-gui", "guisim\guisim.vcxproj", "{F1904C42-F231-4B9D-AD80-E2971969AFA0}" - ProjectSection(ProjectDependencies) = postProject - {308BEB29-142B-4088-BD41-80E273E20D3A} = {308BEB29-142B-4088-BD41-80E273E20D3A} - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0} = {F5218B3F-4CE3-47F7-8A3D-41683281EAA0} - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684} = {3CD3D44A-7809-485C-B7A9-D5FDE0C31684} - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sumo", "sumo\sumo.vcxproj", "{08C90F3F-95F3-46C7-8D87-63AF6DF5558C}" - ProjectSection(ProjectDependencies) = postProject - {308BEB29-142B-4088-BD41-80E273E20D3A} = {308BEB29-142B-4088-BD41-80E273E20D3A} - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libgui", "y_libgui\y_libgui.vcxproj", "{C9CC8A55-BCF5-44D8-9E22-55EA09757C60}" - ProjectSection(ProjectDependencies) = postProject - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} = {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libguinetload", "y_libguinetload\y_libguinetload.vcxproj", "{B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libguisim", "y_libguisim\y_libguisim.vcxproj", "{9046260E-78AA-4458-BE80-0747860A0F70}" - ProjectSection(ProjectDependencies) = postProject - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} = {492B0B5A-0BBE-49BA-82E6-70A82DBC242F} - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} = {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libmesogui", "y_libmesogui\y_libmesogui.vcxproj", "{3CD3D44A-7809-485C-B7A9-D5FDE0C31684}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libmesosim", "y_libmesosim\y_libmesosim.vcxproj", "{308BEB29-142B-4088-BD41-80E273E20D3A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libmicrosim", "y_libmicrosim\y_libmicrosim.vcxproj", "{2A069662-6B6F-40D7-A808-211F9C9A4AAE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetload", "y_libnetload\y_libnetload.vcxproj", "{5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_output", "z_libmicrosim_output\z_libmicrosim_output.vcxproj", "{CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_traffic_lights", "z_libmicrosim_traffic_lights\z_libmicrosim_traffic_lights.vcxproj", "{AF2015D2-2412-4355-87FB-E0D88B0A5FBA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_common", "z_libutils_common\z_libutils_common.vcxproj", "{72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_foxtools", "z_libutils_foxtools\z_libutils_foxtools.vcxproj", "{ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_geom", "z_libutils_geom\z_libutils_geom.vcxproj", "{334DF447-D0B3-4CEA-9693-F755EB11C18F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_iodevices", "z_libutils_iodevices\z_libutils_iodevices.vcxproj", "{FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_options", "z_libutils_options\z_libutils_options.vcxproj", "{EE29AF87-7317-488D-BF6D-EC422D1DBAD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_xml", "z_libutils_xml\z_libutils_xml.vcxproj", "{508F0BFF-83FE-444C-9509-A359BCA83BC4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_importio", "z_libutils_importio\z_libutils_importio.vcxproj", "{9FCF1CAF-0189-4242-88BA-47706E741119}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_actions", "z_libmicrosim_actions\z_libmicrosim_actions.vcxproj", "{A54D4A8B-9520-40F0-B8CB-152BF506CB47}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_logging", "z_libmicrosim_logging\z_libmicrosim_logging.vcxproj", "{0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libmicrosim_trigger", "z_libmicrosim_trigger\z_libmicrosim_trigger.vcxproj", "{26F88652-2664-4CE7-8292-6BD37EE6C3AD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_div", "z_libutils_gui_div\z_libutils_gui_div.vcxproj", "{E3AB9C37-6B5A-4D8C-88F3-DF750A493511}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_settings", "z_libutils_gui_settings\z_libutils_gui_settings.vcxproj", "{8C2F733C-1C8E-45C9-A546-17EF0146718D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_images", "z_libutils_gui_images\z_libutils_gui_images.vcxproj", "{5F818AF6-963E-40B3-93F3-35E145FDE30B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_nvwa", "zz_foreign_nvwa\zz_foreign_nvwa.vcxproj", "{FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_tcpip", "zz_foreign_tcpip\zz_foreign_tcpip.vcxproj", "{492B0B5A-0BBE-49BA-82E6-70A82DBC242F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_polyfonts", "zz_foreign_polyfonts\zz_foreign_polyfonts.vcxproj", "{306768A4-B73E-4B81-9EC0-B4836EFE0504}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_gl2ps", "zz_foreign_gl2ps\zz_foreign_gl2ps.vcxproj", "{272D2367-13FE-45C2-84AD-8480861DB43E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_windows", "z_libutils_gui_windows\z_libutils_gui_windows.vcxproj", "{25AF2C06-8B08-4B33-8775-657E27C304D9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_tracker", "z_libutils_gui_tracker\z_libutils_gui_tracker.vcxproj", "{67E76D22-3C3E-44FC-9253-3FE583DB7848}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_globjects", "z_libutils_gui_globjects\z_libutils_gui_globjects.vcxproj", "{39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_gui_events", "z_libutils_gui_events\z_libutils_gui_events.vcxproj", "{F574684D-2052-46AB-99B9-AFD5DA2174A6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libgui_dialogs", "z_libgui_dialogs\z_libgui_dialogs.vcxproj", "{80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_optional_libtraciserver", "z_optional_libtraciserver\z_optional_libtraciserver.vcxproj", "{00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netedit", "netedit\netedit.vcxproj", "{813B2D7E-CC23-4650-892F-553B1AFD912C}" - ProjectSection(ProjectDependencies) = postProject - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6} = {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6} - {25AF2C06-8B08-4B33-8775-657E27C304D9} = {25AF2C06-8B08-4B33-8775-657E27C304D9} - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20} = {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20} - {F7F13336-3E29-4219-8580-A17C71E69718} = {F7F13336-3E29-4219-8580-A17C71E69718} - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511} = {E3AB9C37-6B5A-4D8C-88F3-DF750A493511} - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6} = {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6} - {8C2F733C-1C8E-45C9-A546-17EF0146718D} = {8C2F733C-1C8E-45C9-A546-17EF0146718D} - {334DF447-D0B3-4CEA-9693-F755EB11C18F} = {334DF447-D0B3-4CEA-9693-F755EB11C18F} - {F574684D-2052-46AB-99B9-AFD5DA2174A6} = {F574684D-2052-46AB-99B9-AFD5DA2174A6} - {272D2367-13FE-45C2-84AD-8480861DB43E} = {272D2367-13FE-45C2-84AD-8480861DB43E} - {50B2C273-2B6A-4A3A-BE24-83E3202DE180} = {50B2C273-2B6A-4A3A-BE24-83E3202DE180} - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6} = {EE29AF87-7317-488D-BF6D-EC422D1DBAD6} - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8} = {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8} - {306768A4-B73E-4B81-9EC0-B4836EFE0504} = {306768A4-B73E-4B81-9EC0-B4836EFE0504} - {9FCF1CAF-0189-4242-88BA-47706E741119} = {9FCF1CAF-0189-4242-88BA-47706E741119} - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD} = {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD} - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1} = {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1} - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47} = {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47} - {91422FEF-2369-45E6-87AA-8B38709AD823} = {91422FEF-2369-45E6-87AA-8B38709AD823} - {91422FEF-2369-45E6-87AA-8B38709AD824} = {91422FEF-2369-45E6-87AA-8B38709AD824} - {5F818AF6-963E-40B3-93F3-35E145FDE30B} = {5F818AF6-963E-40B3-93F3-35E145FDE30B} - {508F0BFF-83FE-444C-9509-A359BCA83BC4} = {508F0BFF-83FE-444C-9509-A359BCA83BC4} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetbuild", "y_libnetbuild\y_libnetbuild.vcxproj", "{BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetimport", "y_libnetimport\y_libnetimport.vcxproj", "{91422FEF-2369-45E6-87AA-8B38709AD823}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libnetimport_vissim", "z_libnetimport_vissim\z_libnetimport_vissim.vcxproj", "{F7F13336-3E29-4219-8580-A17C71E69718}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "z_libutils_distribution", "z_libutils_distribution\z_libutils_distribution.vcxproj", "{F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zz_foreign_eulerspiral", "zz_foreign_eulerspiral\zz_foreign_eulerspiral.vcxproj", "{50B2C273-2B6A-4A3A-BE24-83E3202DE180}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_libnetwrite", "y_libnetwrite\y_libnetwrite.vcxproj", "{91422FEF-2369-45E6-87AA-8B38709AD824}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_osgview", "y_osgview\y_osgview.vcxproj", "{F5218B3F-4CE3-47F7-8A3D-41683281EAA0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marouter", "marouter\marouter.vcxproj", "{90205628-51D7-4194-9FC0-7D74C35A3471}" - ProjectSection(ProjectDependencies) = postProject - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D} = {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "y_librouter", "y_librouter\y_librouter.vcxproj", "{A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Fastbuild|Win32 = Fastbuild|Win32 - Fastbuild|x64 = Fastbuild|x64 - MesoDebug|Win32 = MesoDebug|Win32 - MesoDebug|x64 = MesoDebug|x64 - MesoRelease|Win32 = MesoRelease|Win32 - MesoRelease|x64 = MesoRelease|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|Win32.ActiveCfg = Debug|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|x64.ActiveCfg = Debug|x64 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Release|Win32.ActiveCfg = Release|Win32 - {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Release|x64.ActiveCfg = Release|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Debug|Win32.ActiveCfg = Debug|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Debug|x64.ActiveCfg = Debug|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Release|Win32.ActiveCfg = Release|Win32 - {08C90F3F-95F3-46C7-8D87-63AF6DF5558C}.Release|x64.ActiveCfg = Release|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|Win32.ActiveCfg = Debug|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|Win32.Build.0 = Debug|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|x64.ActiveCfg = Debug|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Debug|x64.Build.0 = Debug|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|Win32.ActiveCfg = Release|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|Win32.Build.0 = Release|Win32 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|x64.ActiveCfg = Release|x64 - {C9CC8A55-BCF5-44D8-9E22-55EA09757C60}.Release|x64.Build.0 = Release|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|Win32.ActiveCfg = Debug|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|Win32.Build.0 = Debug|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|x64.ActiveCfg = Debug|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Debug|x64.Build.0 = Debug|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|Win32.ActiveCfg = Release|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|Win32.Build.0 = Release|Win32 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|x64.ActiveCfg = Release|x64 - {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D}.Release|x64.Build.0 = Release|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.Debug|Win32.ActiveCfg = Debug|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.Debug|x64.ActiveCfg = Debug|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {9046260E-78AA-4458-BE80-0747860A0F70}.Release|Win32.ActiveCfg = Release|Win32 - {9046260E-78AA-4458-BE80-0747860A0F70}.Release|x64.ActiveCfg = Release|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Debug|Win32.ActiveCfg = MesoDebug|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Debug|x64.ActiveCfg = MesoDebug|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Fastbuild|Win32.ActiveCfg = MesoRelease|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Fastbuild|x64.ActiveCfg = MesoRelease|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Release|Win32.ActiveCfg = MesoRelease|Win32 - {3CD3D44A-7809-485C-B7A9-D5FDE0C31684}.Release|x64.ActiveCfg = MesoRelease|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.Debug|Win32.ActiveCfg = MesoDebug|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.Debug|x64.ActiveCfg = MesoDebug|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.Fastbuild|Win32.ActiveCfg = MesoRelease|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.Fastbuild|x64.ActiveCfg = MesoRelease|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {308BEB29-142B-4088-BD41-80E273E20D3A}.Release|Win32.ActiveCfg = MesoRelease|Win32 - {308BEB29-142B-4088-BD41-80E273E20D3A}.Release|x64.ActiveCfg = MesoRelease|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Debug|x64.ActiveCfg = Debug|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Release|Win32.ActiveCfg = Release|Win32 - {2A069662-6B6F-40D7-A808-211F9C9A4AAE}.Release|x64.ActiveCfg = Release|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|Win32.ActiveCfg = Debug|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|Win32.Build.0 = Debug|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|x64.ActiveCfg = Debug|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Debug|x64.Build.0 = Debug|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|Win32.ActiveCfg = Release|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|Win32.Build.0 = Release|Win32 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|x64.ActiveCfg = Release|x64 - {5EA5CB8F-2B57-4FAB-A769-E9A64B3B9C36}.Release|x64.Build.0 = Release|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Debug|Win32.ActiveCfg = Debug|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Debug|x64.ActiveCfg = Debug|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Release|Win32.ActiveCfg = Release|Win32 - {CC278DE5-D3D8-4BD8-B8A4-BD76CB8FB4F1}.Release|x64.ActiveCfg = Release|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Debug|Win32.ActiveCfg = Debug|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Debug|x64.ActiveCfg = Debug|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoDebug|Win32.Build.0 = Debug|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoDebug|x64.ActiveCfg = Debug|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoDebug|x64.Build.0 = Debug|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoRelease|Win32.Build.0 = Release|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoRelease|x64.ActiveCfg = Release|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.MesoRelease|x64.Build.0 = Release|x64 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Release|Win32.ActiveCfg = Release|Win32 - {AF2015D2-2412-4355-87FB-E0D88B0A5FBA}.Release|x64.ActiveCfg = Release|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|Win32.ActiveCfg = Debug|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|Win32.Build.0 = Debug|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|x64.ActiveCfg = Debug|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Debug|x64.Build.0 = Debug|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoDebug|Win32.Build.0 = Debug|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoDebug|x64.ActiveCfg = Debug|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoDebug|x64.Build.0 = Debug|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoRelease|Win32.Build.0 = Release|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoRelease|x64.ActiveCfg = Release|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.MesoRelease|x64.Build.0 = Release|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|Win32.ActiveCfg = Release|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|Win32.Build.0 = Release|Win32 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|x64.ActiveCfg = Release|x64 - {72CDB11A-EC19-4BE2-BBE9-1FA33DECCB20}.Release|x64.Build.0 = Release|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|Win32.Build.0 = Debug|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|x64.ActiveCfg = Debug|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Debug|x64.Build.0 = Debug|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoDebug|Win32.Build.0 = Debug|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoDebug|x64.ActiveCfg = Debug|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoDebug|x64.Build.0 = Debug|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoRelease|Win32.Build.0 = Release|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoRelease|x64.ActiveCfg = Release|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.MesoRelease|x64.Build.0 = Release|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|Win32.ActiveCfg = Release|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|Win32.Build.0 = Release|Win32 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|x64.ActiveCfg = Release|x64 - {ECAEBBBD-18B0-4E40-9507-4AD2B018C1CD}.Release|x64.Build.0 = Release|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|Win32.ActiveCfg = Debug|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|Win32.Build.0 = Debug|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|x64.ActiveCfg = Debug|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Debug|x64.Build.0 = Debug|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoDebug|Win32.Build.0 = Debug|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoDebug|x64.ActiveCfg = Debug|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoDebug|x64.Build.0 = Debug|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoRelease|Win32.Build.0 = Release|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoRelease|x64.ActiveCfg = Release|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.MesoRelease|x64.Build.0 = Release|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|Win32.ActiveCfg = Release|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|Win32.Build.0 = Release|Win32 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|x64.ActiveCfg = Release|x64 - {334DF447-D0B3-4CEA-9693-F755EB11C18F}.Release|x64.Build.0 = Release|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|Win32.Build.0 = Debug|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|x64.ActiveCfg = Debug|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Debug|x64.Build.0 = Debug|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoDebug|Win32.Build.0 = Debug|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoDebug|x64.ActiveCfg = Debug|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoDebug|x64.Build.0 = Debug|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoRelease|Win32.Build.0 = Release|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoRelease|x64.ActiveCfg = Release|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.MesoRelease|x64.Build.0 = Release|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|Win32.ActiveCfg = Release|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|Win32.Build.0 = Release|Win32 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|x64.ActiveCfg = Release|x64 - {FC588F88-FFC4-4EBD-A790-1B1FE06E1FC8}.Release|x64.Build.0 = Release|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|Win32.ActiveCfg = Debug|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|Win32.Build.0 = Debug|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|x64.ActiveCfg = Debug|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Debug|x64.Build.0 = Debug|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoDebug|Win32.Build.0 = Debug|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoDebug|x64.ActiveCfg = Debug|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoDebug|x64.Build.0 = Debug|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoRelease|Win32.Build.0 = Release|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoRelease|x64.ActiveCfg = Release|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.MesoRelease|x64.Build.0 = Release|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|Win32.ActiveCfg = Release|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|Win32.Build.0 = Release|Win32 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|x64.ActiveCfg = Release|x64 - {EE29AF87-7317-488D-BF6D-EC422D1DBAD6}.Release|x64.Build.0 = Release|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|Win32.ActiveCfg = Debug|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|Win32.Build.0 = Debug|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|x64.ActiveCfg = Debug|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Debug|x64.Build.0 = Debug|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoDebug|Win32.Build.0 = Debug|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoDebug|x64.ActiveCfg = Debug|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoDebug|x64.Build.0 = Debug|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoRelease|Win32.Build.0 = Release|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoRelease|x64.ActiveCfg = Release|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.MesoRelease|x64.Build.0 = Release|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|Win32.ActiveCfg = Release|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|Win32.Build.0 = Release|Win32 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|x64.ActiveCfg = Release|x64 - {508F0BFF-83FE-444C-9509-A359BCA83BC4}.Release|x64.Build.0 = Release|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|Win32.ActiveCfg = Debug|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|Win32.Build.0 = Debug|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|x64.ActiveCfg = Debug|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Debug|x64.Build.0 = Debug|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoDebug|Win32.Build.0 = Debug|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoDebug|x64.ActiveCfg = Debug|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoDebug|x64.Build.0 = Debug|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoRelease|Win32.Build.0 = Release|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoRelease|x64.ActiveCfg = Release|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.MesoRelease|x64.Build.0 = Release|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|Win32.ActiveCfg = Release|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|Win32.Build.0 = Release|Win32 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|x64.ActiveCfg = Release|x64 - {9FCF1CAF-0189-4242-88BA-47706E741119}.Release|x64.Build.0 = Release|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Debug|Win32.ActiveCfg = Debug|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Debug|x64.ActiveCfg = Debug|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoDebug|Win32.Build.0 = Debug|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoDebug|x64.ActiveCfg = Debug|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoDebug|x64.Build.0 = Debug|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoRelease|Win32.Build.0 = Release|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoRelease|x64.ActiveCfg = Release|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.MesoRelease|x64.Build.0 = Release|x64 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Release|Win32.ActiveCfg = Release|Win32 - {A54D4A8B-9520-40F0-B8CB-152BF506CB47}.Release|x64.ActiveCfg = Release|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Debug|Win32.ActiveCfg = Debug|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Debug|x64.ActiveCfg = Debug|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoDebug|Win32.Build.0 = Debug|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoDebug|x64.ActiveCfg = Debug|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoDebug|x64.Build.0 = Debug|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoRelease|Win32.Build.0 = Release|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoRelease|x64.ActiveCfg = Release|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.MesoRelease|x64.Build.0 = Release|x64 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Release|Win32.ActiveCfg = Release|Win32 - {0716FBE6-18CE-4ED5-B5EC-0B358991A8EF}.Release|x64.ActiveCfg = Release|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Debug|Win32.ActiveCfg = Debug|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Debug|x64.ActiveCfg = Debug|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Release|Win32.ActiveCfg = Release|Win32 - {26F88652-2664-4CE7-8292-6BD37EE6C3AD}.Release|x64.ActiveCfg = Release|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|Win32.ActiveCfg = Debug|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|Win32.Build.0 = Debug|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|x64.ActiveCfg = Debug|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Debug|x64.Build.0 = Debug|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoDebug|Win32.Build.0 = Debug|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoDebug|x64.ActiveCfg = Debug|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoDebug|x64.Build.0 = Debug|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoRelease|Win32.Build.0 = Release|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoRelease|x64.ActiveCfg = Release|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.MesoRelease|x64.Build.0 = Release|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|Win32.ActiveCfg = Release|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|Win32.Build.0 = Release|Win32 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|x64.ActiveCfg = Release|x64 - {E3AB9C37-6B5A-4D8C-88F3-DF750A493511}.Release|x64.Build.0 = Release|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|Win32.ActiveCfg = Debug|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|Win32.Build.0 = Debug|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|x64.ActiveCfg = Debug|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Debug|x64.Build.0 = Debug|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|Win32.ActiveCfg = Release|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|Win32.Build.0 = Release|Win32 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|x64.ActiveCfg = Release|x64 - {8C2F733C-1C8E-45C9-A546-17EF0146718D}.Release|x64.Build.0 = Release|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|Win32.ActiveCfg = Debug|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|Win32.Build.0 = Debug|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|x64.ActiveCfg = Debug|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Debug|x64.Build.0 = Debug|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoDebug|Win32.Build.0 = Debug|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoDebug|x64.ActiveCfg = Debug|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoDebug|x64.Build.0 = Debug|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoRelease|Win32.Build.0 = Release|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoRelease|x64.ActiveCfg = Release|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.MesoRelease|x64.Build.0 = Release|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|Win32.ActiveCfg = Release|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|Win32.Build.0 = Release|Win32 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|x64.ActiveCfg = Release|x64 - {5F818AF6-963E-40B3-93F3-35E145FDE30B}.Release|x64.Build.0 = Release|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|Win32.Build.0 = Debug|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|x64.ActiveCfg = Debug|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Debug|x64.Build.0 = Debug|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoDebug|Win32.Build.0 = Debug|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoDebug|x64.ActiveCfg = Debug|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoDebug|x64.Build.0 = Debug|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoRelease|Win32.Build.0 = Release|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoRelease|x64.ActiveCfg = Release|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.MesoRelease|x64.Build.0 = Release|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|Win32.ActiveCfg = Release|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|Win32.Build.0 = Release|Win32 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|x64.ActiveCfg = Release|x64 - {FC5B65E0-A0B1-40D7-8687-C2FC79E3DA47}.Release|x64.Build.0 = Release|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|Win32.ActiveCfg = Debug|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|Win32.Build.0 = Debug|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|x64.ActiveCfg = Debug|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Debug|x64.Build.0 = Debug|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoDebug|Win32.Build.0 = Debug|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoDebug|x64.ActiveCfg = Debug|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoDebug|x64.Build.0 = Debug|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoRelease|Win32.Build.0 = Release|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoRelease|x64.ActiveCfg = Release|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.MesoRelease|x64.Build.0 = Release|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|Win32.ActiveCfg = Release|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|Win32.Build.0 = Release|Win32 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|x64.ActiveCfg = Release|x64 - {492B0B5A-0BBE-49BA-82E6-70A82DBC242F}.Release|x64.Build.0 = Release|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|Win32.ActiveCfg = Debug|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|Win32.Build.0 = Debug|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|x64.ActiveCfg = Debug|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Debug|x64.Build.0 = Debug|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoDebug|Win32.Build.0 = Debug|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoDebug|x64.ActiveCfg = Debug|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoDebug|x64.Build.0 = Debug|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoRelease|Win32.Build.0 = Release|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoRelease|x64.ActiveCfg = Release|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.MesoRelease|x64.Build.0 = Release|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|Win32.ActiveCfg = Release|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|Win32.Build.0 = Release|Win32 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|x64.ActiveCfg = Release|x64 - {306768A4-B73E-4B81-9EC0-B4836EFE0504}.Release|x64.Build.0 = Release|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|Win32.ActiveCfg = Debug|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|Win32.Build.0 = Debug|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|x64.ActiveCfg = Debug|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Debug|x64.Build.0 = Debug|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoDebug|Win32.Build.0 = Debug|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoDebug|x64.ActiveCfg = Debug|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoDebug|x64.Build.0 = Debug|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoRelease|Win32.Build.0 = Release|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoRelease|x64.ActiveCfg = Release|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.MesoRelease|x64.Build.0 = Release|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|Win32.ActiveCfg = Release|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|Win32.Build.0 = Release|Win32 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|x64.ActiveCfg = Release|x64 - {272D2367-13FE-45C2-84AD-8480861DB43E}.Release|x64.Build.0 = Release|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|Win32.ActiveCfg = Debug|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|Win32.Build.0 = Debug|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|x64.ActiveCfg = Debug|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Debug|x64.Build.0 = Debug|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|Win32.ActiveCfg = Release|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|Win32.Build.0 = Release|Win32 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|x64.ActiveCfg = Release|x64 - {25AF2C06-8B08-4B33-8775-657E27C304D9}.Release|x64.Build.0 = Release|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|Win32.ActiveCfg = Debug|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|Win32.Build.0 = Debug|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|x64.ActiveCfg = Debug|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Debug|x64.Build.0 = Debug|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoDebug|Win32.Build.0 = Debug|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoDebug|x64.ActiveCfg = Debug|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoDebug|x64.Build.0 = Debug|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoRelease|Win32.Build.0 = Release|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoRelease|x64.ActiveCfg = Release|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.MesoRelease|x64.Build.0 = Release|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|Win32.ActiveCfg = Release|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|Win32.Build.0 = Release|Win32 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|x64.ActiveCfg = Release|x64 - {67E76D22-3C3E-44FC-9253-3FE583DB7848}.Release|x64.Build.0 = Release|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|Win32.ActiveCfg = Debug|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|Win32.Build.0 = Debug|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|x64.ActiveCfg = Debug|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Debug|x64.Build.0 = Debug|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoDebug|Win32.Build.0 = Debug|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoDebug|x64.ActiveCfg = Debug|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoDebug|x64.Build.0 = Debug|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoRelease|Win32.Build.0 = Release|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoRelease|x64.ActiveCfg = Release|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.MesoRelease|x64.Build.0 = Release|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|Win32.ActiveCfg = Release|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|Win32.Build.0 = Release|Win32 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|x64.ActiveCfg = Release|x64 - {39F2DFDE-76C6-46FD-A20A-6C8FD52C9DB1}.Release|x64.Build.0 = Release|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|Win32.ActiveCfg = Debug|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|Win32.Build.0 = Debug|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|x64.ActiveCfg = Debug|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Debug|x64.Build.0 = Debug|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoDebug|Win32.Build.0 = Debug|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoDebug|x64.ActiveCfg = Debug|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoDebug|x64.Build.0 = Debug|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoRelease|Win32.Build.0 = Release|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoRelease|x64.ActiveCfg = Release|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.MesoRelease|x64.Build.0 = Release|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|Win32.ActiveCfg = Release|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|Win32.Build.0 = Release|Win32 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|x64.ActiveCfg = Release|x64 - {F574684D-2052-46AB-99B9-AFD5DA2174A6}.Release|x64.Build.0 = Release|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|Win32.ActiveCfg = Debug|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|Win32.Build.0 = Debug|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|x64.ActiveCfg = Debug|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Debug|x64.Build.0 = Debug|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|Win32.ActiveCfg = Release|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|Win32.Build.0 = Release|Win32 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|x64.ActiveCfg = Release|x64 - {80AC8A07-6702-4D2E-AF75-F8DB7FDA169A}.Release|x64.Build.0 = Release|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Debug|Win32.ActiveCfg = Debug|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Debug|x64.ActiveCfg = Debug|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Release|Win32.ActiveCfg = Release|Win32 - {00A244E4-0F0D-49B9-A557-5EF1F8B98D7C}.Release|x64.ActiveCfg = Release|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Debug|Win32.ActiveCfg = Debug|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Debug|Win32.Build.0 = Debug|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Debug|x64.ActiveCfg = Debug|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Debug|x64.Build.0 = Debug|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.MesoDebug|x64.ActiveCfg = Debug|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.MesoRelease|x64.ActiveCfg = Release|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Release|Win32.ActiveCfg = Release|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Release|Win32.Build.0 = Release|Win32 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Release|x64.ActiveCfg = Release|x64 - {813B2D7E-CC23-4650-892F-553B1AFD912C}.Release|x64.Build.0 = Release|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|Win32.ActiveCfg = Debug|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|Win32.Build.0 = Debug|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|x64.ActiveCfg = Debug|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Debug|x64.Build.0 = Debug|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoDebug|Win32.Build.0 = Debug|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoDebug|x64.ActiveCfg = Debug|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoDebug|x64.Build.0 = Debug|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoRelease|Win32.Build.0 = Release|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoRelease|x64.ActiveCfg = Release|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.MesoRelease|x64.Build.0 = Release|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|Win32.ActiveCfg = Release|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|Win32.Build.0 = Release|Win32 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|x64.ActiveCfg = Release|x64 - {BD855404-FA32-48AE-9AB3-FB8B3D71C8C6}.Release|x64.Build.0 = Release|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|Win32.ActiveCfg = Debug|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|Win32.Build.0 = Debug|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|x64.ActiveCfg = Debug|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Debug|x64.Build.0 = Debug|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.MesoDebug|x64.ActiveCfg = Debug|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.MesoRelease|x64.ActiveCfg = Release|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|Win32.ActiveCfg = Release|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|Win32.Build.0 = Release|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|x64.ActiveCfg = Release|x64 - {91422FEF-2369-45E6-87AA-8B38709AD823}.Release|x64.Build.0 = Release|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|Win32.ActiveCfg = Debug|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|Win32.Build.0 = Debug|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|x64.ActiveCfg = Debug|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.Debug|x64.Build.0 = Debug|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.MesoDebug|x64.ActiveCfg = Debug|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.MesoRelease|x64.ActiveCfg = Release|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.Release|Win32.ActiveCfg = Release|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.Release|Win32.Build.0 = Release|Win32 - {F7F13336-3E29-4219-8580-A17C71E69718}.Release|x64.ActiveCfg = Release|x64 - {F7F13336-3E29-4219-8580-A17C71E69718}.Release|x64.Build.0 = Release|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|Win32.ActiveCfg = Debug|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|Win32.Build.0 = Debug|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|x64.ActiveCfg = Debug|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Debug|x64.Build.0 = Debug|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoDebug|Win32.Build.0 = Debug|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoDebug|x64.ActiveCfg = Debug|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoDebug|x64.Build.0 = Debug|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoRelease|Win32.Build.0 = Release|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoRelease|x64.ActiveCfg = Release|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.MesoRelease|x64.Build.0 = Release|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|Win32.ActiveCfg = Release|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|Win32.Build.0 = Release|Win32 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|x64.ActiveCfg = Release|x64 - {F5D8313C-621D-4CCE-A6DA-83EFFBDE7CE6}.Release|x64.Build.0 = Release|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|Win32.ActiveCfg = Debug|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|Win32.Build.0 = Debug|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|x64.ActiveCfg = Debug|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Debug|x64.Build.0 = Debug|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoDebug|Win32.Build.0 = Debug|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoDebug|x64.ActiveCfg = Debug|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoDebug|x64.Build.0 = Debug|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoRelease|Win32.Build.0 = Release|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoRelease|x64.ActiveCfg = Release|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.MesoRelease|x64.Build.0 = Release|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|Win32.ActiveCfg = Release|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|Win32.Build.0 = Release|Win32 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|x64.ActiveCfg = Release|x64 - {50B2C273-2B6A-4A3A-BE24-83E3202DE180}.Release|x64.Build.0 = Release|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|Win32.ActiveCfg = Debug|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|Win32.Build.0 = Debug|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|x64.ActiveCfg = Debug|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Debug|x64.Build.0 = Debug|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.MesoDebug|x64.ActiveCfg = Debug|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.MesoRelease|x64.ActiveCfg = Release|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|Win32.ActiveCfg = Release|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|Win32.Build.0 = Release|Win32 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|x64.ActiveCfg = Release|x64 - {91422FEF-2369-45E6-87AA-8B38709AD824}.Release|x64.Build.0 = Release|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Debug|Win32.ActiveCfg = MesoDebug|Win32 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Debug|x64.ActiveCfg = MesoDebug|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Fastbuild|Win32.ActiveCfg = MesoRelease|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Fastbuild|x64.ActiveCfg = MesoRelease|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoDebug|Win32.ActiveCfg = MesoDebug|Win32 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoDebug|Win32.Build.0 = MesoDebug|Win32 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoDebug|x64.ActiveCfg = MesoDebug|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoDebug|x64.Build.0 = MesoDebug|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoRelease|Win32.ActiveCfg = MesoRelease|Win32 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoRelease|Win32.Build.0 = MesoRelease|Win32 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoRelease|x64.ActiveCfg = MesoRelease|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.MesoRelease|x64.Build.0 = MesoRelease|x64 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Release|Win32.ActiveCfg = MesoRelease|Win32 - {F5218B3F-4CE3-47F7-8A3D-41683281EAA0}.Release|x64.ActiveCfg = MesoRelease|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|Win32.ActiveCfg = Debug|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|Win32.Build.0 = Debug|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|x64.ActiveCfg = Debug|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|x64.Build.0 = Debug|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.MesoDebug|x64.ActiveCfg = Debug|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.MesoRelease|x64.ActiveCfg = Release|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|Win32.ActiveCfg = Release|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|Win32.Build.0 = Release|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|x64.ActiveCfg = Release|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|x64.Build.0 = Release|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|Win32.ActiveCfg = Debug|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|Win32.Build.0 = Debug|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|x64.ActiveCfg = Debug|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Debug|x64.Build.0 = Debug|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.MesoDebug|Win32.ActiveCfg = Debug|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.MesoDebug|x64.ActiveCfg = Debug|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.MesoRelease|Win32.ActiveCfg = Release|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.MesoRelease|x64.ActiveCfg = Release|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|Win32.ActiveCfg = Release|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|Win32.Build.0 = Release|Win32 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|x64.ActiveCfg = Release|x64 - {A003A0ED-38C6-4E03-84D1-BA42D25ABC4D}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff -Nru sumo-0.15.0~dfsg/build/msvc10/netconvert/netconvert.vcxproj sumo-0.16.0~dfsg/build/msvc10/netconvert/netconvert.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/netconvert/netconvert.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netconvert/netconvert.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -32,24 +56,6 @@ MFCProj - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -65,11 +71,24 @@ + + + + + + + + + + + + + @@ -82,98 +101,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F - - 0x0407 - $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib - .\Debug/netconvertD.exe + + + + + $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalDebug\y_libinternal.lib - - 0x0407 - $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe + + + + + $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalDebug\y_libinternal.lib - - 0x0407 - $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib - .\Release/netconvert.exe + + + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalRelease\y_libinternal.lib - - 0x0407 - $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe + + + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalRelease\y_libinternal.lib - - 0x0407 - $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib - .\Fastbuild/netconvertF.exe - - X64 - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib + + + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalFastbuild\y_libinternal.lib + + + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalFastbuild\y_libinternal.lib diff -Nru sumo-0.15.0~dfsg/build/msvc10/netedit/netedit.vcxproj sumo-0.16.0~dfsg/build/msvc10/netedit/netedit.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/netedit/netedit.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netedit/netedit.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -1,28 +1,28 @@  - - Debug + + InternalDebug Win32 - - Debug + + InternalDebug x64 - - Fastbuild + + InternalFastbuild Win32 - - Fastbuild + + InternalFastbuild x64 - - Release + + InternalRelease Win32 - - Release + + InternalRelease x64 @@ -32,140 +32,87 @@ netedit - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - + + - + + - + + - + + - + + - + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F + $(ProjectName)D + $(ProjectName)64D + $(ProjectName) + $(ProjectName)64 + $(ProjectName)F + $(ProjectName)64F - + - $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)neteditD.exe + $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalDebug\y_libinternal.lib - + - $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)netedit64D.exe + $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_DEBUG_LIB);$(FOX16_DEBUG_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalDebug\y_libinternal.lib - + - $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)netedit.exe - Windows - mainCRTStartup - NotSet - true + $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalRelease\y_libinternal.lib - - IF EXIST ..\..\..\src\netedit\.svn\entries python ..\..\..\tools\build\version.py ..\..\..\src\netedit ..\..\..\src\netedit - - - false - - + - $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)netedit64.exe + $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalRelease\y_libinternal.lib - + $(PROJ_LIB);$(GDAL_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)neteditF.exe - - - X64 - + $(PROJ_LIB);shell32.lib;opengl32.lib;glu32.lib;$(XERCES_LIB);$(FOX16_LIB);user32.lib;winmm.lib;vfw32.lib;gdi32.lib;ws2_32.lib - $(OutDir)netedit64F.exe - MachineX64 @@ -188,6 +135,7 @@ + @@ -219,6 +167,7 @@ + diff -Nru sumo-0.15.0~dfsg/build/msvc10/netedit/netedit.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/netedit/netedit.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/netedit/netedit.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netedit/netedit.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -90,6 +90,9 @@ Quellcodedateien + + Quellcodedateien + @@ -178,5 +181,8 @@ Header-Dateien + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/netgen/netgen.vcxproj sumo-0.16.0~dfsg/build/msvc10/netgen/netgen.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/netgen/netgen.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netgen/netgen.vcxproj 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Fastbuild - Win32 - - - Fastbuild - x64 - - - Release - Win32 - - - Release - x64 - - - - {F241CA03-4AB1-4BB0-8151-7AF078E2BC06} - MFCProj - - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - .\Release/netgen.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - 0x0407 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - .\Debug/netgenD.exe - - - - - 0x0407 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/netgenF.exe - - - - - X64 - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 - - - - - - - - - - - - - - - - - - - - {bd855404-fa32-48ae-9ab3-fb8b3d71c8c6} - false - - - {b0c268f3-2153-8ddc-fac6-bb599e20126d} - false - - - {fc5b65e0-a0b1-40d7-8687-c2fc79e3da47} - false - - - {492b0b5a-0bbe-49ba-82e6-70a82dbc242f} - false - - - {72cdb11a-ec19-4be2-bbe9-1fa33deccb20} - false - - - {334df447-d0b3-4cea-9693-f755eb11c18f} - false - - - {fc588f88-ffc4-4ebd-a790-1b1fe06e1fc8} - false - - - {ee29af87-7317-488d-bf6d-ec422d1dbad6} - false - - - {508f0bff-83fe-444c-9509-a359bca83bc4} - false - - - - - - \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/netgen/netgen.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/netgen/netgen.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/netgen/netgen.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netgen/netgen.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - - - - {acc9d0d9-a841-48ac-9e02-306777cbdf5a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {c2ddfde9-d1c3-4f53-8589-9cc1a6f2e07c} - h;hpp;hxx;hm;inl - - - - - Quellcodedateien - - - Quellcodedateien - - - Quellcodedateien - - - Quellcodedateien - - - Quellcodedateien - - - Quellcodedateien - - - - - Header-Dateien - - - Header-Dateien - - - Header-Dateien - - - Header-Dateien - - - Header-Dateien - - - \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj sumo-0.16.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,195 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Fastbuild + Win32 + + + Fastbuild + x64 + + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + + + Release + Win32 + + + Release + x64 + + + + {F241CA03-4AB1-4BB0-8151-7AF078E2BC06} + MFCProj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + + + + + + + + + + + + {bd855404-fa32-48ae-9ab3-fb8b3d71c8c6} + false + + + {b0c268f3-2153-8ddc-fac6-bb599e20126d} + false + + + {fc5b65e0-a0b1-40d7-8687-c2fc79e3da47} + false + + + {492b0b5a-0bbe-49ba-82e6-70a82dbc242f} + false + + + {72cdb11a-ec19-4be2-bbe9-1fa33deccb20} + false + + + {334df447-d0b3-4cea-9693-f755eb11c18f} + false + + + {fc588f88-ffc4-4ebd-a790-1b1fe06e1fc8} + false + + + {ee29af87-7317-488d-bf6d-ec422d1dbad6} + false + + + {508f0bff-83fe-444c-9509-a359bca83bc4} + false + + + + + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/netgenerate/netgenerate.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,50 @@ + + + + + {acc9d0d9-a841-48ac-9e02-306777cbdf5a} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {c2ddfde9-d1c3-4f53-8589-9cc1a6f2e07c} + h;hpp;hxx;hm;inl + + + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/od2trips/od2trips.vcxproj sumo-0.16.0~dfsg/build/msvc10/od2trips/od2trips.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/od2trips/od2trips.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/od2trips/od2trips.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -30,24 +54,6 @@ {39392259-4561-44C0-98F1-64CA4396C025} - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -57,16 +63,29 @@ - + + - + + + + + + + + + + + + + @@ -74,104 +93,51 @@ - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64F - $(ProjectName)64 - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - .\Release/od2trips.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - - - - 0x0407 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - .\Debug/od2tripsD.exe - - - - - 0x0407 - - - $(XERCES_DEBUG_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - - - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib - .\Fastbuild/od2tripsF.exe - - - - - X64 - - - 0x0407 - $(XERCES_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 diff -Nru sumo-0.15.0~dfsg/build/msvc10/polyconvert/polyconvert.vcxproj sumo-0.16.0~dfsg/build/msvc10/polyconvert/polyconvert.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/polyconvert/polyconvert.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/polyconvert/polyconvert.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,30 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -30,24 +54,6 @@ {CEBAFD4D-0E92-4DEB-9CC9-BBCF78EBE1B5} - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -63,11 +69,24 @@ + + + + + + + + + + + + + @@ -80,98 +99,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - $(ProjectName)64 - $(ProjectName)64F - - 0x0407 - $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib - .\Debug/polyconvertD.exe + + + + + $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalDebug\y_libinternal.lib + + + + + $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib + + + + + $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalDebug\y_libinternal.lib - - 0x0407 - $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib - .\Release/polyconvert.exe - - - 0x0407 - + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalRelease\y_libinternal.lib + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib - .\Fastbuild/polyconvertF.exe - - - 0x0407 - + - $(PROJ_LIB);$(XERCES_DEBUG_LIB);$(GDAL_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalRelease\y_libinternal.lib - - - 0x0407 - + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - - X64 - - - 0x0407 - - - $(XERCES_LIB);ws2_32.lib;%(AdditionalDependencies) - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - MachineX64 + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib + + + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\InternalFastbuild\y_libinternal.lib + + + + + $(PROJ_LIB);$(XERCES_LIB);$(GDAL_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libinternal\x64\InternalFastbuild\y_libinternal.lib diff -Nru sumo-0.15.0~dfsg/build/msvc10/prj.sln sumo-0.16.0~dfsg/build/msvc10/prj.sln --- sumo-0.15.0~dfsg/build/msvc10/prj.sln 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/prj.sln 2012-12-04 00:26:11.000000000 +0000 @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "duarouter", "duarouter\duarouter.vcxproj", "{90205628-51D7-4194-9FC0-7D74C35A3471}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "duarouter", "duarouter\duarouter.vcxproj", "{8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sumo-gui", "guisim\guisim.vcxproj", "{F1904C42-F231-4B9D-AD80-E2971969AFA0}" EndProject @@ -11,7 +11,7 @@ {91422FEF-2369-45E6-87AA-8B38709AD824} = {91422FEF-2369-45E6-87AA-8B38709AD824} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netgen", "netgen\netgen.vcxproj", "{F241CA03-4AB1-4BB0-8151-7AF078E2BC06}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netgenerate", "netgenerate\netgenerate.vcxproj", "{F241CA03-4AB1-4BB0-8151-7AF078E2BC06}" ProjectSection(ProjectDependencies) = postProject {91422FEF-2369-45E6-87AA-8B38709AD824} = {91422FEF-2369-45E6-87AA-8B38709AD824} EndProjectSection @@ -120,18 +120,18 @@ Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|Win32.ActiveCfg = Debug|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|Win32.Build.0 = Debug|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|x64.ActiveCfg = Debug|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Debug|x64.Build.0 = Debug|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Fastbuild|x64.Build.0 = Fastbuild|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|Win32.ActiveCfg = Release|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|Win32.Build.0 = Release|Win32 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|x64.ActiveCfg = Release|x64 - {90205628-51D7-4194-9FC0-7D74C35A3471}.Release|x64.Build.0 = Release|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|Win32.Build.0 = Debug|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|x64.ActiveCfg = Debug|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Debug|x64.Build.0 = Debug|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|Win32.ActiveCfg = Fastbuild|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|Win32.Build.0 = Fastbuild|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|x64.ActiveCfg = Fastbuild|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Fastbuild|x64.Build.0 = Fastbuild|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|Win32.ActiveCfg = Release|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|Win32.Build.0 = Release|Win32 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|x64.ActiveCfg = Release|x64 + {8B23994C-79B7-4C1F-86F9-1EA2CBACE0F9}.Release|x64.Build.0 = Release|x64 {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|Win32.ActiveCfg = Debug|Win32 {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|Win32.Build.0 = Debug|Win32 {F1904C42-F231-4B9D-AD80-E2971969AFA0}.Debug|x64.ActiveCfg = Debug|x64 diff -Nru sumo-0.15.0~dfsg/build/msvc10/sumo/sumo.vcxproj sumo-0.16.0~dfsg/build/msvc10/sumo/sumo.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/sumo/sumo.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/sumo/sumo.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,28 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalFastbuild Win32 - - MesoRelease + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease x64 @@ -47,36 +55,6 @@ sumo - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - - - Application - @@ -86,18 +64,18 @@ - + - + - + - + @@ -116,18 +94,18 @@ - + - + - + - + @@ -140,159 +118,88 @@ + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - meso - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)F - mesoD - meso64 - meso64D - $(ProjectName)64F - $(ProjectName)64 + meso + mesoD + meso64 + meso64D + mesoF + meso64F - - 0x0407 - $(XERCES_DEBUG_LIB);$(PYTHON_LIB);ws2_32.lib - $(OutDir)sumoD.exe - %(AdditionalLibraryDirectories) - false - - 0x0407 - $(XERCES_DEBUG_LIB);$(PYTHON_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64D.exe - %(AdditionalLibraryDirectories) - false - - 0x0407 - $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib - $(OutDir)sumo.exe - %(AdditionalLibraryDirectories) - - 0x0407 - $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64.exe - %(AdditionalLibraryDirectories) - - - 0x0407 - + - $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\MesoRelease\y_libmesosim.lib - $(OutDir)meso.exe - %(AdditionalLibraryDirectories) + $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\InternalRelease\y_libmesosim.lib - - - 0x0407 - + - $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\MesoRelease\y_libmesosim.lib - $(OutDir)meso64.exe - %(AdditionalLibraryDirectories) + $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\InternalRelease\y_libmesosim.lib - - - 0x0407 - + - $(XERCES_DEBUG_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\MesoDebug\y_libmesosim.lib - $(OutDir)mesoD.exe - %(AdditionalLibraryDirectories) - false + $(XERCES_DEBUG_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\InternalDebug\y_libmesosim.lib - - - 0x0407 - + - $(XERCES_DEBUG_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\MesoDebug\y_libmesosim.lib - $(OutDir)meso64D.exe - %(AdditionalLibraryDirectories) - false + $(XERCES_DEBUG_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\InternalDebug\y_libmesosim.lib - - 0x0407 - $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib - $(OutDir)sumoF.exe - %(AdditionalLibraryDirectories) - - X64 - - - 0x0407 - $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib - $(PlatformName)\$(Configuration)\$(ProjectName)64F.exe - %(AdditionalLibraryDirectories) - MachineX64 + + + + + $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\InternalFastbuild\y_libmesosim.lib + + + + + $(XERCES_LIB);$(PYTHON_LIB);ws2_32.lib;$(MSBuildProjectDirectory)\..\y_libmesosim\x64\InternalFastbuild\y_libmesosim.lib diff -Nru sumo-0.15.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj sumo-0.16.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -9,6 +9,38 @@ Debug x64 + + Fastbuild + Win32 + + + Fastbuild + x64 + + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -25,170 +57,87 @@ Win32Proj - - Application - Unicode - true - - - Application - Unicode - - - Application - Unicode - true - - - Application - Unicode - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - $(Configuration)\ - $(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - $(ProjectName)D - $(ProjectName)64D - $(ProjectName)64 - - - Disabled - ..\..\..\src;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - ws2_32.lib;%(AdditionalDependencies) - $(OutDir)TraCITestClientD.exe - true - Console - MachineX86 - - - xcopy /Y $(TargetPath) ..\..\..\bin\ - - - - - X64 - - - Disabled - ..\..\..\src;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - $(OutDir)TraCITestClient64D.exe - true - Console - MachineX64 - - - xcopy /Y $(TargetPath) ..\..\..\bin\ - - - - - ..\..\..\src;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - $(OutDir)TraCITestClient.exe - true - Console - true - true - MachineX86 - - - xcopy /Y $(TargetPath) ..\..\..\bin\ - - - - - X64 - - - ..\..\..\src;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - $(OutDir)TraCITestClient64.exe - true - Console - true - true - MachineX64 - - - xcopy /Y $(TargetPath) ..\..\..\bin\ - - @@ -201,9 +150,11 @@ $(IntDir)%(Filename)1.obj $(IntDir)%(Filename)1.xdc + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/traci-testclient/Traci_TestClient.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -21,10 +21,16 @@ Quelldateien + + Quelldateien + Headerdateien + + Headerdateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/x64.props sumo-0.16.0~dfsg/build/msvc10/x64.props --- sumo-0.15.0~dfsg/build/msvc10/x64.props 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/x64.props 2012-12-04 00:26:11.000000000 +0000 @@ -22,6 +22,7 @@ $(XERCES_64)\include;$(PROJ_GDAL_64)\include;$(FOX16_64)\include;$(OSG_64)\include;..\..\..\src;%(AdditionalIncludeDirectories) HAVE_PROJ;HAVE_GDAL;%(PreprocessorDefinitions) + ProgramDatabase MachineX64 diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libgui/y_libgui.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libgui/y_libgui.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libgui/y_libgui.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libgui/y_libgui.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -49,10 +49,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -64,10 +64,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -84,16 +84,16 @@ - + - + - + - + @@ -109,16 +109,16 @@ - + - + - + - + @@ -144,18 +144,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -219,7 +219,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true @@ -233,7 +233,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true @@ -247,7 +247,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true @@ -261,7 +261,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libguinetload/y_libguinetload.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libguinetload/y_libguinetload.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libguinetload/y_libguinetload.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libguinetload/y_libguinetload.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -46,10 +46,10 @@ {B2AD8EB4-16B1-4BDC-9CF5-F7ADADBD316D} - + StaticLibrary - + StaticLibrary @@ -61,10 +61,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -79,16 +79,16 @@ - + - + - + - + @@ -104,16 +104,16 @@ - + - + - + - + @@ -132,14 +132,14 @@ <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(Configuration)\ + $(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Configuration)\ + $(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ AllRules.ruleset @@ -152,18 +152,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -228,7 +228,7 @@ 0x0407 - + true @@ -239,7 +239,7 @@ true - + X64 @@ -254,7 +254,7 @@ true - + true @@ -262,7 +262,7 @@ 0x0407 - + X64 diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -49,10 +49,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -64,10 +64,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -84,16 +84,16 @@ - + - + - + - + @@ -109,16 +109,16 @@ - + - + - + - + @@ -144,18 +144,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -201,7 +201,7 @@ 0x0407 - + true @@ -209,7 +209,7 @@ 0x0407 - + true @@ -217,7 +217,7 @@ 0x0407 - + true @@ -228,7 +228,7 @@ true - + true @@ -260,6 +260,8 @@ + + @@ -282,6 +284,8 @@ + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libguisim/y_libguisim.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -71,6 +71,12 @@ Quellcodedateien + + Quellcodedateien + + + Quellcodedateien + @@ -133,5 +139,11 @@ Header-Dateien + + Header-Dateien + + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,106 @@ + + + + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalFastbuild + Win32 + + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + + + + {09B71FCB-BE14-466C-A0DC-51F1E0D3CAE3} + + + + StaticLibrary + + + StaticLibrary + + + StaticLibrary + + + StaticLibrary + + + StaticLibrary + + + StaticLibrary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libinternal/y_libinternal.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,38 @@ + + + + + {cb7c2235-d4ab-4159-9901-22a28793f1a3} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {9135250c-f9c2-4102-8a8c-88177b41b92c} + h;hpp;hxx;hm;inl + + + + + Quellcodedateien + + + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -1,20 +1,28 @@  - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalFastbuild Win32 - - MesoRelease + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease x64 @@ -22,84 +30,72 @@ {3CD3D44A-7809-485C-B7A9-D5FDE0C31684} - + + StaticLibrary + + + StaticLibrary + + StaticLibrary - + StaticLibrary - + StaticLibrary - + StaticLibrary - + - + - + - + - + - + - + - + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - 0x0407 - - - - - 0x0407 - - - - - 0x0407 - - - - - 0x0407 - - + + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libmesogui/y_libmesogui.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -14,10 +14,16 @@ Quellcodedateien + + Quellcodedateien + Header-Dateien + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libmesosim/y_libmesosim.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libmesosim/y_libmesosim.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libmesosim/y_libmesosim.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libmesosim/y_libmesosim.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -1,20 +1,28 @@  - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalFastbuild Win32 - - MesoRelease + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease x64 @@ -22,79 +30,65 @@ {308BEB29-142B-4088-BD41-80E273E20D3A} - + + StaticLibrary + + + StaticLibrary + + StaticLibrary - + StaticLibrary - + StaticLibrary - + StaticLibrary - + - + - + - + - + - + - + - + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - 0x0407 - - - - - 0x0407 - - - - - 0x0407 - - - - - 0x0407 - - + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -49,10 +49,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -64,10 +64,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -84,16 +84,16 @@ - + - + - + - + @@ -109,16 +109,16 @@ - + - + - + - + @@ -144,18 +144,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -179,7 +179,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + 0x0407 @@ -187,7 +187,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + 0x0407 @@ -219,7 +219,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + 0x0407 @@ -227,7 +227,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + 0x0407 @@ -247,6 +247,8 @@ + + @@ -296,6 +298,8 @@ + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libmicrosim/y_libmicrosim.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -151,6 +151,12 @@ Quellcodedateien + + Quellcodedateien + + + Quellcodedateien + @@ -300,5 +306,11 @@ Header-Dateien + + Header-Dateien + + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -136,6 +136,7 @@ + @@ -154,6 +155,7 @@ + @@ -161,6 +163,7 @@ + @@ -183,6 +186,7 @@ + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetbuild/y_libnetbuild.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -80,6 +80,12 @@ Quellcodedateien + + Quellcodedateien + + + Quellcodedateien + @@ -163,5 +169,11 @@ Header-Dateien + + Header-Dateien + + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetimport/y_libnetimport.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libnetimport/y_libnetimport.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libnetimport/y_libnetimport.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetimport/y_libnetimport.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,22 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -36,18 +52,30 @@ StaticLibrary + + StaticLibrary + StaticLibrary + + StaticLibrary + StaticLibrary StaticLibrary + + StaticLibrary + StaticLibrary + + StaticLibrary + @@ -61,10 +89,21 @@ + + + + + + + + + + + @@ -75,19 +114,36 @@ + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset @@ -95,22 +151,38 @@ AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset + AllRules.ruleset + + 0x0407 + + + 0x0407 + + 0x0407 + + + 0x0407 + + 0x0407 @@ -121,11 +193,21 @@ 0x0407 + + + 0x0407 + + 0x0407 + + + 0x0407 + + X64 diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -49,10 +49,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -64,10 +64,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -84,16 +84,16 @@ - + - + - + - + @@ -109,16 +109,16 @@ - + - + - + - + @@ -144,18 +144,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -183,22 +183,22 @@ 0x0407 - + 0x0407 - + 0x0407 - + 0x0407 - + 0x0407 @@ -223,7 +223,6 @@ - @@ -233,7 +232,6 @@ - diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetload/y_libnetload.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -29,9 +29,6 @@ Quellcodedateien - - Quellcodedateien - Quellcodedateien @@ -55,9 +52,6 @@ Header-Dateien - - Header-Dateien - Header-Dateien diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -136,6 +136,7 @@ + @@ -143,6 +144,7 @@ + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_libnetwrite/y_libnetwrite.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -1,4 +1,4 @@ - + @@ -26,6 +26,9 @@ Quellcodedateien + + Quellcodedateien + @@ -43,5 +46,8 @@ Header-Dateien + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,6 +17,22 @@ Fastbuild x64 + + InternalDebug + Win32 + + + InternalDebug + x64 + + + InternalRelease + Win32 + + + InternalRelease + x64 + Release Win32 @@ -37,18 +53,30 @@ StaticLibrary + + StaticLibrary + StaticLibrary + + StaticLibrary + StaticLibrary StaticLibrary + + StaticLibrary + StaticLibrary + + StaticLibrary + @@ -62,10 +90,21 @@ + + + + + + + + + + + @@ -76,19 +115,36 @@ + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset @@ -96,11 +152,17 @@ AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset + AllRules.ruleset + + @@ -110,11 +172,24 @@ true + + + 0x0407 + + + true + + 0x0407 + + + 0x0407 + + 0x0407 @@ -128,11 +203,24 @@ true + + + 0x0407 + + + true + + 0x0407 + + + 0x0407 + + X64 @@ -155,9 +243,7 @@ - - - + @@ -179,9 +265,7 @@ - - - + diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_librouter/y_librouter.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -47,15 +47,6 @@ Quellcodedateien - - Quellcodedateien - - - Quellcodedateien - - - Quellcodedateien - Quellcodedateien @@ -68,6 +59,9 @@ Quellcodedateien + + Quellcodedateien + @@ -115,15 +109,6 @@ Header-Dateien - - Header-Dateien - - - Header-Dateien - - - Header-Dateien - Header-Dateien @@ -136,5 +121,8 @@ Header-Dateien + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/y_osgview/y_osgview.vcxproj sumo-0.16.0~dfsg/build/msvc10/y_osgview/y_osgview.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/y_osgview/y_osgview.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/y_osgview/y_osgview.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -1,20 +1,28 @@  - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalFastbuild Win32 - - MesoRelease + + InternalFastbuild + x64 + + + InternalRelease + Win32 + + + InternalRelease x64 @@ -22,96 +30,67 @@ {F5218B3F-4CE3-47F7-8A3D-41683281EAA0} - + StaticLibrary - + StaticLibrary - + StaticLibrary - + + StaticLibrary + + + StaticLibrary + + StaticLibrary - + - + - + - + - + - + - + - + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - true - - - 0x0407 - - - - - true - - - 0x0407 - - - - - true - - - 0x0407 - - - true - - - - - true - - - 0x0407 - - - true - + + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libgui_dialogs/z_libgui_dialogs.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libgui_dialogs/z_libgui_dialogs.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libgui_dialogs/z_libgui_dialogs.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libgui_dialogs/z_libgui_dialogs.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -49,10 +49,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -64,10 +64,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -84,16 +84,16 @@ - + - + - + - + @@ -109,16 +109,16 @@ - + - + - + - + @@ -148,18 +148,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -195,7 +195,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true @@ -209,7 +209,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true @@ -265,7 +265,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true @@ -279,7 +279,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + true diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -49,10 +49,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -64,10 +64,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -84,16 +84,16 @@ - + - + - + - + @@ -109,16 +109,16 @@ - + - + - + - + @@ -148,18 +148,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -187,22 +187,22 @@ 0x0407 - + 0x0407 - + 0x0407 - + 0x0407 - + 0x0407 @@ -234,6 +234,11 @@ + + + + + @@ -251,6 +256,11 @@ + + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_output/z_libmicrosim_output.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -50,6 +50,23 @@ Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + + Quellcodedateien + + @@ -97,5 +114,22 @@ Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + + Header-Dateien + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -50,10 +50,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -65,10 +65,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -85,16 +85,16 @@ - + - + - + - + @@ -110,16 +110,16 @@ - + - + - + - + @@ -149,18 +149,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -176,6 +176,7 @@ + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libmicrosim_trigger/z_libmicrosim_trigger.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -14,9 +14,6 @@ Quelldateien - - Quelldateien - Quelldateien @@ -29,14 +26,14 @@ Quelldateien + + Quelldateien + Headerdateien - - Headerdateien - Headerdateien diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -1,4 +1,4 @@ - + @@ -143,6 +143,7 @@ + @@ -169,6 +170,7 @@ + @@ -187,7 +189,6 @@ - diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_common/z_libutils_common.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -1,4 +1,4 @@ - + @@ -26,6 +26,9 @@ Quellcodedateien + + Quellcodedateien + Quellcodedateien @@ -97,6 +100,9 @@ Header-Dateien + + Header-Dateien + Header-Dateien @@ -148,9 +154,6 @@ Header-Dateien - - Header-Dateien - Header-Dateien diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -173,6 +173,7 @@ + @@ -189,6 +190,7 @@ + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_geom/z_libutils_geom.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -44,6 +44,9 @@ Quellcodedateien + + Quellcodedateien + @@ -88,5 +91,8 @@ Header-Dateien + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -120,6 +120,7 @@ + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_globjects/z_libutils_gui_globjects.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -52,5 +52,8 @@ Headerdateien + + Headerdateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_settings/z_libutils_gui_settings.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_settings/z_libutils_gui_settings.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_settings/z_libutils_gui_settings.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_settings/z_libutils_gui_settings.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -50,10 +50,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -65,10 +65,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -85,16 +85,16 @@ - + - + - + - + @@ -110,16 +110,16 @@ - + - + - + - + @@ -145,18 +145,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_windows/z_libutils_gui_windows.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_windows/z_libutils_gui_windows.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_gui_windows/z_libutils_gui_windows.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_gui_windows/z_libutils_gui_windows.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -47,10 +47,10 @@ z_libutils_gui_windows - + StaticLibrary - + StaticLibrary @@ -62,10 +62,10 @@ StaticLibrary - + StaticLibrary - + StaticLibrary @@ -80,16 +80,16 @@ - + - + - + - + @@ -105,16 +105,16 @@ - + - + - + - + @@ -137,14 +137,14 @@ $(Configuration)\ $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Configuration)\ - $(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(Configuration)\ + $(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Configuration)\ + $(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ AllRules.ruleset @@ -157,18 +157,18 @@ AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + AllRules.ruleset @@ -181,7 +181,7 @@ X64 - + X64 @@ -189,7 +189,7 @@ ProgramDatabase - + X64 diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_iodevices/z_libutils_iodevices.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_iodevices/z_libutils_iodevices.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_iodevices/z_libutils_iodevices.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_iodevices/z_libutils_iodevices.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -158,6 +158,9 @@ %(AdditionalLibraryDirectories) + + ..\..\..\tools\build\version.py + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -149,8 +149,10 @@ + + @@ -160,8 +162,10 @@ + + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_libutils_xml/z_libutils_xml.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -38,6 +38,12 @@ Quellcodedateien + + Quellcodedateien + + + Quellcodedateien + @@ -67,5 +73,11 @@ Header-Dateien + + Header-Dateien + + + Header-Dateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj sumo-0.16.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj --- sumo-0.15.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj 2012-12-04 00:26:11.000000000 +0000 @@ -17,20 +17,20 @@ Fastbuild x64 - - MesoDebug + + InternalDebug Win32 - - MesoDebug + + InternalDebug x64 - - MesoRelease + + InternalRelease Win32 - - MesoRelease + + InternalRelease x64 @@ -53,13 +53,13 @@ StaticLibrary - + StaticLibrary StaticLibrary - + StaticLibrary @@ -68,13 +68,13 @@ StaticLibrary - + StaticLibrary StaticLibrary - + StaticLibrary @@ -90,20 +90,20 @@ - + - + - + - + @@ -115,56 +115,56 @@ - + - + - + - + <_ProjectFileVersion>10.0.30319.1 $(Configuration)\ - $(Configuration)\ + $(Configuration)\ $(Configuration)\ - $(Configuration)\ + $(Configuration)\ $(Configuration)\ - $(Configuration)\ + $(Configuration)\ $(Configuration)\ - $(Configuration)\ + $(Configuration)\ $(Configuration)\ $(Configuration)\ $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ AllRules.ruleset - AllRules.ruleset + AllRules.ruleset - + - + AllRules.ruleset - AllRules.ruleset + AllRules.ruleset - + - + AllRules.ruleset @@ -172,17 +172,17 @@ AllRules.ruleset - AllRules.ruleset + AllRules.ruleset - + - + AllRules.ruleset - AllRules.ruleset + AllRules.ruleset - + - + @@ -195,7 +195,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + Disabled $(XERCES)\include;..\..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + $(XERCES)\include;..\..\..\src;%(AdditionalIncludeDirectories) MultiThreadedDLL @@ -255,7 +255,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + X64 @@ -281,7 +281,7 @@ IF EXIST .svn/entries ..\..\..\tools\build\version.py - + X64 @@ -322,7 +322,7 @@ - + diff -Nru sumo-0.15.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj.filters sumo-0.16.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj.filters --- sumo-0.15.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj.filters 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc10/z_optional_libtraciserver/z_optional_libtraciserver.vcxproj.filters 2012-12-04 00:26:11.000000000 +0000 @@ -59,9 +59,6 @@ Headerdateien - - Headerdateien - Headerdateien @@ -101,5 +98,8 @@ Headerdateien + + Headerdateien + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/build/msvc8/netgen/netgen.vcproj sumo-0.16.0~dfsg/build/msvc8/netgen/netgen.vcproj --- sumo-0.15.0~dfsg/build/msvc8/netgen/netgen.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc8/netgen/netgen.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -2,7 +2,7 @@ @@ -53,7 +53,7 @@ + + + + + + + + @@ -701,6 +709,14 @@ > + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc8/y_libmicrosim/y_libmicrosim.vcproj sumo-0.16.0~dfsg/build/msvc8/y_libmicrosim/y_libmicrosim.vcproj --- sumo-0.15.0~dfsg/build/msvc8/y_libmicrosim/y_libmicrosim.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc8/y_libmicrosim/y_libmicrosim.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -564,6 +564,10 @@ > + + @@ -584,6 +588,10 @@ > + + @@ -764,6 +772,10 @@ > + + @@ -783,10 +795,14 @@ RelativePath="..\..\..\src\microsim\cfmodels\MSCFModel_PWag2009.h" > - - + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc8/y_libnetbuild/y_libnetbuild.vcproj sumo-0.16.0~dfsg/build/msvc8/y_libnetbuild/y_libnetbuild.vcproj --- sumo-0.15.0~dfsg/build/msvc8/y_libnetbuild/y_libnetbuild.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc8/y_libnetbuild/y_libnetbuild.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -342,6 +342,10 @@ > + + @@ -439,6 +443,10 @@ > + + diff -Nru sumo-0.15.0~dfsg/build/msvc8/y_libnetload/y_libnetload.vcproj sumo-0.16.0~dfsg/build/msvc8/y_libnetload/y_libnetload.vcproj --- sumo-0.15.0~dfsg/build/msvc8/y_libnetload/y_libnetload.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc8/y_libnetload/y_libnetload.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -570,10 +570,6 @@ > - - @@ -607,10 +603,6 @@ > - - diff -Nru sumo-0.15.0~dfsg/build/msvc8/z_libutils_common/z_libutils_common.vcproj sumo-0.16.0~dfsg/build/msvc8/z_libutils_common/z_libutils_common.vcproj --- sumo-0.15.0~dfsg/build/msvc8/z_libutils_common/z_libutils_common.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc8/z_libutils_common/z_libutils_common.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -475,6 +475,10 @@ > + + @@ -572,6 +576,10 @@ > + + diff -Nru sumo-0.15.0~dfsg/build/msvc8/z_optional_libtraciserver/z_optional_libtraciserver.vcproj sumo-0.16.0~dfsg/build/msvc8/z_optional_libtraciserver/z_optional_libtraciserver.vcproj --- sumo-0.15.0~dfsg/build/msvc8/z_optional_libtraciserver/z_optional_libtraciserver.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc8/z_optional_libtraciserver/z_optional_libtraciserver.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -659,10 +659,6 @@ > - - diff -Nru sumo-0.15.0~dfsg/build/msvc9/netgen/netgen.vcproj sumo-0.16.0~dfsg/build/msvc9/netgen/netgen.vcproj --- sumo-0.15.0~dfsg/build/msvc9/netgen/netgen.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/netgen/netgen.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -2,7 +2,7 @@ @@ -117,7 +117,7 @@ @@ -179,7 +179,7 @@ @@ -241,7 +241,7 @@ @@ -305,7 +305,7 @@ @@ -370,7 +370,7 @@ + + + + + + + + @@ -706,6 +714,14 @@ > + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/y_libmicrosim/y_libmicrosim.vcproj sumo-0.16.0~dfsg/build/msvc9/y_libmicrosim/y_libmicrosim.vcproj --- sumo-0.15.0~dfsg/build/msvc9/y_libmicrosim/y_libmicrosim.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/y_libmicrosim/y_libmicrosim.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -555,6 +555,10 @@ > + + @@ -575,6 +579,10 @@ > + + @@ -755,6 +763,10 @@ > + + @@ -774,10 +786,14 @@ RelativePath="..\..\..\src\microsim\cfmodels\MSCFModel_PWag2009.h" > - - + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/y_libnetbuild/y_libnetbuild.vcproj sumo-0.16.0~dfsg/build/msvc9/y_libnetbuild/y_libnetbuild.vcproj --- sumo-0.15.0~dfsg/build/msvc9/y_libnetbuild/y_libnetbuild.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/y_libnetbuild/y_libnetbuild.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -70,9 +70,9 @@ /> + + @@ -415,6 +419,10 @@ > + + @@ -440,6 +448,10 @@ > + + @@ -532,6 +544,10 @@ > + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/y_libnetload/y_libnetload.vcproj sumo-0.16.0~dfsg/build/msvc9/y_libnetload/y_libnetload.vcproj --- sumo-0.15.0~dfsg/build/msvc9/y_libnetload/y_libnetload.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/y_libnetload/y_libnetload.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -571,10 +571,6 @@ > - - @@ -608,10 +604,6 @@ > - - diff -Nru sumo-0.15.0~dfsg/build/msvc9/y_libnetwrite/y_libnetwrite.vcproj sumo-0.16.0~dfsg/build/msvc9/y_libnetwrite/y_libnetwrite.vcproj --- sumo-0.15.0~dfsg/build/msvc9/y_libnetwrite/y_libnetwrite.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/y_libnetwrite/y_libnetwrite.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -70,9 +70,9 @@ /> + + @@ -368,6 +372,10 @@ > + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/y_librouter/y_librouter.vcproj sumo-0.16.0~dfsg/build/msvc9/y_librouter/y_librouter.vcproj --- sumo-0.15.0~dfsg/build/msvc9/y_librouter/y_librouter.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/y_librouter/y_librouter.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -72,9 +72,9 @@ /> - - - - - - @@ -431,7 +419,7 @@ > - - - - - - diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_libmicrosim_output/z_libmicrosim_output.vcproj sumo-0.16.0~dfsg/build/msvc9/z_libmicrosim_output/z_libmicrosim_output.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_libmicrosim_output/z_libmicrosim_output.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_libmicrosim_output/z_libmicrosim_output.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -70,9 +70,9 @@ /> + + + + + + @@ -591,10 +603,18 @@ > + + + + @@ -632,6 +652,18 @@ > + + + + + + @@ -656,10 +688,18 @@ > + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_libmicrosim_trigger/z_libmicrosim_trigger.vcproj sumo-0.16.0~dfsg/build/msvc9/z_libmicrosim_trigger/z_libmicrosim_trigger.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_libmicrosim_trigger/z_libmicrosim_trigger.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_libmicrosim_trigger/z_libmicrosim_trigger.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -70,9 +70,9 @@ /> + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_libutils_common/z_libutils_common.vcproj sumo-0.16.0~dfsg/build/msvc9/z_libutils_common/z_libutils_common.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_libutils_common/z_libutils_common.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_libutils_common/z_libutils_common.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -70,9 +70,9 @@ /> + + - - @@ -474,6 +474,10 @@ > + + @@ -523,6 +527,10 @@ > + + @@ -571,6 +579,10 @@ > + + @@ -591,6 +603,10 @@ > + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_libutils_iodevices/z_libutils_iodevices.vcproj sumo-0.16.0~dfsg/build/msvc9/z_libutils_iodevices/z_libutils_iodevices.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_libutils_iodevices/z_libutils_iodevices.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_libutils_iodevices/z_libutils_iodevices.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -72,9 +72,9 @@ /> + + - - @@ -461,6 +461,10 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > + + @@ -469,6 +473,10 @@ > + + @@ -484,12 +492,20 @@ RelativePath="..\..\..\src\utils\iodevices\OutputDevice_String.cpp" > + + + + @@ -498,6 +514,10 @@ > + + @@ -513,6 +533,14 @@ RelativePath="..\..\..\src\utils\iodevices\OutputDevice_String.h" > + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_libutils_shapes/z_libutils_shapes.vcproj sumo-0.16.0~dfsg/build/msvc9/z_libutils_shapes/z_libutils_shapes.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_libutils_shapes/z_libutils_shapes.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_libutils_shapes/z_libutils_shapes.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_libutils_xml/z_libutils_xml.vcproj sumo-0.16.0~dfsg/build/msvc9/z_libutils_xml/z_libutils_xml.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_libutils_xml/z_libutils_xml.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_libutils_xml/z_libutils_xml.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -70,9 +70,9 @@ /> + + + + @@ -365,6 +373,10 @@ > + + @@ -390,10 +402,18 @@ > + + + + @@ -402,6 +422,10 @@ > + + diff -Nru sumo-0.15.0~dfsg/build/msvc9/z_optional_libtraciserver/z_optional_libtraciserver.vcproj sumo-0.16.0~dfsg/build/msvc9/z_optional_libtraciserver/z_optional_libtraciserver.vcproj --- sumo-0.15.0~dfsg/build/msvc9/z_optional_libtraciserver/z_optional_libtraciserver.vcproj 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/msvc9/z_optional_libtraciserver/z_optional_libtraciserver.vcproj 2012-12-04 00:26:11.000000000 +0000 @@ -427,10 +427,6 @@ > - - diff -Nru sumo-0.15.0~dfsg/build/package/sumo.spec sumo-0.16.0~dfsg/build/package/sumo.spec --- sumo-0.15.0~dfsg/build/package/sumo.spec 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/build/package/sumo.spec 2012-12-04 00:26:11.000000000 +0000 @@ -1,32 +1,35 @@ # # spec file for package sumo # +# Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +# This file is part of SUMO. +# SUMO is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# # norootforbuild Name: sumo -Summary: Microscopic Traffic Simulation -Version: 0.15.0 +Summary: Simulation of Urban Mobility - A Microscopic Traffic Simulation +Version: svn Release: 1 Url: http://sumo.sourceforge.net/ Source0: %{name}-src-%{version}.tar.gz Source1: %{name}-doc-%{version}.zip -License: GPL v2.1 or later +License: GPL v3 or later Group: Productivity/Scientific/Other BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: gcc-c++ libproj-devel libgdal-devel fox16-devel unzip -%if 0%{?suse_version} > 1110 || 0%{?centos_version} || 0%{?rhel_version} -BuildRequires: libxerces-c-devel -%else -BuildRequires: libXerces-c-devel -%endif +BuildRequires: libxerces-c-devel %if 0%{?mandriva_version} BuildRequires: XFree86-devel postgresql-devel libmesaglu1-devel %else BuildRequires: xorg-x11-devel xorg-x11-Mesa-devel %endif -%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} +%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?scientificlinux_version} BuildRequires: libGLU-devel libXext-devel libXft-devel %if 0%{?fedora_version} >= 15 -BuildRequires: hdf5 javamail +BuildRequires: netcdf hdf5 javamail %endif %endif Autoreqprov: on @@ -39,6 +42,9 @@ %prep %setup -q unzip -o %{SOURCE1} -d .. +%if 0%{?sles_version} +find . -name "*.jar" | xargs rm +%endif %build %configure @@ -55,6 +61,6 @@ %defattr(-,root,root) %{_bindir}/* %{_prefix}/lib/sumo -%doc AUTHORS COPYING README ChangeLog docs/pydoc docs/userdoc docs/tutorial +%doc AUTHORS COPYING README ChangeLog docs/pydoc docs/userdoc docs/tutorial docs/examples %changelog diff -Nru sumo-0.15.0~dfsg/configure sumo-0.16.0~dfsg/configure --- sumo-0.15.0~dfsg/configure 2012-03-14 00:11:49.000000000 +0000 +++ sumo-0.16.0~dfsg/configure 2012-12-04 00:13:18.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for sumo 0.15.0. +# Generated by GNU Autoconf 2.68 for sumo 0.16.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -172,6 +172,14 @@ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes @@ -533,155 +541,8 @@ # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - test -n "$DJDIR" || exec 7<&0 &1 @@ -706,8 +567,8 @@ # Identity of this package. PACKAGE_NAME='sumo' PACKAGE_TARNAME='sumo' -PACKAGE_VERSION='0.15.0' -PACKAGE_STRING='sumo 0.15.0' +PACKAGE_VERSION='0.16.0' +PACKAGE_STRING='sumo 0.16.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -780,8 +641,8 @@ WITH_VERSION_H_TRUE TRACI_FALSE TRACI_TRUE -MESOSIM_FALSE -MESOSIM_TRUE +INTERNAL_FALSE +INTERNAL_TRUE XERCES_LIBS XERCES_CFLAGS PKG_CONFIG_LIBDIR @@ -795,8 +656,10 @@ LIPO NMEDIT DSYMUTIL -lt_ECHO +MANIFEST_TOOL +ac_ct_AR AR +DLLTOOL OBJDUMP NM ac_ct_DUMPBIN @@ -909,12 +772,14 @@ ac_user_opts=' enable_option_checking enable_debug +enable_profiling enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld +with_sysroot enable_libtool_lock enable_messages enable_memcheck @@ -1496,7 +1361,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sumo 0.15.0 to adapt to many kinds of systems. +\`configure' configures sumo 0.16.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1567,7 +1432,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sumo 0.15.0:";; + short | recursive ) echo "Configuration of sumo 0.16.0:";; esac cat <<\_ACEOF @@ -1576,6 +1441,8 @@ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug enable sumo debugging code [default=no]. + --enable-profiling enable compilation of gprof profiling code + [default=no]. --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1601,6 +1468,8 @@ --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). --with-xerces=DIR where Xerces-C is installed (libraries in DIR/lib, headers in DIR/include). --with-xerces-libraries=DIR @@ -1717,7 +1586,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sumo configure 0.15.0 +sumo configure 0.16.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2257,7 +2126,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sumo $as_me 0.15.0, which was +It was created by sumo $as_me 0.16.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3188,7 +3057,7 @@ # Define the identity of the package. PACKAGE='sumo' - VERSION='0.15.0' + VERSION='0.16.0' cat >>confdefs.h <<_ACEOF @@ -3322,11 +3191,24 @@ CXXFLAGS="-g -pthread $CXXFLAGS" ac_enabled="$ac_enabled Debug" + program_transform_name="s,\$\$,D,; $program_transform_name" else CXXFLAGS="-O2 -DNDEBUG $CXXFLAGS" ac_disabled="$ac_disabled Debug" fi +# Check whether --enable-profiling was given. +if test "${enable_profiling+set}" = set; then : + enableval=$enable_profiling; +fi + +if test x$enable_profiling = xyes; then + CXXFLAGS="-pg $CXXFLAGS" + ac_enabled="$ac_enabled Profiling" +else + ac_disabled="$ac_disabled Profiling" +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4972,8 +4854,8 @@ -macro_version='2.2.6b' -macro_revision='1.3018' +macro_version='2.4' +macro_revision='1.3293' @@ -4989,6 +4871,75 @@ ltmain="$ac_aux_dir/ltmain.sh" +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : @@ -5454,8 +5405,11 @@ NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 @@ -5499,7 +5453,7 @@ fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5554,6 +5508,15 @@ fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5573,13 +5536,13 @@ else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5576: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5579: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:5582: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5625,6 +5588,11 @@ lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -5689,8 +5657,8 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -5732,8 +5700,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -5782,6 +5750,80 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : @@ -5798,6 +5840,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5961,16 +6008,18 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -6000,6 +6049,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -6008,11 +6061,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -6034,7 +6087,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -6115,6 +6168,21 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6130,16 +6198,26 @@ + + + + + + + + + + if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6148,7 +6226,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6158,10 +6236,10 @@ fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6169,17 +6247,17 @@ fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6188,7 +6266,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" + ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6198,17 +6276,17 @@ fi fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_AR" = x; then - AR="false" + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6216,17 +6294,54 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - AR=$ac_ct_AR + DLLTOOL=$ac_ct_DLLTOOL fi else - AR="$ac_cv_prog_AR" + DLLTOOL="$ac_cv_prog_DLLTOOL" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -6236,15 +6351,17 @@ if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6253,7 +6370,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6263,28 +6380,32 @@ fi fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6293,7 +6414,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6303,11 +6424,176 @@ fi fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -6450,6 +6736,18 @@ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + @@ -6557,8 +6855,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6594,6 +6892,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6619,8 +6918,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -6635,6 +6934,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -6646,7 +6957,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -6672,8 +6983,8 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6683,8 +6994,8 @@ test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6721,6 +7032,20 @@ $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + @@ -6740,6 +7065,40 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + @@ -6774,7 +7133,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6777 "configure"' > conftest.$ac_ext + echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6936,19 +7295,16 @@ need_locks="$enable_libtool_lock" - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6957,7 +7313,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6967,10 +7323,10 @@ fi fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6978,17 +7334,17 @@ fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6997,7 +7353,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7007,17 +7363,17 @@ fi fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7025,22 +7381,50 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DSYMUTIL=$ac_ct_DSYMUTIL + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: fi + + + + + + case $host_os in + rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7049,7 +7433,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7059,10 +7443,10 @@ fi fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7070,16 +7454,108 @@ fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_NMEDIT"; then + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7486,6 +7962,38 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -7513,7 +8021,7 @@ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7606,589 +8114,75 @@ #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_c_try_run "$LINENO"; then : else - # Broken: fails on valid input. -continue + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break + fi -rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -_lt_caught_CXX_error=yes; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF -else - _lt_caught_CXX_error=yes fi +done + + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + @@ -8345,6 +8339,7 @@ + test -z "$LN_S" && LN_S="ln -s" @@ -8394,19 +8389,6 @@ - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -8419,23 +8401,6 @@ ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -8464,7 +8429,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -8669,7 +8634,12 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } @@ -8689,15 +8659,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8692: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8696: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -8726,8 +8696,6 @@ lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8775,6 +8743,12 @@ lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8817,6 +8791,13 @@ lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8858,7 +8839,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -8879,7 +8860,13 @@ lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8891,25 +8878,25 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_wl='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' + lt_prog_compiler_wl='-Wl,' ;; esac ;; @@ -8941,7 +8928,7 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -8998,13 +8985,17 @@ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -9028,15 +9019,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9031: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9035: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -9065,6 +9056,11 @@ + + + + + # # Check to make sure the static flag actually works. # @@ -9084,7 +9080,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -9133,16 +9129,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9136: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9140: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9188,16 +9184,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9191: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9195: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9310,7 +9306,33 @@ esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -9328,6 +9350,7 @@ fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -9343,11 +9366,12 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -9383,10 +9407,12 @@ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -9404,6 +9430,11 @@ fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -9419,7 +9450,7 @@ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -9429,15 +9460,16 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -9448,13 +9480,17 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -9470,17 +9506,17 @@ fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9494,8 +9530,8 @@ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9513,8 +9549,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9560,8 +9596,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9601,8 +9637,10 @@ else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -9689,7 +9727,13 @@ allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9702,25 +9746,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9729,7 +9780,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9742,30 +9799,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9797,20 +9866,63 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -9820,7 +9932,11 @@ hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -9828,7 +9944,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -9871,7 +9987,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -9879,7 +9995,7 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -9894,8 +10010,8 @@ ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -9913,16 +10029,16 @@ ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -9934,7 +10050,46 @@ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -9962,27 +10117,39 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10044,17 +10211,17 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10064,13 +10231,13 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -10083,9 +10250,9 @@ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -10273,44 +10440,50 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -10481,16 +10654,23 @@ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -10503,7 +10683,7 @@ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -10523,7 +10703,13 @@ if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -10611,7 +10797,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -10642,8 +10828,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10664,36 +10851,83 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -10780,6 +11014,19 @@ hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -10822,8 +11069,10 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) @@ -10881,7 +11130,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -10890,12 +11139,17 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10908,13 +11162,17 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -10923,7 +11181,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -11226,6 +11484,11 @@ + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= @@ -11556,7 +11819,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11559 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11597,7 +11860,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11606,7 +11875,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -11652,7 +11925,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11655 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11693,7 +11966,13 @@ # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11702,7 +11981,11 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -11859,6 +12142,145 @@ CC="$lt_save_CC" + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11885,6 +12307,8 @@ module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -11940,6 +12364,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -11957,6 +12382,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -11967,7 +12393,7 @@ *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then @@ -12096,8 +12522,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12129,7 +12555,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -12239,7 +12665,13 @@ allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12252,26 +12684,33 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -12280,7 +12719,13 @@ else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12293,30 +12738,42 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -12342,32 +12799,79 @@ # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; darwin* | rhapsody*) @@ -12375,7 +12879,11 @@ hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec_CXX='' + fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -12383,7 +12891,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -12436,6 +12944,11 @@ gnu*) ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -12460,11 +12973,11 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -12525,7 +13038,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -12535,10 +13048,10 @@ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -12568,7 +13081,7 @@ case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -12579,9 +13092,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -12592,7 +13105,7 @@ inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -12610,7 +13123,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12647,26 +13160,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5]* | *pgcpp\ [1-5]*) + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -12674,7 +13187,7 @@ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -12693,9 +13206,9 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12715,13 +13228,13 @@ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -12790,7 +13303,7 @@ export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi @@ -12825,15 +13338,15 @@ case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -12849,17 +13362,17 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -12869,7 +13382,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -12905,7 +13418,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -12926,7 +13439,7 @@ esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -12946,14 +13459,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -12964,7 +13477,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -13018,6 +13531,10 @@ CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -13079,6 +13596,13 @@ }; _LT_EOF + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +esac + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13092,7 +13616,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -13101,13 +13625,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -13127,8 +13660,10 @@ postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -13164,6 +13699,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -13199,7 +13735,7 @@ solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -13264,8 +13800,6 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -13315,6 +13849,11 @@ # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -13364,6 +13903,11 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; dgux*) case $cc_basename in ec++*) @@ -13420,7 +13964,7 @@ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -13453,8 +13997,8 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -13516,7 +14060,7 @@ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -13581,10 +14125,17 @@ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_prog_compiler_pic_CXX" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -13608,15 +14159,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13611: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13615: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -13642,6 +14193,8 @@ + + # # Check to make sure the static flag actually works. # @@ -13661,7 +14214,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -13707,16 +14260,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13710: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13714: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -13759,16 +14312,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13762: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13766: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -13819,27 +14372,35 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -13871,44 +14432,50 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 -$as_echo "$archive_cmds_need_lc_CXX" >&6; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi @@ -14065,7 +14632,7 @@ m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -14096,8 +14663,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -14118,36 +14686,82 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -14233,6 +14847,19 @@ hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -14275,8 +14902,10 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) @@ -14334,7 +14963,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -14343,12 +14972,17 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -14361,13 +14995,17 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -14376,7 +15014,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -14628,6 +15266,8 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= @@ -14675,6 +15315,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -14780,6 +15421,9 @@ ac_disabled="$ac_disabled DoublePrecision" fi +$as_echo "#define SUMOLong long long int" >>confdefs.h + + # Check whether --enable-subsecond was given. if test "${enable_subsecond+set}" = set; then : enableval=$enable_subsecond; @@ -14804,6 +15448,9 @@ $as_echo "#define GEO_OUTPUT_ACCURACY 6" >>confdefs.h +$as_echo "#define SUMOLong long long int" >>confdefs.h + + @@ -15000,12 +15647,12 @@ fi - if test -d $srcdir/src/mesosim; then - MESOSIM_TRUE= - MESOSIM_FALSE='#' + if test -d $srcdir/src/internal; then + INTERNAL_TRUE= + INTERNAL_FALSE='#' else - MESOSIM_TRUE='#' - MESOSIM_FALSE= + INTERNAL_TRUE='#' + INTERNAL_FALSE= fi @@ -15775,7 +16422,7 @@ $as_echo "#define HAVE_OSG 1" >>confdefs.h - OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB" + OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB -lOpenThreads" fi @@ -16774,7 +17421,7 @@ -ac_config_files="$ac_config_files src/Makefile src/activitygen/Makefile src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile src/foreign/eulerspiral/Makefile src/foreign/gl2ps/Makefile src/foreign/mersenne/Makefile src/foreign/nvwa/Makefile src/foreign/polyfonts/Makefile src/foreign/rtree/Makefile src/foreign/tcpip/Makefile src/gui/Makefile src/gui/dialogs/Makefile src/guinetload/Makefile src/guisim/Makefile src/microsim/Makefile src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile src/netimport/vissim/Makefile src/netimport/vissim/tempstructs/Makefile src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile src/od2trips/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/foxtools/Makefile src/utils/geom/Makefile src/utils/gui/Makefile src/utils/gui/div/Makefile src/utils/gui/events/Makefile src/utils/gui/globjects/Makefile src/utils/gui/images/Makefile src/utils/gui/settings/Makefile src/utils/gui/tracker/Makefile src/utils/gui/windows/Makefile src/utils/importio/Makefile src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile unittest/src/microsim/Makefile unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile Makefile" +ac_config_files="$ac_config_files src/Makefile src/activitygen/Makefile src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile src/foreign/eulerspiral/Makefile src/foreign/gl2ps/Makefile src/foreign/mersenne/Makefile src/foreign/nvwa/Makefile src/foreign/polyfonts/Makefile src/foreign/rtree/Makefile src/foreign/tcpip/Makefile src/gui/Makefile src/gui/dialogs/Makefile src/guinetload/Makefile src/guisim/Makefile src/microsim/Makefile src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile src/netimport/vissim/Makefile src/netimport/vissim/tempstructs/Makefile src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile src/od2trips/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/foxtools/Makefile src/utils/geom/Makefile src/utils/gui/Makefile src/utils/gui/div/Makefile src/utils/gui/events/Makefile src/utils/gui/globjects/Makefile src/utils/gui/images/Makefile src/utils/gui/settings/Makefile src/utils/gui/tracker/Makefile src/utils/gui/windows/Makefile src/utils/importio/Makefile src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile src/utils/traci/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile unittest/src/microsim/Makefile unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16905,16 +17552,12 @@ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${CHECK_MEMORY_LEAKS_TRUE}" && test -z "${CHECK_MEMORY_LEAKS_FALSE}"; then as_fn_error $? "conditional \"CHECK_MEMORY_LEAKS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${MESOSIM_TRUE}" && test -z "${MESOSIM_FALSE}"; then - as_fn_error $? "conditional \"MESOSIM\" was never defined. +if test -z "${INTERNAL_TRUE}" && test -z "${INTERNAL_FALSE}"; then + as_fn_error $? "conditional \"INTERNAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TRACI_TRUE}" && test -z "${TRACI_FALSE}"; then @@ -17354,7 +17997,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sumo $as_me 0.15.0, which was +This file was extended by sumo $as_me 0.16.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17420,7 +18063,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sumo config.status 0.15.0 +sumo config.status 0.16.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -17549,184 +18192,208 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' -predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' -postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in SHELL \ +ECHO \ +SED \ GREP \ EGREP \ FGREP \ @@ -17739,8 +18406,13 @@ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -17750,14 +18422,14 @@ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -17773,7 +18445,6 @@ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -17781,6 +18452,7 @@ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -17791,10 +18463,11 @@ postdeps \ compiler_lib_search_path \ LD_CXX \ +reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -17806,7 +18479,6 @@ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ -fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -17816,9 +18488,9 @@ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -17840,11 +18512,13 @@ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -17853,10 +18527,11 @@ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -17864,12 +18539,6 @@ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -17960,6 +18629,7 @@ "src/utils/iodevices/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/iodevices/Makefile" ;; "src/utils/options/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/options/Makefile" ;; "src/utils/shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/shapes/Makefile" ;; + "src/utils/traci/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/traci/Makefile" ;; "src/utils/xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/xml/Makefile" ;; "unittest/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/Makefile" ;; "unittest/src/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/Makefile" ;; @@ -18678,10 +19348,12 @@ # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -18729,6 +19401,12 @@ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + # The host system. host_alias=$host_alias host=$host @@ -18778,9 +19456,11 @@ # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -18788,13 +19468,30 @@ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -18803,6 +19500,9 @@ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -18821,14 +19521,14 @@ # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# The name of the directory that contains temporary libtool files. -objdir=$objdir +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO +# The name of the directory that contains temporary libtool files. +objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD @@ -18836,6 +19536,9 @@ # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -18892,6 +19595,9 @@ # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -18931,6 +19637,10 @@ # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -18943,12 +19653,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -19035,9 +19745,6 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -19053,6 +19760,9 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -19099,212 +19809,169 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -19316,6 +19983,10 @@ # The linker used to build libraries. LD=$lt_LD_CXX +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -19328,12 +19999,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -19420,9 +20091,6 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path_CXX - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -19438,6 +20106,9 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX diff -Nru sumo-0.15.0~dfsg/configure.ac sumo-0.16.0~dfsg/configure.ac --- sumo-0.15.0~dfsg/configure.ac 2012-03-14 00:02:36.000000000 +0000 +++ sumo-0.16.0~dfsg/configure.ac 2012-12-04 00:02:28.000000000 +0000 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(sumo, 0.15.0) +AC_INIT(sumo, 0.16.0) AC_CONFIG_SRCDIR(src/sumo_main.cpp) AC_CANONICAL_SYSTEM @@ -17,11 +17,20 @@ AC_DEFINE(_DEBUG, 1, [Define to 1 in order to enable sumo debugging code.]) CXXFLAGS="-g -pthread $CXXFLAGS" ac_enabled="$ac_enabled Debug" + program_transform_name="s,\$\$,D,; $program_transform_name" else CXXFLAGS="-O2 -DNDEBUG $CXXFLAGS" ac_disabled="$ac_disabled Debug" fi +AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling],[enable compilation of gprof profiling code [default=no].])]) +if test x$enable_profiling = xyes; then + CXXFLAGS="-pg $CXXFLAGS" + ac_enabled="$ac_enabled Profiling" +else + ac_disabled="$ac_disabled Profiling" +fi + dnl Checks for programs. AC_PROG_CC @@ -71,6 +80,7 @@ AC_DEFINE([SUMOReal], [float], [defines the precision of floats]) ac_disabled="$ac_disabled DoublePrecision" fi +AC_DEFINE([SUMOLong], [long long int], [defines a long]) AC_ARG_ENABLE([subsecond], [AS_HELP_STRING([--disable-subsecond],[Disable subsecond timesteps.])]) if test x$enable_subsecond != xno; then @@ -83,6 +93,7 @@ AC_DEFINE([POSITION_EPS], [0.1], [defines the epsilon to use on position comparison]) AC_DEFINE([OUTPUT_ACCURACY], [2], [defines the number of digits after the comma in output]) AC_DEFINE([GEO_OUTPUT_ACCURACY], [6], [defines the number of digits after the comma in geo-coordinates output]) +AC_DEFINE([SUMOLong], [long long int], [defines the type for very long integers]) dnl ... for xerces 3.0 PKG_CHECK_MODULES([XERCES], [xerces-c >= 3.0], @@ -90,19 +101,19 @@ [AC_DEFINE([XERCES3_SIZE_t],[unsigned int],[Define length for Xerces 2.])]) -AM_CONDITIONAL(MESOSIM, test -d $srcdir/src/mesosim) -m4_syscmd([test -d src/mesosim]) +AM_CONDITIONAL(INTERNAL, test -d $srcdir/src/internal) +m4_syscmd([test -d src/internal]) m4_if(m4_sysval,[0],[ - AC_DEFINE([HAVE_MESOSIM], [1], [Define to enable mesoscopic simulation code.]) + AC_DEFINE([HAVE_INTERNAL], [1], [Define to enable internal code.]) AC_CONFIG_FILES([src/mesogui/Makefile src/mesosim/Makefile src/netedit/Makefile src/osgview/Makefile src/marouter/Makefile src/internal/Makefile unittest/src/internal/Makefile]) - MESO_DIRS="mesosim marouter internal" - AC_SUBST([MESO_DIRS]) - MESOGUI_DIRS="mesogui netedit osgview" - AC_SUBST([MESOGUI_DIRS]) + INTERNAL_DIRS="mesosim marouter internal" + AC_SUBST([INTERNAL_DIRS]) + GUI_INTERNAL_DIRS="mesogui netedit osgview" + AC_SUBST([GUI_INTERNAL_DIRS]) UNITTEST_INTERNAL_DIRS=internal AC_SUBST([UNITTEST_INTERNAL_DIRS]) - ac_enabled="$ac_enabled Meso" - program_transform_name="s,sumo,meso,; $program_transform_name" + ac_enabled="$ac_enabled Internal" + program_transform_name="s,\$\$,Int,; s,sumoInt,meso,; s,sumo-guiInt,meso-gui,; s,marouterInt,marouter,; s,neteditInt,netedit,; $program_transform_name" ]) AC_ARG_ENABLE([traci],[AS_HELP_STRING([--disable-traci],[disable Traffic Control Interface (TraCI) Server [default=no].])]) @@ -392,7 +403,7 @@ if test x"$MESOGUI_DIRS" != x; then AC_CHECK_HEADER([osg/Config], [AC_DEFINE([HAVE_OSG], [1], [defined if osg is available]) - OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB" AC_SUBST(OSG_LIBS)]) + OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB -lOpenThreads" AC_SUBST(OSG_LIBS)]) fi AM_CPPFLAGS="-I$PWD/$srcdir/src $AM_CPPFLAGS" @@ -485,6 +496,7 @@ src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile +src/utils/traci/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile diff -Nru sumo-0.15.0~dfsg/debian/changelog sumo-0.16.0~dfsg/debian/changelog --- sumo-0.15.0~dfsg/debian/changelog 2012-04-28 07:13:53.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/changelog 2012-12-04 20:03:42.000000000 +0000 @@ -1,16 +1,29 @@ -sumo (0.15.0~dfsg-1~oneiricubuntu2) oneiric; urgency=low +sumo (0.16.0~dfsg-1~oneiric) oneiric; urgency=low - * Remove pydoc documentation. + * [771d69c] Imported Upstream version 0.16.0~dfsg + * [5da3835] Update/remove patches. + * [caa9ffa] Rename netgensumo to netgenerate (upstream decision). - -- Anton Gladky Sat, 28 Apr 2012 09:13:35 +0200 + -- Anton Gladky Tue, 04 Dec 2012 18:53:26 +0100 -sumo (0.15.0~dfsg-1~oneiricubuntu1) oneiric; urgency=low +sumo (0.15.0~dfsg-3) unstable; urgency=low - * Remove doxygen documentation + * [6ae8190] Use compat level 9. Apply hardening of buildflags. + * [daa56b5] Remove from compilation embedded copy of gl2ps, + use packaged version instead. + * [8c08de0] Add upstream file - -- Anton Gladky Sat, 28 Apr 2012 07:08:49 +0200 + -- Anton Gladky Wed, 18 Jul 2012 21:04:34 +0200 -sumo (0.15.0~dfsg-1~oneiric) oneiric; urgency=low +sumo (0.15.0~dfsg-2) unstable; urgency=low + + * [5813a09] Update fix_headers_of_scripts.patch. + * [956cf12] Replace /usr/bin/netgen binary on /usr/bin/netgensumo. + (Closes: #673931) + + -- Anton Gladky Sun, 27 May 2012 16:28:54 +0200 + +sumo (0.15.0~dfsg-1) unstable; urgency=low * Initial packaging in Debian. (Closes: #669160) diff -Nru sumo-0.15.0~dfsg/debian/patches/drop_eulerspiral.patch sumo-0.16.0~dfsg/debian/patches/drop_eulerspiral.patch --- sumo-0.15.0~dfsg/debian/patches/drop_eulerspiral.patch 2012-04-20 21:57:37.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/patches/drop_eulerspiral.patch 2012-12-04 17:57:27.000000000 +0000 @@ -1,10 +1,10 @@ Description: Remove eulerspiral source code due to license issues. Author: Anton Gladky -Last-Update: 2012-04-20 +Last-Update: 2012-12-04 --- a/src/netimport/NIImporter_OpenDrive.cpp +++ b/src/netimport/NIImporter_OpenDrive.cpp -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ #include #include #include @@ -12,7 +12,7 @@ #include #include #include -@@ -672,9 +671,6 @@ +@@ -705,9 +704,6 @@ case OPENDRIVE_GT_LINE: geom = geomFromLine(e, g); break; @@ -22,7 +22,7 @@ case OPENDRIVE_GT_ARC: geom = geomFromArc(e, g); break; -@@ -705,23 +701,6 @@ +@@ -738,23 +734,6 @@ return ret; } @@ -46,28 +46,18 @@ std::vector NIImporter_OpenDrive::geomFromArc(const OpenDriveEdge& e, const OpenDriveGeometry& g) { ---- a/src/netimport/NIImporter_OpenDrive.h -+++ b/src/netimport/NIImporter_OpenDrive.h -@@ -386,7 +386,6 @@ - - - static std::vector geomFromLine(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; -- static std::vector geomFromSpiral(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static std::vector geomFromArc(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static std::vector geomFromPoly(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static Position calculateStraightEndPoint(double hdg, double length, const Position& start) ; --- a/configure +++ b/configure -@@ -16774,7 +16774,7 @@ +@@ -17421,7 +17421,7 @@ --ac_config_files="$ac_config_files src/Makefile src/activitygen/Makefile src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile src/foreign/eulerspiral/Makefile src/foreign/gl2ps/Makefile src/foreign/mersenne/Makefile src/foreign/nvwa/Makefile src/foreign/polyfonts/Makefile src/foreign/rtree/Makefile src/foreign/tcpip/Makefile src/gui/Makefile src/gui/dialogs/Makefile src/guinetload/Makefile src/guisim/Makefile src/microsim/Makefile src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile src/netimport/vissim/Makefile src/netimport/vissim/tempstructs/Makefile src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile src/od2trips/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/foxtools/Makefile src/utils/geom/Makefile src/utils/gui/Makefile src/utils/gui/div/Makefile src/utils/gui/events/Makefile src/utils/gui/globjects/Makefile src/utils/gui/images/Makefile src/utils/gui/settings/Makefile src/utils/gui/tracker/Makefile src/utils/gui/windows/Makefile src/utils/importio/Makefile src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile unittest/src/microsim/Makefile unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile Makefile" -+ac_config_files="$ac_config_files src/Makefile src/activitygen/Makefile src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile src/foreign/gl2ps/Makefile src/foreign/mersenne/Makefile src/foreign/nvwa/Makefile src/foreign/polyfonts/Makefile src/foreign/rtree/Makefile src/foreign/tcpip/Makefile src/gui/Makefile src/gui/dialogs/Makefile src/guinetload/Makefile src/guisim/Makefile src/microsim/Makefile src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile src/netimport/vissim/Makefile src/netimport/vissim/tempstructs/Makefile src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile src/od2trips/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/foxtools/Makefile src/utils/geom/Makefile src/utils/gui/Makefile src/utils/gui/div/Makefile src/utils/gui/events/Makefile src/utils/gui/globjects/Makefile src/utils/gui/images/Makefile src/utils/gui/settings/Makefile src/utils/gui/tracker/Makefile src/utils/gui/windows/Makefile src/utils/importio/Makefile src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile unittest/src/microsim/Makefile unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile Makefile" +-ac_config_files="$ac_config_files src/Makefile src/activitygen/Makefile src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile src/foreign/eulerspiral/Makefile src/foreign/gl2ps/Makefile src/foreign/mersenne/Makefile src/foreign/nvwa/Makefile src/foreign/polyfonts/Makefile src/foreign/rtree/Makefile src/foreign/tcpip/Makefile src/gui/Makefile src/gui/dialogs/Makefile src/guinetload/Makefile src/guisim/Makefile src/microsim/Makefile src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile src/netimport/vissim/Makefile src/netimport/vissim/tempstructs/Makefile src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile src/od2trips/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/foxtools/Makefile src/utils/geom/Makefile src/utils/gui/Makefile src/utils/gui/div/Makefile src/utils/gui/events/Makefile src/utils/gui/globjects/Makefile src/utils/gui/images/Makefile src/utils/gui/settings/Makefile src/utils/gui/tracker/Makefile src/utils/gui/windows/Makefile src/utils/importio/Makefile src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile src/utils/traci/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile unittest/src/microsim/Makefile unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile Makefile" ++ac_config_files="$ac_config_files src/Makefile src/activitygen/Makefile src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile src/foreign/gl2ps/Makefile src/foreign/mersenne/Makefile src/foreign/nvwa/Makefile src/foreign/polyfonts/Makefile src/foreign/rtree/Makefile src/foreign/tcpip/Makefile src/gui/Makefile src/gui/dialogs/Makefile src/guinetload/Makefile src/guisim/Makefile src/microsim/Makefile src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile src/netimport/vissim/Makefile src/netimport/vissim/tempstructs/Makefile src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile src/od2trips/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/foxtools/Makefile src/utils/geom/Makefile src/utils/gui/Makefile src/utils/gui/div/Makefile src/utils/gui/events/Makefile src/utils/gui/globjects/Makefile src/utils/gui/images/Makefile src/utils/gui/settings/Makefile src/utils/gui/tracker/Makefile src/utils/gui/windows/Makefile src/utils/importio/Makefile src/utils/iodevices/Makefile src/utils/options/Makefile src/utils/shapes/Makefile src/utils/traci/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile unittest/src/microsim/Makefile unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure -@@ -17908,7 +17908,6 @@ +@@ -18577,7 +18577,6 @@ "src/activitygen/activities/Makefile") CONFIG_FILES="$CONFIG_FILES src/activitygen/activities/Makefile" ;; "src/activitygen/city/Makefile") CONFIG_FILES="$CONFIG_FILES src/activitygen/city/Makefile" ;; "src/foreign/Makefile") CONFIG_FILES="$CONFIG_FILES src/foreign/Makefile" ;; @@ -77,7 +67,7 @@ "src/foreign/nvwa/Makefile") CONFIG_FILES="$CONFIG_FILES src/foreign/nvwa/Makefile" ;; --- a/configure.ac +++ b/configure.ac -@@ -433,7 +433,6 @@ +@@ -444,7 +444,6 @@ src/activitygen/activities/Makefile src/activitygen/city/Makefile src/foreign/Makefile @@ -87,7 +77,7 @@ src/foreign/nvwa/Makefile --- a/src/Makefile.in +++ b/src/Makefile.in -@@ -64,7 +64,7 @@ +@@ -63,7 +63,7 @@ ./netimport/vissim/tempstructs/libvissimtmpstr.a \ ./netbuild/libnetbuild.a ./netwrite/libnetwrite.a \ ./utils/distribution/libdistribution.a ./utils/geom/libgeom.a \ @@ -96,7 +86,7 @@ $(INTERNAL_LIBS) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) netconvert_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ -@@ -366,7 +366,6 @@ +@@ -367,7 +367,6 @@ ./netwrite/libnetwrite.a \ ./utils/distribution/libdistribution.a \ ./utils/geom/libgeom.a \ @@ -115,7 +105,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ -@@ -229,7 +229,7 @@ +@@ -231,7 +231,7 @@ @CHECK_MEMORY_LEAKS_TRUE@MEMDIRS = nvwa @WITH_GUI_TRUE@GUIDIRS = gl2ps polyfonts rtree EXTRA_DIST = additional.txt @@ -134,3 +124,13 @@ $(COMMON_LIBS) \ $(INTERNAL_LIBS) \ $(GDAL_LIBS) \ +--- a/src/netimport/NIImporter_OpenDrive.h ++++ b/src/netimport/NIImporter_OpenDrive.h +@@ -360,7 +360,6 @@ + + + static std::vector geomFromLine(const OpenDriveEdge& e, const OpenDriveGeometry& g); +- static std::vector geomFromSpiral(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static std::vector geomFromArc(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static std::vector geomFromPoly(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static Position calculateStraightEndPoint(double hdg, double length, const Position& start); diff -Nru sumo-0.15.0~dfsg/debian/patches/fix_format_not_a_string.patch sumo-0.16.0~dfsg/debian/patches/fix_format_not_a_string.patch --- sumo-0.15.0~dfsg/debian/patches/fix_format_not_a_string.patch 2012-04-20 21:57:37.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/patches/fix_format_not_a_string.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -Description: Fix format-not-a-string error -Author: Anton Gladky -Last-Update: 2012-04-18 - ---- a/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp -+++ b/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp -@@ -162,7 +162,7 @@ - std::string file = opendialog.getFilename().text(); - std::string msg = gSelected.load(file); - if (msg != "") { -- FXMessageBox::error(this, MBOX_OK, "Errors while loading Selection", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Errors while loading Selection", "%s", msg.c_str()); - } - rebuildList(); - } -@@ -179,7 +179,7 @@ - try { - gSelected.save(file.text()); - } catch (IOError& e) { -- FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); -+ FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); - } - return 1; - } ---- a/src/utils/gui/tracker/GUIParameterTracker.cpp -+++ b/src/utils/gui/tracker/GUIParameterTracker.cpp -@@ -239,7 +239,7 @@ - } - dev.close(); - } catch (IOError& e) { -- FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); -+ FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); - } - return 1; - } ---- a/src/utils/gui/windows/GUIDialog_EditViewport.cpp -+++ b/src/utils/gui/windows/GUIDialog_EditViewport.cpp -@@ -182,7 +182,7 @@ - dev << "\n"; - dev.close(); - } catch (IOError& e) { -- FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); -+ FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); - } - return 1; - } ---- a/src/utils/gui/windows/GUIDialog_ViewSettings.cpp -+++ b/src/utils/gui/windows/GUIDialog_ViewSettings.cpp -@@ -769,7 +769,7 @@ - dev << "\n"; - dev.close(); - } catch (IOError& e) { -- FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", e.what()); -+ FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what()); - } - } - -@@ -889,7 +889,7 @@ - mySettings->save(dev); - dev.close(); - } catch (IOError& e) { -- FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); -+ FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); - } - return 1; - } -@@ -1200,7 +1200,7 @@ - d.centerX = TplConvert::_2SUMOReal(value.c_str()); - } catch (NumberFormatException&) { - std::string msg = "The value must be a float, is:" + value; -- FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); - } - break; - case 2: -@@ -1208,7 +1208,7 @@ - d.centerY = TplConvert::_2SUMOReal(value.c_str()); - } catch (NumberFormatException&) { - std::string msg = "The value must be a float, is:" + value; -- FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); - } - break; - case 3: -@@ -1216,7 +1216,7 @@ - d.width = TplConvert::_2SUMOReal(value.c_str()); - } catch (NumberFormatException&) { - std::string msg = "The value must be a float, is:" + value; -- FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); - } - break; - case 4: -@@ -1224,7 +1224,7 @@ - d.height = TplConvert::_2SUMOReal(value.c_str()); - } catch (NumberFormatException&) { - std::string msg = "The value must be a float, is:" + value; -- FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); - } - break; - case 5: -@@ -1232,7 +1232,7 @@ - d.rot = TplConvert::_2SUMOReal(value.c_str()); - } catch (NumberFormatException&) { - std::string msg = "The value must be a float, is:" + value; -- FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); - } - break; - default: ---- a/src/gui/dialogs/GUIDialog_Breakpoints.cpp -+++ b/src/gui/dialogs/GUIDialog_Breakpoints.cpp -@@ -193,7 +193,7 @@ - dev << content; - dev.close(); - } catch (IOError& e) { -- FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); -+ FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); - } - return 1; - } -@@ -248,7 +248,7 @@ - GUIGlobals::gBreakpoints[row] = string2time(value); - } catch (NumberFormatException&) { - std::string msg = "The value must be an int, is:" + value; -- FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); - } - break; - default: ---- a/src/gui/GUIApplicationWindow.cpp -+++ b/src/gui/GUIApplicationWindow.cpp -@@ -967,7 +967,7 @@ - // build the text - const std::string text = "Simulation ended at time: " + time2string(ec->getTimeStep()) + - ".\nReason: " + MSNet::getStateMessage(ec->getReason()); -- FXMessageBox::warning(this, MBOX_OK, "Simulation ended", text.c_str()); -+ FXMessageBox::warning(this, MBOX_OK, "Simulation ended", "%s", text.c_str()); - } - } - ---- a/src/gui/GUISUMOViewParent.cpp -+++ b/src/gui/GUISUMOViewParent.cpp -@@ -150,7 +150,7 @@ - std::string file = opendialog.getFilename().text(); - std::string error = myView->makeSnapshot(file); - if (error != "") { -- FXMessageBox::error(this, MBOX_OK, "Saving failed.", error.c_str()); -+ FXMessageBox::error(this, MBOX_OK, "Saving failed.", "%s", error.c_str()); - } - return 1; - } diff -Nru sumo-0.15.0~dfsg/debian/patches/fix_headers_of_scripts.patch sumo-0.16.0~dfsg/debian/patches/fix_headers_of_scripts.patch --- sumo-0.15.0~dfsg/debian/patches/fix_headers_of_scripts.patch 2012-04-24 17:27:09.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/patches/fix_headers_of_scripts.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,468 +0,0 @@ -Description: fix headers of executables scripts -Author: Anton Gladky -Bug-Debian: http://bugs.debian.org/669160 -Last-Update: 2012-04-24 - ---- a/tools/shapes/CSV2polyconvertXML.py -+++ b/tools/shapes/CSV2polyconvertXML.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - """ - @file CSV2polyconvertXML.py - @author Daniel Krajzewicz -@@ -38,4 +39,4 @@ - inpf.close() - outf.close() - -- -\ No newline at end of file -+ ---- a/tools/projects/TLS-Evaluationsszenarien/plotter.py -+++ b/tools/projects/TLS-Evaluationsszenarien/plotter.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - from pylab import * - from ConfigParser import * - -@@ -305,4 +306,4 @@ - plot(q[0:15], avgDelayWECut[0:15],q[0:15], avgDelayNSCut[0:15], q[0:15], avgDelayCut[0:15],q[0:15], greenWECut[0:15], q[0:15], greenNSCut[0:15]) - legend(('avgDelayWE', 'avgDelayNS', 'avgDelay','greenWE', 'greenNS'),loc='upper left') - savefig(name + "CUT.png") -- close() -\ No newline at end of file -+ close() ---- a/tools/projects/TLS-Evaluationsszenarien/changeNet.py -+++ b/tools/projects/TLS-Evaluationsszenarien/changeNet.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - import xml.dom.minidom as dom - - def changePhaseDurations(file, greenWE, yellowWE, greenNS, yellowNS): -@@ -53,4 +54,4 @@ - det.setAttribute('freq',str(N)) - - writer = open(file, 'w') -- tree.writexml(writer) -\ No newline at end of file -+ tree.writexml(writer) ---- a/tools/projects/TLS-Evaluationsszenarien/main.py -+++ b/tools/projects/TLS-Evaluationsszenarien/main.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - import subprocess, sys, os, re, shutil - from genRoutes import * - from evaluator import * ---- a/tools/projects/TLS-Evaluationsszenarien/test.py -+++ b/tools/projects/TLS-Evaluationsszenarien/test.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - from evaluator import * - from plotter import * - -@@ -67,4 +68,4 @@ - xlabel("Flow") - ylabel("Average Delay NS") - legend(("FC", "VA"),loc='upper left') --show() -\ No newline at end of file -+show() ---- a/tools/projects/TLS-Evaluationsszenarien/evaluator.py -+++ b/tools/projects/TLS-Evaluationsszenarien/evaluator.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - import xml.dom.minidom as dom - from genRoutes import * - import subprocess, sys -@@ -173,4 +174,4 @@ - det = Sxx * N - Sx * Sx - a, b = (Sxy * N - Sy * Sx)/det, (Sxx * Sy - Sx * Sxy)/det - return a, b -- -\ No newline at end of file -+ ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityCurve.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityCurve.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file VelocityCurve.py -@@ -155,4 +156,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverRoute.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverRoute.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file VelocityOverRoute.py -@@ -147,4 +148,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/TraveltimeMulti.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/TraveltimeMulti.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file Traveltime.py -@@ -303,4 +304,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime_DK.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime_DK.py -@@ -1,4 +1,4 @@ -- -+#!/usr/bin/python - - from pylab import * - -@@ -306,4 +306,4 @@ - - #start the program - #cProfile.run('main()') --main() -\ No newline at end of file -+main() ---- /dev/null -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/__init__.py -@@ -0,0 +1 @@ -+#!/usr/bin/python ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/FetchData.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/FetchData.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file FetchData.py -@@ -192,4 +193,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverTime.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverTime.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file VelocityOverTime.py -@@ -180,4 +181,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file Traveltime.py -@@ -240,4 +241,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file CalcTime.py ---- a/tools/projects/TaxiFCD_Krieg/src/analysis/CompareVelocitys.py -+++ b/tools/projects/TaxiFCD_Krieg/src/analysis/CompareVelocitys.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file CompareVelocitys.py -@@ -118,4 +119,4 @@ - outputFile.close() - - #start the program --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/rawFCD/GenerateRawFCD.py -+++ b/tools/projects/TaxiFCD_Krieg/src/rawFCD/GenerateRawFCD.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateRawFCD.py -@@ -68,4 +69,4 @@ - - - -- -\ No newline at end of file -+ ---- a/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlot.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlot.py -@@ -1,4 +1,4 @@ -- -+#!/usr/bin/python - from pylab import * - from os import walk - from os.path import join ---- /dev/null -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdQuality/__init__.py -@@ -0,0 +1 @@ -+#!/usr/bin/python ---- a/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffects.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffects.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateRawFCD.py -@@ -224,4 +225,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlotOLD.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlotOLD.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - import sys - from pylab import * - ---- a/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsProcessedFCD.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsProcessedFCD.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateRawFCD.py -@@ -361,4 +362,4 @@ - - #start the program - #cProfile.run('main()') --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutesMain.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutesMain.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateTaxiRoutesMain.py -@@ -22,4 +23,4 @@ - print "end" - - #start the program --main() -\ No newline at end of file -+main() ---- /dev/null -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/__init__.py -@@ -0,0 +1 @@ -+#!/usr/bin/python ---- a/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/differentDepartRoutes.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/differentDepartRoutes.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateTaxiRoutesMain.py -@@ -63,4 +64,4 @@ - - - #start the program --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateTaxiRoutes.py ---- a/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/FCDvsCompleteRoute.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/FCDvsCompleteRoute.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file FCDvsCompleteRoute.py -@@ -146,4 +147,4 @@ - - - #start the program --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/util/Path.py -+++ b/tools/projects/TaxiFCD_Krieg/src/util/Path.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file Path.py -@@ -70,4 +71,4 @@ - - - -- -\ No newline at end of file -+ ---- /dev/null -+++ b/tools/projects/TaxiFCD_Krieg/src/util/__init__.py -@@ -0,0 +1 @@ -+#!/usr/bin/python ---- a/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py -+++ b/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - - def isElmInList(list,elm): ---- a/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py -+++ b/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file ProgressBar.py -@@ -31,4 +32,4 @@ - print "**", - lastProz=actProz - #call the function -- fct(list[i]) -\ No newline at end of file -+ fct(list[i]) ---- a/tools/projects/TaxiFCD_Krieg/src/util/Reader.py -+++ b/tools/projects/TaxiFCD_Krieg/src/util/Reader.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file Reader.py ---- a/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py -+++ b/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file CalcTime.py -@@ -51,4 +52,4 @@ - return label[:4]+"-"+label[4:6]+"-"+label[6:8]+" "+label[8:10]+":"+label[10:12]+":"+label[12:] - - #start the program --#main() -\ No newline at end of file -+#main() ---- a/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/SeparateVLSArea.py -+++ b/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/SeparateVLSArea.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file SeparateVLSArea.py -@@ -39,4 +40,4 @@ - - - #start the program --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py -+++ b/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file QuantityOverDay.py -@@ -78,4 +79,4 @@ - - - #start the program --main() -\ No newline at end of file -+main() ---- a/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py -+++ b/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file TaxisPerEdge.py -@@ -55,4 +56,4 @@ - - - #start the program --main() -\ No newline at end of file -+main() ---- /dev/null -+++ b/tools/projects/TaxiFCD_Krieg/src/backup/__init__.py -@@ -0,0 +1 @@ -+#!/usr/bin/python ---- a/tools/projects/orinoko/buildConnections.pl -+++ b/tools/projects/orinoko/buildConnections.pl -@@ -1,3 +1,4 @@ -+#!/usr/bin/perl - sub getAttr($$) { - my $text = $_[0]; - my $attrname = $_[1]; ---- a/tools/district/edgesInDistricts.py -+++ b/tools/district/edgesInDistricts.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - from xml.sax import saxutils, make_parser, handler - from optparse import OptionParser - import math ---- a/tools/district/countConnectionsInDistricts.py -+++ b/tools/district/countConnectionsInDistricts.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - from xml.sax import saxutils, make_parser, handler - from optparse import OptionParser - import math ---- a/tools/district/districtMapper.py -+++ b/tools/district/districtMapper.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - from xml.sax import saxutils, make_parser, handler - from optparse import OptionParser - import math ---- a/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsOLD.py -+++ b/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsOLD.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/python - # -*- coding: Latin-1 -*- - """ - @file GenerateRawFCD.py -@@ -185,4 +186,4 @@ - - #start the program - #profile.run('main()') --main() -\ No newline at end of file -+main() diff -Nru sumo-0.15.0~dfsg/debian/patches/fix_manpage_output.patch sumo-0.16.0~dfsg/debian/patches/fix_manpage_output.patch --- sumo-0.15.0~dfsg/debian/patches/fix_manpage_output.patch 2012-04-23 17:15:23.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/patches/fix_manpage_output.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Description: fixes manpage NAME field -Author: Anton Gladk -Last-Update: 2012-04-23 - ---- a/Makefile.in -+++ b/Makefile.in -@@ -743,7 +743,16 @@ - man: - rm -rf docs/man - mkdir docs/man -- for exe in sumo dfrouter duarouter jtrrouter activitygen od2trips netconvert netgen polyconvert; do help2man -N bin/$$exe > docs/man/$$exe.1; done -+ help2man -N -n "A microscopic road traffic simulation SUMO" bin/sumo > docs/man/sumo.1 -+ help2man -N -n "Builds vehicle routes for SUMO using detector values" bin/dfrouter > docs/man/dfrouter.1 -+ help2man -N -n "Shortest path router and DUE computer for the microscopic road traffic simulation SUMO" bin/duarouter > docs/man/duarouter.1 -+ help2man -N -n "Router for the microscopic road traffic simulation SUMO based on junction turning ratios" bin/jtrrouter > docs/man/jtrrouter.1 -+ help2man -N -n "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO" bin/activitygen > docs/man/activitygen.1 -+ help2man -N -n "Importer of O/D-matrices for the road traffic simulation SUMO" bin/od2trips > docs/man/od2trips.1 -+ help2man -N -n "Road network importer / builder for the road traffic simulation SUMO" bin/netconvert > docs/man/netconvert.1 -+ help2man -N -n "Road network generator for the microscopic road traffic simulation SUMO" bin/netgen > docs/man/netgen.1 -+ help2man -N -n "Importer of polygons and POIs for the road traffic simulation SUMO" bin/polyconvert > docs/man/polyconvert.1 -+ help2man -N -n "TraciTestClient for the road traffic simulation SUMO" bin/TraCITestClient > docs/man/TraCITestClient.1 - - dist-hook: - abs_distdir="`pwd`/$(distdir)" \ diff -Nru sumo-0.15.0~dfsg/debian/patches/fix_scripts_headers.patch sumo-0.16.0~dfsg/debian/patches/fix_scripts_headers.patch --- sumo-0.15.0~dfsg/debian/patches/fix_scripts_headers.patch 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/patches/fix_scripts_headers.patch 2012-12-04 17:57:27.000000000 +0000 @@ -0,0 +1,1146 @@ +Description: fixes headers of scripts +Author: Anton Gladky +Last-Update: 2012-12-04 + +--- sumo-0.16.0~dfsg.orig/tools/projects/TLS-Evaluationsszenarien/test.py ++++ sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/test.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + from evaluator import * + from plotter import * + +@@ -67,4 +68,4 @@ ylim(0,60) + xlabel("Flow") + ylabel("Average Delay NS") + legend(("FC", "VA"),loc='upper left') +-show() +\ No newline at end of file ++show() +--- sumo-0.16.0~dfsg.orig/tools/projects/TLS-Evaluationsszenarien/main.py ++++ sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/main.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + import subprocess, sys, os, re, shutil + from genRoutes import * + from evaluator import * +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverTime.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverTime.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file VelocityOverTime.py +@@ -180,4 +181,4 @@ def plotIt(taxiId): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file CalcTime.py +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/TraveltimeMulti.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/TraveltimeMulti.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file Traveltime.py +@@ -303,4 +304,4 @@ def drawBarChart(): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityCurve.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityCurve.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file VelocityCurve.py +@@ -155,4 +156,4 @@ def getAveragedValues(interval): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/FetchData.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/FetchData.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file FetchData.py +@@ -192,4 +193,4 @@ def testFCDUniqueness(): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverRoute.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverRoute.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file VelocityOverRoute.py +@@ -147,4 +148,4 @@ def plotIt(taxiId): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime_DK.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime_DK.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + + + from pylab import * +@@ -306,4 +307,4 @@ def plotBarChart(mode="relDiff"): + + #start the program + #cProfile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/CompareVelocitys.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/CompareVelocitys.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file CompareVelocitys.py +@@ -118,4 +119,4 @@ def writeOutput(): + outputFile.close() + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/__init__.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/__init__.py +@@ -0,0 +1,2 @@ ++#!/usr/bin/env python ++ +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file Traveltime.py +@@ -240,4 +241,4 @@ def drawBarChart(): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/util/Path.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/util/Path.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file Path.py +@@ -70,4 +71,4 @@ FQprocessedFCD=newPath(main,"fcdQualitae + + + +- +\ No newline at end of file ++ +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file ProgressBar.py +@@ -31,4 +32,4 @@ def startTask(list, fct): + print "**", + lastProz=actProz + #call the function +- fct(list[i]) +\ No newline at end of file ++ fct(list[i]) +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file CalcTime.py +@@ -51,4 +52,4 @@ def getNiceTimeLabel(label='200707180000 + return label[:4]+"-"+label[4:6]+"-"+label[6:8]+" "+label[8:10]+":"+label[10:12]+":"+label[12:] + + #start the program +-#main() +\ No newline at end of file ++#main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/util/Reader.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/util/Reader.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file Reader.py +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/util/__init__.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/util/__init__.py +@@ -0,0 +1,2 @@ ++#!/usr/bin/env python ++ +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + + def isElmInList(list,elm): +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlot.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlot.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + + from pylab import * + from os import walk +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlotOLD.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlotOLD.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + import sys + from pylab import * + +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsOLD.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsOLD.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateRawFCD.py +@@ -185,4 +186,4 @@ def createOutput(edgeDumpDict, vtypeDict + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffects.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffects.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateRawFCD.py +@@ -224,4 +225,4 @@ def reduceVtype(vtypeDict,taxis,period): + + #start the program + #profile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsProcessedFCD.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsProcessedFCD.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateRawFCD.py +@@ -361,4 +362,4 @@ def getMean(list): + + #start the program + #cProfile.run('main()') +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdQuality/__init__.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdQuality/__init__.py +@@ -0,0 +1 @@ ++#!/usr/bin/env python +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/FCDvsCompleteRoute.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/FCDvsCompleteRoute.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file FCDvsCompleteRoute.py +@@ -146,4 +147,4 @@ def writeOutput(): + + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutesMain.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutesMain.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateTaxiRoutesMain.py +@@ -22,4 +23,4 @@ def main(): + print "end" + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateTaxiRoutes.py +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/__init__.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/__init__.py +@@ -0,0 +1,2 @@ ++#!/usr/bin/env python ++ +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/differentDepartRoutes.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/differentDepartRoutes.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateTaxiRoutesMain.py +@@ -63,4 +64,4 @@ def writeRoutes(): + + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/backup/__init__.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/backup/__init__.py +@@ -0,0 +1,2 @@ ++#!/usr/bin/env python ++ +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file TaxisPerEdge.py +@@ -55,4 +56,4 @@ def writeOutput(): + + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/SeparateVLSArea.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/SeparateVLSArea.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file SeparateVLSArea.py +@@ -39,4 +40,4 @@ def generateVLS_FCD_File(): + + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file QuantityOverDay.py +@@ -78,4 +79,4 @@ def countTaxis(): + + + #start the program +-main() +\ No newline at end of file ++main() +--- sumo-0.16.0~dfsg.orig/tools/projects/TaxiFCD_Krieg/src/rawFCD/GenerateRawFCD.py ++++ sumo-0.16.0~dfsg/tools/projects/TaxiFCD_Krieg/src/rawFCD/GenerateRawFCD.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + # -*- coding: Latin-1 -*- + """ + @file GenerateRawFCD.py +@@ -68,4 +69,4 @@ main() + + + +- +\ No newline at end of file ++ +--- sumo-0.16.0~dfsg.orig/tools/projects/orinoko/buildConnections.pl ++++ sumo-0.16.0~dfsg/tools/projects/orinoko/buildConnections.pl +@@ -1,3 +1,4 @@ ++#!/usr/bin/env perl + sub getAttr($$) { + my $text = $_[0]; + my $attrname = $_[1]; +--- sumo-0.16.0~dfsg.orig/tools/shapes/CSV2polyconvertXML.py ++++ sumo-0.16.0~dfsg/tools/shapes/CSV2polyconvertXML.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/env python + """ + @file CSV2polyconvertXML.py + @author Daniel Krajzewicz +@@ -38,4 +39,4 @@ outf.write("\n") + inpf.close() + outf.close() + +- +\ No newline at end of file ++ +--- /dev/null ++++ sumo-0.16.0~dfsg/docs/examples/sumo/variable_speed_signs/aggregated_25.xml +@@ -0,0 +1,113 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ sumo-0.16.0~dfsg/docs/examples/sumo/output/cross3ltl_emissions/summary.xml +@@ -0,0 +1,470 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ sumo-0.16.0~dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml +@@ -0,0 +1,78 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ sumo-0.16.0~dfsg/docs/examples/sumo/busses/vehroutes.xml +@@ -0,0 +1,38 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null ++++ sumo-0.16.0~dfsg/docs/examples/sumo/vehicle_stops/vehroutes.xml +@@ -0,0 +1,26 @@ ++ ++ ++ ++ ++ ++ diff -Nru sumo-0.15.0~dfsg/debian/patches/series sumo-0.16.0~dfsg/debian/patches/series --- sumo-0.15.0~dfsg/debian/patches/series 2012-04-24 17:27:09.000000000 +0000 +++ sumo-0.16.0~dfsg/debian/patches/series 2012-12-04 19:48:35.000000000 +0000 @@ -1,4 +1,2 @@ -fix_manpage_output.patch -fix_format_not_a_string.patch drop_eulerspiral.patch -fix_headers_of_scripts.patch +fix_scripts_headers.patch diff -Nru sumo-0.15.0~dfsg/docs/examples/jtrrouter/turns/input_turns.turns.xml sumo-0.16.0~dfsg/docs/examples/jtrrouter/turns/input_turns.turns.xml --- sumo-0.15.0~dfsg/docs/examples/jtrrouter/turns/input_turns.turns.xml 2012-01-29 10:20:49.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/examples/jtrrouter/turns/input_turns.turns.xml 2012-09-25 22:05:29.000000000 +0000 @@ -1,4 +1,5 @@ - + + diff -Nru sumo-0.15.0~dfsg/docs/examples/netconvert/hokkaido/hokkaido.netccfg sumo-0.16.0~dfsg/docs/examples/netconvert/hokkaido/hokkaido.netccfg --- sumo-0.15.0~dfsg/docs/examples/netconvert/hokkaido/hokkaido.netccfg 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/examples/netconvert/hokkaido/hokkaido.netccfg 2012-12-04 00:26:11.000000000 +0000 @@ -12,4 +12,8 @@ + + + + diff -Nru sumo-0.15.0~dfsg/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml sumo-0.16.0~dfsg/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml --- sumo-0.15.0~dfsg/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml 2012-01-29 10:20:45.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml 2012-09-25 22:03:52.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.15.0~dfsg/docs/tutorial/city_mobil/createNet.py sumo-0.16.0~dfsg/docs/tutorial/city_mobil/createNet.py --- sumo-0.15.0~dfsg/docs/tutorial/city_mobil/createNet.py 2012-03-14 00:30:38.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/tutorial/city_mobil/createNet.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-07-04 -@version $Id: createNet.py 11809 2012-01-29 13:43:32Z behrisch $ +@version $Id: createNet.py 12358 2012-06-04 19:14:57Z behrisch $ Create the XML input files for the generation of the SUMO network of the CityMobil parking lot. @@ -95,23 +95,23 @@ if random.uniform(0,1) < OCCUPATION_PROBABILITY: occupied += 1 print >> routes, """\ - + """ % (vSlot, vSlot, vSlot) else: print >> routes, """\ - + """ % (slotID, CAR_CAPACITY, slotID, slotID) if random.uniform(0,1) < OCCUPATION_PROBABILITY: occupied += 1 print >> routes, """\ - + """ % (vSlot, vSlot, vSlot) else: print >> routes, """\ - + """ % (slotID, CAR_CAPACITY, slotID, slotID) x = DOUBLE_ROWS * ROW_DIST + ROW_DIST/2 @@ -157,7 +157,7 @@ os.system("%s --no-internal-links -n %s.nod.xml -e %s.edg.xml -x %s.con.xml -o %s.net.xml" % (NETCONVERT, PREFIX, PREFIX, PREFIX, PREFIX)) numBusses = TOTAL_CAPACITY / BUS_CAPACITY -print >> routes, """ +print >> routes, """ """ % numBusses @@ -165,7 +165,7 @@ routes = open("%s_cyber.rou.xml" % PREFIX, "w") print >> routes, """ - + """ % (TOTAL_CAPACITY / CYBER_CAPACITY - numBusses) @@ -191,13 +191,13 @@ routes = open("%s_demand%02i.rou.xml" % (PREFIX, period), "w") print >> routes, "" if occupied < totalSlots: - print >> routes, """ - - """ % (period, totalSlots-occupied) + print >> routes, """ + + """ % (period, totalSlots-occupied) if occupied > 0: - print >> routes, """ - - """ % (period, occupied*CAR_CAPACITY) + print >> routes, """ + + """ % (period, occupied*CAR_CAPACITY) print >> routes, "" routes.close() diff -Nru sumo-0.15.0~dfsg/docs/tutorial/city_mobil/runner.py sumo-0.16.0~dfsg/docs/tutorial/city_mobil/runner.py --- sumo-0.15.0~dfsg/docs/tutorial/city_mobil/runner.py 2012-03-14 00:30:38.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/tutorial/city_mobil/runner.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2011-10-28 -@version $Id: runner.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: runner.py 12898 2012-10-26 08:58:14Z behrisch $ This script is a test runner for the CityMobil scenario. @@ -21,8 +21,8 @@ # build/check network import createNet # perform simple scenario -vehicleControl.init(simpleManager.SimpleManager()) +vehicleControl.init(simpleManager.SimpleManager(), True) # perform agent scenario -vehicleControl.init(agentManager.AgentManager()) +vehicleControl.init(agentManager.AgentManager(), True) try: shutil.copy("all-the-results.txt", "../result2") except: print "Missing 'all-the-results.txt'" diff -Nru sumo-0.15.0~dfsg/docs/tutorial/city_mobil/statistics.py sumo-0.16.0~dfsg/docs/tutorial/city_mobil/statistics.py --- sumo-0.15.0~dfsg/docs/tutorial/city_mobil/statistics.py 2012-03-14 00:30:38.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/tutorial/city_mobil/statistics.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-10-17 -@version $Id: statistics.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: statistics.py 12898 2012-10-26 08:58:14Z behrisch $ Collecting statistics for the CityMobil parking lot @@ -37,7 +37,7 @@ persons[personID].arrive = step personsRunning -= 1 -def evaluate(): +def evaluate(forTest=False): try: import numpy, math except ImportError: @@ -52,10 +52,18 @@ routeTimes[route] = [] routeTimes[route].append(person.arrive - person.depart) waitArray = numpy.array(waitTimes) - print "waiting time (max, mean, dev):", waitArray.max(), waitArray.mean(), math.sqrt(waitArray.var()) + if forTest: + print "waiting time (max, mean, dev):", waitArray.max() < 1000, waitArray.mean() < 1000, math.sqrt(waitArray.var()) < 100 + else: + print "waiting time (max, mean, dev):", waitArray.max(), waitArray.mean(), math.sqrt(waitArray.var()) + for route, times in sorted(routeTimes.iteritems()): timeArray = numpy.array(times) - print route, timeArray.max(), timeArray.mean(), math.sqrt(timeArray.var()) + if forTest: + print route, timeArray.max() < 1000, timeArray.mean() < 1000, math.sqrt(timeArray.var()) < 100 + else: + print route, timeArray.max(), timeArray.mean(), math.sqrt(timeArray.var()) + co2 = 0. for line in open("aggregated.xml"): if "cyber" in line: @@ -63,7 +71,11 @@ if pos >= 9: endpos = line.find('"', pos) co2 += float(line[pos:endpos]) - print "CO2:", co2 + + if forTest: + print "CO2:", co2 < 10000000 + else: + print "CO2:", co2 if __name__ == "__main__": from pylab import * diff -Nru sumo-0.15.0~dfsg/docs/tutorial/city_mobil/vehicleControl.py sumo-0.16.0~dfsg/docs/tutorial/city_mobil/vehicleControl.py --- sumo-0.15.0~dfsg/docs/tutorial/city_mobil/vehicleControl.py 2012-03-14 00:30:38.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/tutorial/city_mobil/vehicleControl.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Daniel Krajzewicz @author Lena Kalleske @date 2008-07-21 -@version $Id: vehicleControl.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: vehicleControl.py 12898 2012-10-26 08:58:14Z behrisch $ Control the CityMobil parking lot via TraCI. @@ -60,7 +60,7 @@ persons = {} waiting = {} -def init(manager): +def init(manager, forTest=False): optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="tell me what you are doing") @@ -89,7 +89,7 @@ try: while setting.step < 100 or statistics.personsRunning > 0: doStep() - statistics.evaluate() + statistics.evaluate(forTest) finally: traci.close() diff -Nru sumo-0.15.0~dfsg/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg sumo-0.16.0~dfsg/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg --- sumo-0.15.0~dfsg/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg 2012-03-14 00:30:38.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg 2012-12-04 00:26:11.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.15.0~dfsg/docs/tutorial/san_pablo_dam/runner.py sumo-0.16.0~dfsg/docs/tutorial/san_pablo_dam/runner.py --- sumo-0.15.0~dfsg/docs/tutorial/san_pablo_dam/runner.py 2012-03-14 00:30:38.000000000 +0000 +++ sumo-0.16.0~dfsg/docs/tutorial/san_pablo_dam/runner.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: runner.py 11765 2012-01-23 10:23:04Z behrisch $ +@version $Id: runner.py 13124 2012-12-03 12:42:52Z behrisch $ This script is a test runner for the San Pablo Dam scenario. @@ -55,7 +55,7 @@ print fType = open('data/input_types.add.xml', 'w') fType.write(('\n \n') % para) fType.close() result = validate.validate(checkBinary('sumo')) @@ -65,21 +65,20 @@ return result # defining all the constraints -def conVmax(params): -# vMax < 25 - return 25.0 - params[0] -def conTtau(params): -# tTau > 1.1 - return params[5] - 1.1 -def conSigA(params): -# sigA > 0.1 - return params[4] - 0.1 -def conSigA2(params): -# sigA < 1.0 - return 1.0 - params[4] -def conAmax(params): -# aMax > 0.1 - return params[1] - 0.1 +def conVmax(params): # vMax < 25 + return 25.0 - params[0] + +def conTtau(params): # tTau > 1.1 + return params[5] - 1.1 + +def conSigA(params): # sigA > 0.1 + return params[4] - 0.1 + +def conSigA2(params): # sigA < 1.0 + return 1.0 - params[4] + +def conAmax(params): # aMax > 0.1 + return params[1] - 0.1 netconvertBinary = checkBinary('netconvert') @@ -97,7 +96,7 @@ validate.parseObsTimes() # perform calibration fpLog = open('results.csv', 'w') -params = [22.0, 2.0, 2.0, 7.5, 0.5, 1.5] +params = [22.0, 2.0, 2.0, 5.0, 0.5, 1.5] # call to (unconstrained) Nelder Mead; does not work correctly, because # method very often stumples over unrealistic input parameters (like tTau<1), # which causes SUMO to behave strangely. diff -Nru sumo-0.15.0~dfsg/ltmain.sh sumo-0.16.0~dfsg/ltmain.sh --- sumo-0.15.0~dfsg/ltmain.sh 2012-03-14 00:11:46.000000000 +0000 +++ sumo-0.16.0~dfsg/ltmain.sh 2012-12-04 00:13:17.000000000 +0000 @@ -1,9 +1,9 @@ -# Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.6b +# libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -32,50 +32,56 @@ # # Provide generalized library-building support services. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory # -# MODE-ARGS vary depending on the MODE. +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -PROGRAM=ltmain.sh +PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.6b +VERSION=2.4 TIMESTAMP="" -package_revision=1.3018 +package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -91,10 +97,15 @@ BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + # NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -107,24 +118,33 @@ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL $lt_unset CDPATH +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" : ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/usr/bin/grep -E"} -: ${FGREP="/usr/bin/grep -F"} -: ${GREP="/usr/bin/grep"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="grep -E"} +: ${FGREP="grep -F"} +: ${GREP="grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/usr/bin/sed"} +: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -144,6 +164,27 @@ dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -158,33 +199,183 @@ # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } -# Generated shell functions inserted here. +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} # The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -215,6 +406,15 @@ # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -243,7 +443,7 @@ # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -258,18 +458,25 @@ : } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + # func_error arg... # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -326,9 +533,9 @@ case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -378,7 +585,7 @@ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "X$my_tmpdir" | $Xsed + $ECHO "$my_tmpdir" } @@ -392,7 +599,7 @@ { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -419,7 +626,7 @@ { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ + my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -488,15 +695,39 @@ fi } - - +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} # func_version # Echo version message to standard output and exit. func_version () { - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -509,22 +740,28 @@ # Echo short help message to standard output and exit. func_usage () { - $SED -n '/^# Usage:/,/# -h/ { + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - $ECHO + echo $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help -# Echo long help message to standard output and exit. +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -537,8 +774,15 @@ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" - exit $? + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi } # func_missing_arg argname @@ -546,63 +790,106 @@ # exit_cmd. func_missing_arg () { - func_error "missing argument for $1" + $opt_debug + + func_error "missing argument for $1." exit_cmd=exit } -exit_cmd=: +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation +exit_cmd=: -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -636,16 +923,16 @@ # Display the features supported by this script. func_features () { - $ECHO "host: $host" + echo "host: $host" if test "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" + echo "enable shared libraries" else - $ECHO "disable shared libraries" + echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" + echo "enable static libraries" else - $ECHO "disable static libraries" + echo "disable static libraries" fi exit $? @@ -692,117 +979,204 @@ esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () { + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - # Parse non-mode specific arguments: - while test "$#" -gt 0; do + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do opt="$1" shift - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" + --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" - opt_debug='set -x' $opt_debug ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift + --dry-run|--dryrun|-n) + opt_dry_run=: ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" shift ;; - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: + opt_preserve_dup_deps=: ;; - - --verbose| -v) preserve_args="$preserve_args $opt" + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) opt_silent=false +func_append preserve_args " $opt" ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" shift ;; + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -810,82 +1184,44 @@ opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} + $opt_help || { + # Sanity checks first: + func_check_version_match -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" fi - exit $EXIT_MISMATCH - fi -} - + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi - test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -950,12 +1286,9 @@ # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1001,6 +1334,37 @@ } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1013,13 +1377,15 @@ if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1030,11 +1396,13 @@ CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1097,6 +1465,486 @@ } } + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $opt_debug + func_convert_core_file_wine_to_w32_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + # func_mode_compile arg... func_mode_compile () { @@ -1137,12 +1985,12 @@ ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1163,15 +2011,14 @@ save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1187,8 +2034,7 @@ esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1213,7 +2059,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx) + *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1288,7 +2134,7 @@ # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -1319,17 +2165,16 @@ $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1349,7 +2194,7 @@ if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1396,11 +2241,11 @@ command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1445,13 +2290,13 @@ } $opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1482,10 +2327,11 @@ -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -1538,7 +2384,7 @@ The following components of INSTALL-COMMAND are treated specially: - -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -1558,6 +2404,8 @@ -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) @@ -1586,6 +2434,11 @@ -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. @@ -1619,18 +2472,44 @@ ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac - $ECHO + echo $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? } - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi # func_mode_execute arg... @@ -1643,13 +2522,16 @@ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1671,7 +2553,7 @@ dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1712,7 +2594,7 @@ for file do case $file in - -*) ;; + -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -1728,8 +2610,7 @@ ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1754,29 +2635,66 @@ # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" + echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1786,7 +2704,7 @@ if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1795,53 +2713,55 @@ # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo - $ECHO "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" - $ECHO "pages." - ;; - *) - $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - $ECHO "X----------------------------------------------------------------------" | $Xsed + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -1852,7 +2772,7 @@ # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -1866,7 +2786,12 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac # We need to accept at least all the BSD install flags. dest= @@ -1876,10 +2801,12 @@ install_type= isdir=no stripme= + no_mode=: for arg do + arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -1887,10 +2814,9 @@ case $arg in -d) isdir=yes ;; -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac + if $install_cp; then :; else + prev=$arg + fi ;; -g | -m | -o) prev=$arg @@ -1904,6 +2830,10 @@ *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi prev= else dest=$arg @@ -1914,7 +2844,11 @@ # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -1923,6 +2857,13 @@ test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -1977,10 +2918,13 @@ case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -1994,23 +2938,23 @@ if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2023,9 +2967,9 @@ if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2043,7 +2987,7 @@ test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -2083,7 +3027,7 @@ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2183,7 +3127,7 @@ if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -2202,7 +3146,7 @@ file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -2221,7 +3165,7 @@ } else # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -2280,7 +3224,7 @@ fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2323,6 +3267,22 @@ extern \"C\" { #endif +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2332,10 +3292,11 @@ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2371,7 +3332,7 @@ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -2384,10 +3345,52 @@ func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2415,36 +3418,19 @@ if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2457,7 +3443,7 @@ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -2500,7 +3486,7 @@ for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2515,16 +3501,16 @@ case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -2538,8 +3524,8 @@ # really was required. # Nullify the symbol file. - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } @@ -2549,6 +3535,7 @@ # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -2559,9 +3546,11 @@ win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2590,6 +3579,131 @@ $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} # func_extract_an_archive dir oldlib @@ -2598,7 +3712,18 @@ $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -2669,7 +3794,7 @@ darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -2684,25 +3809,30 @@ func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } - -# func_emit_wrapper_part1 [arg=no] +# func_emit_wrapper [arg=no] # -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () -{ - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2718,7 +3848,6 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -2749,31 +3878,132 @@ else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ " - $ECHO "\ + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -2783,30 +4013,13 @@ esac fi - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -2814,7 +4027,7 @@ fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -2869,6 +4082,18 @@ if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -2877,253 +4102,28 @@ # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 + func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} -# end: func_emit_wrapper_part2 - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 fi +fi\ +" } -# end: func_to_host_pathlist + # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout @@ -3141,31 +4141,23 @@ This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. */ EOF cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif #include #include #ifdef _MSC_VER # include # include # include -# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif # endif #endif #include @@ -3177,6 +4169,44 @@ #include #include +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) @@ -3192,14 +4222,7 @@ # define S_IXGRP 0 #endif -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - +/* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -3230,10 +4253,6 @@ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -3246,22 +4265,13 @@ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; #else -# define LTWRAPPER_DEBUGPRINTF(args) +static int lt_debug = 0; #endif -const char *program_name = NULL; +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -3271,41 +4281,27 @@ int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_fatal (const char *message, ...); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = -EOF - - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat <"))); + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); for (i = 0; i < newargc; i++) { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); } EOF @@ -3560,11 +4517,14 @@ mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); return 127; } return rval; @@ -3586,7 +4546,7 @@ { void *p = (void *) malloc (num); if (!p) - lt_fatal ("Memory exhausted"); + lt_fatal (__FILE__, __LINE__, "memory exhausted"); return p; } @@ -3620,8 +4580,8 @@ { struct stat st; - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3638,8 +4598,8 @@ int rval = 0; struct stat st; - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3665,8 +4625,8 @@ int tmp_len; char *concat_name; - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -3719,7 +4679,8 @@ { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -3744,7 +4705,8 @@ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -3770,8 +4732,9 @@ int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", - tmp_pathspec)); + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -3793,8 +4756,9 @@ } else { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); @@ -3807,7 +4771,8 @@ tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal ("Could not follow symlinks for %s", pathspec); + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -3833,11 +4798,25 @@ return str; } +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + static void -lt_error_core (int exit_status, const char *mode, +lt_error_core (int exit_status, const char *file, + int line, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s: %s: ", program_name, mode); + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -3846,20 +4825,32 @@ } void -lt_fatal (const char *message, ...) +lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + void lt_setenv (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -3904,95 +4895,12 @@ return new_value; } -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - void lt_update_exe_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4011,9 +4919,9 @@ void lt_update_lib_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4023,11 +4931,152 @@ } } +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + cat <<"EOF" +} EOF } # end: func_emit_cwrapperexe_src +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + # func_mode_link arg... func_mode_link () { @@ -4072,6 +5121,7 @@ new_inherited_linker_flags= avoid_version=no + bindir= dlfiles= dlprefiles= dlself=no @@ -4164,6 +5214,11 @@ esac case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -4195,9 +5250,9 @@ ;; *) if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" + func_append dlfiles " $arg" else - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $arg" fi prev= continue @@ -4221,7 +5276,7 @@ *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; @@ -4240,7 +5295,7 @@ moreargs= for fil in `cat "$save_arg"` do -# moreargs="$moreargs $fil" +# func_append moreargs " $fil" arg=$fil # A libtool-controlled object. @@ -4269,7 +5324,7 @@ if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4281,7 +5336,7 @@ # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4351,12 +5406,12 @@ if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) rpath="$rpath $arg" ;; + *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; + *) func_append xrpath " $arg" ;; esac fi prev= @@ -4368,28 +5423,28 @@ continue ;; weak) - weak_libs="$weak_libs $arg" + func_append weak_libs " $arg" prev= continue ;; xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - compiler_flags="$compiler_flags $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -4425,6 +5480,11 @@ continue ;; + -bindir) + prev=bindir + continue + ;; + -dlopen) prev=dlfiles continue @@ -4475,15 +5535,16 @@ ;; -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_result - if test -z "$dir"; then + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4495,24 +5556,30 @@ ;; esac case "$deplibs " in - *" -L$dir "*) ;; + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; + *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -4522,7 +5589,7 @@ -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4536,7 +5603,7 @@ ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -4556,7 +5623,7 @@ ;; esac fi - deplibs="$deplibs $arg" + func_append deplibs " $arg" continue ;; @@ -4568,8 +5635,8 @@ # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot) - compiler_flags="$compiler_flags $arg" + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler @@ -4577,12 +5644,12 @@ ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; @@ -4649,13 +5716,17 @@ # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac continue ;; @@ -4708,8 +5779,8 @@ for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $func_quote_for_eval_result" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4724,9 +5795,9 @@ for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$linker_flags $func_quote_for_eval_result" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4754,23 +5825,27 @@ arg="$func_quote_for_eval_result" ;; - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" continue ;; @@ -4782,7 +5857,7 @@ *.$objext) # A standard object. - objs="$objs $arg" + func_append objs " $arg" ;; *.lo) @@ -4813,7 +5888,7 @@ if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4825,7 +5900,7 @@ # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4870,24 +5945,25 @@ *.$libext) # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" + func_append deplibs " $arg" + func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. + func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" + func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $func_resolve_sysroot_result" prev= else - deplibs="$deplibs $arg" + func_append deplibs " $func_resolve_sysroot_result" fi continue ;; @@ -4925,7 +6001,7 @@ if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -4934,6 +6010,8 @@ func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -4954,12 +6032,12 @@ # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - libs="$libs $deplib" + func_append libs " $deplib" done if test "$linkmode" = lib; then @@ -4972,9 +6050,9 @@ if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac - pre_post_deps="$pre_post_deps $pre_post_dep" + func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= @@ -5041,17 +6119,19 @@ for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= + func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$lib" ;; + *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + func_basename "$deplib" + deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; + *) func_append deplibs " $deplib" ;; esac done done @@ -5072,11 +6152,11 @@ compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - compiler_flags="$compiler_flags $deplib" + func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5161,7 +6241,7 @@ if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5174,7 +6254,8 @@ test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then @@ -5188,7 +6269,8 @@ finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -5199,17 +6281,21 @@ -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - dir=$func_stripname_result + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) lib="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -5227,7 +6313,7 @@ match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -5237,15 +6323,15 @@ ;; esac if test "$valid_a_lib" != yes; then - $ECHO + echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -5272,11 +6358,11 @@ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - newdlprefiles="$newdlprefiles $deplib" + func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - newdlfiles="$newdlfiles $deplib" + func_append newdlfiles " $deplib" fi fi continue @@ -5318,20 +6404,20 @@ # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then @@ -5342,20 +6428,20 @@ func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done continue fi # $pass = conv @@ -5363,9 +6449,15 @@ # Get the name of the library we link against. linklib= - for l in $old_library $library_names; do - linklib="$l" - done + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -5382,9 +6474,9 @@ # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" + func_append dlprefiles " $lib $dependency_libs" else - newdlfiles="$newdlfiles $lib" + func_append newdlfiles " $lib" fi continue fi # $pass = dlopen @@ -5406,14 +6498,14 @@ # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$libdir" - absdir="$libdir" + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -5421,12 +6513,12 @@ dir="$ladir" absdir="$abs_ladir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -5437,20 +6529,46 @@ if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac fi # $pass = dlpreopen if test -z "$libdir"; then @@ -5468,7 +6586,7 @@ if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" + func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -5481,7 +6599,8 @@ for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? @@ -5492,12 +6611,12 @@ # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... @@ -5512,7 +6631,7 @@ # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; + *) func_append temp_rpath "$absdir:" ;; esac fi @@ -5524,7 +6643,7 @@ *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5533,7 +6652,7 @@ *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5558,12 +6677,12 @@ case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=yes fi ;; @@ -5580,7 +6699,7 @@ fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO + echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -5598,7 +6717,7 @@ *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5607,7 +6726,7 @@ *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5661,7 +6780,7 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$mode" != relink; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= @@ -5683,9 +6802,9 @@ if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then - $ECHO - $ECHO "*** And there doesn't seem to be a static archive available" - $ECHO "*** The link will probably fail, sorry" + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi @@ -5717,7 +6836,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5739,7 +6858,7 @@ if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -5753,13 +6872,13 @@ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$mode" = relink; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= @@ -5773,7 +6892,7 @@ elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -5790,7 +6909,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5825,21 +6944,21 @@ # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - $ECHO + echo $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -5867,37 +6986,46 @@ temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; + *) func_append xrpath " $temp_xrpath";; esac;; - *) temp_deplibs="$temp_deplibs $libdir";; + *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi - newlib_search_path="$newlib_search_path $absdir" + func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do + path= case $deplib in -L*) path="$deplib" ;; *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -5924,8 +7052,8 @@ if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -5958,7 +7086,7 @@ compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -5975,7 +7103,7 @@ for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; + *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= @@ -6033,10 +7161,10 @@ -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -6052,7 +7180,7 @@ ;; esac if test -n "$i" ; then - tmp_libs="$tmp_libs $i" + func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs @@ -6093,7 +7221,7 @@ # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - objs="$objs$old_deplibs" + func_append objs "$old_deplibs" ;; lib) @@ -6126,10 +7254,10 @@ if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" + func_append libobjs " $objs" fi fi @@ -6194,7 +7322,7 @@ age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|sunos) + freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" @@ -6327,7 +7455,7 @@ done # Make executables depend on our current version. - verstring="$verstring:${current}.0" + func_append verstring ":${current}.0" ;; qnx) @@ -6395,10 +7523,10 @@ fi func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" + func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$mode" != relink; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -6414,7 +7542,7 @@ continue fi fi - removelist="$removelist $p" + func_append removelist " $p" ;; *) ;; esac @@ -6425,27 +7553,28 @@ # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" + func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -6459,7 +7588,7 @@ for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; + *) func_append dlfiles " $lib" ;; esac done @@ -6469,19 +7598,19 @@ for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; + *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -6498,7 +7627,7 @@ *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" + func_append deplibs " -lc" fi ;; esac @@ -6547,7 +7676,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6558,21 +7687,21 @@ set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6590,7 +7719,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6601,29 +7730,29 @@ set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6640,15 +7769,27 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -6665,13 +7806,13 @@ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6680,12 +7821,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -6696,7 +7837,7 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -6712,7 +7853,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -6723,9 +7864,9 @@ potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6734,12 +7875,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -6750,32 +7891,32 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO + case $tmp_deplibs in + *[!\ \ ]*) + echo if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $ECHO "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - fi + ;; + esac ;; esac versuffix=$versuffix_save @@ -6787,23 +7928,23 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -6813,16 +7954,16 @@ build_libtool_libs=no fi else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -6839,9 +7980,9 @@ # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -6854,7 +7995,7 @@ *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -6864,10 +8005,10 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -6884,10 +8025,12 @@ hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -6896,18 +8039,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_apped perm_rpath " $libdir" ;; esac fi done @@ -6925,7 +8068,7 @@ # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -6933,7 +8076,7 @@ fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -6959,18 +8102,18 @@ linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7001,13 +8144,45 @@ $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -7029,7 +8204,7 @@ if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -7041,7 +8216,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7051,7 +8226,7 @@ case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7071,21 +8246,21 @@ test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7130,7 +8305,8 @@ save_libobjs=$libobjs fi save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + func_basename "$output" + output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. @@ -7143,13 +8319,16 @@ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output + echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - $ECHO ')' >> $output - delfiles="$delfiles $output" + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7163,10 +8342,12 @@ fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7190,17 +8371,19 @@ # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=$obj + objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -7210,11 +8393,12 @@ # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7248,7 +8432,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7269,7 +8453,7 @@ if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -7281,7 +8465,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7322,10 +8506,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7341,7 +8525,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7353,7 +8537,7 @@ IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7434,18 +8618,21 @@ if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -7505,8 +8692,8 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac @@ -7517,14 +8704,14 @@ if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7538,7 +8725,7 @@ *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7548,17 +8735,17 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7566,7 +8753,7 @@ # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7585,18 +8772,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7605,12 +8792,12 @@ case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7636,18 +8823,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -7661,8 +8848,8 @@ if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -7674,15 +8861,15 @@ wrappers_required=yes case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -7691,13 +8878,19 @@ esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -7720,7 +8913,7 @@ # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7728,7 +8921,7 @@ # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7738,11 +8931,18 @@ # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -7757,7 +8957,7 @@ if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -7769,13 +8969,19 @@ fi # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -7793,18 +8999,7 @@ fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -7884,7 +9079,7 @@ else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -7892,10 +9087,10 @@ if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -7906,10 +9101,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -7925,9 +9120,9 @@ done | sort | sort -uc >/dev/null 2>&1); then : else - $ECHO "copying selected object files to avoid basename conflicts..." + echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -7951,9 +9146,9 @@ esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi @@ -7963,6 +9158,16 @@ len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8036,7 +9241,7 @@ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -8059,9 +9264,19 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8075,9 +9290,9 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8094,7 +9309,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8106,7 +9321,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8115,15 +9330,33 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -8182,7 +9415,7 @@ exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8202,9 +9435,9 @@ for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8213,24 +9446,23 @@ rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8256,18 +9488,17 @@ # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8295,19 +9526,19 @@ # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8317,7 +9548,7 @@ noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8326,7 +9557,7 @@ func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8334,12 +9565,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8347,7 +9578,6 @@ esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8359,16 +9589,16 @@ exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff -Nru sumo-0.15.0~dfsg/src/Makefile.am sumo-0.16.0~dfsg/src/Makefile.am --- sumo-0.15.0~dfsg/src/Makefile.am 2012-01-21 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -8,7 +8,7 @@ GDAL_LIBS = -l$(LIB_GDAL) endif -if MESOSIM +if INTERNAL MESO_LIBS = ./mesosim/libmesosim.a MESOGUI_LIBS = ./mesogui/libmesogui.a ./osgview/libosgview.a INTERNAL_LIBS = ./internal/libinternal.a @@ -16,7 +16,7 @@ if WITH_GUI GUI_APPS = sumo-gui -GUI_DIRS = gui guinetload guisim $(MESOGUI_DIRS) +GUI_DIRS = gui guinetload guisim $(GUI_INTERNAL_DIRS) endif if CHECK_MEMORY_LEAKS @@ -24,15 +24,15 @@ endif if TRACI -TRACI_LIBS = ./traci-server/libtraciserver.a +TRACI_LIBS = ./traci-server/libtraciserver.a ./utils/traci/libtraci.a TRACI_DIRS = traci-server traci_testclient endif bin_PROGRAMS = sumo netconvert $(GUI_APPS) COMMON_LIBS = ./utils/options/liboptions.a \ -./utils/common/libcommon.a \ ./utils/xml/libxml.a \ +./utils/common/libcommon.a \ ./utils/importio/libimportio.a \ ./utils/iodevices/libiodevices.a \ ./foreign/tcpip/libtcpip.a \ @@ -110,7 +110,7 @@ SUBDIRS = foreign utils microsim netbuild netwrite netgen netimport netload \ od2trips polyconvert router dfrouter duarouter jtrrouter activitygen \ -$(MESO_DIRS) $(TRACI_DIRS) $(GUI_DIRS) +$(INTERNAL_DIRS) $(TRACI_DIRS) $(GUI_DIRS) EXTRA_DIST = config.h config.h.in \ guisim.rc \ @@ -118,6 +118,6 @@ if WITH_VERSION_H all: version.h -version.h: .svn/entries +version.h: ../.svn/entries ../tools/build/version.py $(CURDIR) endif diff -Nru sumo-0.15.0~dfsg/src/Makefile.in sumo-0.16.0~dfsg/src/Makefile.in --- sumo-0.15.0~dfsg/src/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/Makefile.in 2012-12-04 00:13:18.000000000 +0000 @@ -53,9 +53,8 @@ am_netconvert_OBJECTS = netconvert_main.$(OBJEXT) netconvert_OBJECTS = $(am_netconvert_OBJECTS) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = ./utils/options/liboptions.a \ - ./utils/common/libcommon.a ./utils/xml/libxml.a \ - ./utils/importio/libimportio.a \ +am__DEPENDENCIES_2 = ./utils/options/liboptions.a ./utils/xml/libxml.a \ + ./utils/common/libcommon.a ./utils/importio/libimportio.a \ ./utils/iodevices/libiodevices.a ./foreign/tcpip/libtcpip.a \ $(MEM_LIBS) $(am__DEPENDENCIES_1) netconvert_DEPENDENCIES = ./netimport/libnetimport.a \ @@ -201,6 +200,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -231,6 +231,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -265,6 +266,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -298,7 +300,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -320,17 +321,17 @@ top_srcdir = @top_srcdir@ @WITH_PROJ_TRUE@PROJ_LIBS = -l$(LIB_PROJ) @WITH_GDAL_TRUE@GDAL_LIBS = -l$(LIB_GDAL) -@MESOSIM_TRUE@MESO_LIBS = ./mesosim/libmesosim.a -@MESOSIM_TRUE@MESOGUI_LIBS = ./mesogui/libmesogui.a ./osgview/libosgview.a -@MESOSIM_TRUE@INTERNAL_LIBS = ./internal/libinternal.a +@INTERNAL_TRUE@MESO_LIBS = ./mesosim/libmesosim.a +@INTERNAL_TRUE@MESOGUI_LIBS = ./mesogui/libmesogui.a ./osgview/libosgview.a +@INTERNAL_TRUE@INTERNAL_LIBS = ./internal/libinternal.a @WITH_GUI_TRUE@GUI_APPS = sumo-gui -@WITH_GUI_TRUE@GUI_DIRS = gui guinetload guisim $(MESOGUI_DIRS) +@WITH_GUI_TRUE@GUI_DIRS = gui guinetload guisim $(GUI_INTERNAL_DIRS) @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ./foreign/nvwa/libnvwa.a -@TRACI_TRUE@TRACI_LIBS = ./traci-server/libtraciserver.a +@TRACI_TRUE@TRACI_LIBS = ./traci-server/libtraciserver.a ./utils/traci/libtraci.a @TRACI_TRUE@TRACI_DIRS = traci-server traci_testclient COMMON_LIBS = ./utils/options/liboptions.a \ -./utils/common/libcommon.a \ ./utils/xml/libxml.a \ +./utils/common/libcommon.a \ ./utils/importio/libimportio.a \ ./utils/iodevices/libiodevices.a \ ./foreign/tcpip/libtcpip.a \ @@ -396,7 +397,7 @@ SUBDIRS = foreign utils microsim netbuild netwrite netgen netimport netload \ od2trips polyconvert router dfrouter duarouter jtrrouter activitygen \ -$(MESO_DIRS) $(TRACI_DIRS) $(GUI_DIRS) +$(INTERNAL_DIRS) $(TRACI_DIRS) $(GUI_DIRS) EXTRA_DIST = config.h config.h.in \ guisim.rc \ @@ -861,7 +862,7 @@ @WITH_VERSION_H_TRUE@all: version.h -@WITH_VERSION_H_TRUE@version.h: .svn/entries +@WITH_VERSION_H_TRUE@version.h: ../.svn/entries @WITH_VERSION_H_TRUE@ ../tools/build/version.py $(CURDIR) # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru sumo-0.15.0~dfsg/src/activitygen/AGActivityGen.cpp sumo-0.16.0~dfsg/src/activitygen/AGActivityGen.cpp --- sumo-0.15.0~dfsg/src/activitygen/AGActivityGen.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/AGActivityGen.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityGen.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivityGen.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main class that handles City, Activities and Trips /****************************************************************************/ @@ -55,9 +55,6 @@ void AGActivityGen::importInfoCity() { AGActivityGenHandler handler(city, net); - handler.setFileName(inputFile); - XMLSubSys::init(false); - MsgHandler::initOutputOptions(); PROGRESS_BEGIN_MESSAGE("Reading input"); if (!XMLSubSys::runParser(handler, inputFile)) { PROGRESS_FAILED_MESSAGE(); @@ -150,11 +147,11 @@ int firstTrip = trips.front().getTime() + trips.front().getDay() * 86400; int lastTrip = trips.front().getTime() + trips.front().getDay() * 86400; std::map histogram; - for (int i = 0 ; i < 100 ; ++i) { + for (int i = 0; i < 100; ++i) { histogram[i] = 0; } //END var TESTS - for (it = trips.begin() ; it != trips.end() ; ++it) { + for (it = trips.begin(); it != trips.end(); ++it) { atw.addTrip(*it); //TEST if (it->getTime() + 86400 * it->getDay() > lastTrip) { @@ -172,7 +169,7 @@ AGTime last(lastTrip); std::cout << "first real trip: " << first.getDay() << ", " << first.getHour() << ":" << first.getMinute() << ":" << first.getSecond() << std::endl; std::cout << "last real trip: " << last.getDay() << ", " << last.getHour() << ":" << last.getMinute() << ":" << last.getSecond() << std::endl; - for (int i = 0 ; i < 100 ; ++i) { + for (int i = 0; i < 100; ++i) { if (histogram[i] > 0) { std::cout << "histogram[ hour " << i << " ] = " << histogram[i] << std::endl; } @@ -200,9 +197,9 @@ std::map carUsed; std::list::iterator it; //multiplication of days - for (it = acts.trips.begin() ; it != acts.trips.end() ; ++it) { + for (it = acts.trips.begin(); it != acts.trips.end(); ++it) { if (it->isDaily()) { - for (int currday = 1 ; currday < durationInDays + 2 ; ++currday) { + for (int currday = 1; currday < durationInDays + 2; ++currday) { AGTrip tr(it->getDep(), it->getArr(), it->getVehicleName(), it->getTime(), currday); tr.setType(it->getType()); if (carUsed.find(tr.getVehicleName()) != carUsed.end()) { diff -Nru sumo-0.15.0~dfsg/src/activitygen/AGActivityGen.h sumo-0.16.0~dfsg/src/activitygen/AGActivityGen.h --- sumo-0.15.0~dfsg/src/activitygen/AGActivityGen.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/AGActivityGen.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityGen.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivityGen.h 12643 2012-09-01 21:00:18Z behrisch $ /// // Main class that handles City, Activities and Trips /****************************************************************************/ @@ -86,13 +86,13 @@ protected: // @brief xml files: statistics on the city and generated routes std::string inputFile, outputFile; + // @brief network of the city + RONet* net; //Activities activities; // @brief city object containing all households and vehicles AGCity city; // @brief time of beginning and ending of the simulation and the duration of the simulation in days (min 1 day (beginning and end in the same day) int durationInDays, beginTime, endTime; - // @brief network of the city - RONet* net; /** * @brief validation: compatibility of the given trip @@ -115,6 +115,10 @@ * @param[in] trip on which a random (normally distributed) variation will be tried */ void varDepTime(AGTrip& trip); + +private: + /// @brief invalidated assignment operator + AGActivityGen& operator=(const AGActivityGen&); }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/AGActivityGenHandler.cpp sumo-0.16.0~dfsg/src/activitygen/AGActivityGenHandler.cpp --- sumo-0.15.0~dfsg/src/activitygen/AGActivityGenHandler.cpp 2012-01-24 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/AGActivityGenHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityGenHandler.cpp 11774 2012-01-23 14:02:00Z w-bamberger $ +/// @version $Id: AGActivityGenHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The handler for parsing the statistics file. /****************************************************************************/ @@ -61,16 +61,15 @@ // method definitions // =========================================================================== AGActivityGenHandler::AGActivityGenHandler(AGCity& city, RONet* net) - : SUMOSAXHandler("sumo-stat"), net(net), - myCity(city) {} + : SUMOSAXHandler("sumo-stat"), + myCity(city), net(net) {} AGActivityGenHandler::~AGActivityGenHandler() {} void -AGActivityGenHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) -{ +AGActivityGenHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { try { switch (element) { case AGEN_TAG_GENERAL: @@ -330,13 +329,10 @@ try { bool ok = true; - int refID = attrs.hasAttribute(SUMO_ATTR_REFID) - ? attrs.getIntReporting(SUMO_ATTR_REFID, myCurrentObject.c_str(), ok) - : attrs.getIntReporting(SUMO_ATTR_REFID__DEPRECATED, myCurrentObject.c_str(), ok); + int refID = attrs.getIntReporting(SUMO_ATTR_REFID, myCurrentObject.c_str(), ok); if (!ok) { throw ProcessError(); } - if (!isRevStation) { currentBusLine->locateStation(myCity.statData.busStations.find(refID)->second); } else { @@ -379,7 +375,8 @@ void AGActivityGenHandler::parseBracket(const SUMOSAXAttributes& attrs) { try { - int beginAge = attrs.getInt(AGEN_ATTR_BEGINAGE); //included in the bracket +//TODO beginAge needs to be evaluated +// int beginAge = attrs.getInt(AGEN_ATTR_BEGINAGE); //included in the bracket int endAge = attrs.getInt(AGEN_ATTR_ENDAGE); //NOT included in the bracket if (myCurrentObject == "population") { myCity.statData.population[endAge] = attrs.getInt(AGEN_ATTR_PEOPLENBR); diff -Nru sumo-0.15.0~dfsg/src/activitygen/AGActivityGenHandler.h sumo-0.16.0~dfsg/src/activitygen/AGActivityGenHandler.h --- sumo-0.15.0~dfsg/src/activitygen/AGActivityGenHandler.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/AGActivityGenHandler.h 2012-09-25 22:01:42.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityGenHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivityGenHandler.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The handler for parsing the statistics file. /****************************************************************************/ @@ -61,7 +61,7 @@ /// @brief Destructor - virtual ~AGActivityGenHandler() ; + virtual ~AGActivityGenHandler(); protected: @@ -76,7 +76,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} protected: diff -Nru sumo-0.15.0~dfsg/src/activitygen/AGActivityTripWriter.cpp sumo-0.16.0~dfsg/src/activitygen/AGActivityTripWriter.cpp --- sumo-0.15.0~dfsg/src/activitygen/AGActivityTripWriter.cpp 2012-01-24 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/AGActivityTripWriter.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityTripWriter.cpp 11773 2012-01-23 13:57:14Z w-bamberger $ +/// @version $Id: AGActivityTripWriter.cpp 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Class for writing Trip objects in a SUMO-route file. /****************************************************************************/ @@ -76,7 +76,7 @@ //the route routes << " begin() ; it != trip.getPassed()->end() ; ++it) { + for (it = trip.getPassed()->begin(); it != trip.getPassed()->end(); ++it) { routes << " " << it->getStreet().getName(); } routes << " " << trip.getArr().getStreet().getName(); diff -Nru sumo-0.15.0~dfsg/src/activitygen/Makefile.am sumo-0.16.0~dfsg/src/activitygen/Makefile.am --- sumo-0.15.0~dfsg/src/activitygen/Makefile.am 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -7,8 +7,8 @@ endif COMMON_LIBS = ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/activitygen/Makefile.in sumo-0.16.0~dfsg/src/activitygen/Makefile.in --- sumo-0.15.0~dfsg/src/activitygen/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -54,7 +54,7 @@ activitygen_OBJECTS = $(am_activitygen_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../utils/options/liboptions.a \ - ../utils/common/libcommon.a ../utils/xml/libxml.a \ + ../utils/xml/libxml.a ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../foreign/tcpip/libtcpip.a $(MEM_LIBS) $(am__DEPENDENCIES_1) @@ -152,6 +152,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -182,6 +183,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -216,6 +218,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -249,7 +252,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -272,8 +274,8 @@ SUBDIRS = activities city @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a COMMON_LIBS = ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGActivities.cpp sumo-0.16.0~dfsg/src/activitygen/activities/AGActivities.cpp --- sumo-0.15.0~dfsg/src/activitygen/activities/AGActivities.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGActivities.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivities.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivities.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Main class that manages activities taken in account and generates the // inhabitants' trip list. @@ -47,14 +47,14 @@ // method definitions // =========================================================================== void -AGActivities::addTrip(AGTrip t, std::list *tripSet) { +AGActivities::addTrip(AGTrip t, std::list* tripSet) { tripSet->push_back(t); } void -AGActivities::addTrips(std::list t, std::list *tripSet) { +AGActivities::addTrips(std::list t, std::list* tripSet) { std::list::iterator it; - for (it = t.begin() ; it != t.end() ; ++it) { + for (it = t.begin(); it != t.end(); ++it) { tripSet->push_back(*it); } } @@ -67,7 +67,7 @@ */ numbErr = 0; std::list::iterator itBL; - for (itBL = myCity->busLines.begin() ; itBL != myCity->busLines.end() ; ++itBL) { + for (itBL = myCity->busLines.begin(); itBL != myCity->busLines.end(); ++itBL) { if (! generateBusTraffic(*itBL)) { ++numbErr; } @@ -85,7 +85,7 @@ */ numbErr = 0; std::list::iterator itHH; - for (itHH = myCity->households.begin() ; itHH != myCity->households.end() ; ++itHH) { + for (itHH = myCity->households.begin(); itHH != myCity->households.end(); ++itHH) { if (! generateTrips(*itHH)) { ++numbErr; } @@ -138,7 +138,7 @@ ++iteration; continue; } - addTrips(ws.partialActivityTrips, &temporaTrips); + addTrips(ws.getPartialActivityTrips(), &temporaTrips); // free time activities AGFreeTime ft(&hh, &(myCity->statData), &temporaTrips, nbrDays); @@ -148,7 +148,7 @@ ++iteration; continue; } - addTrips(ft.partialActivityTrips, &temporaTrips); + addTrips(ft.getPartialActivityTrips(), &temporaTrips); //cout << "after this hh: " << temporaTrips.size() << " we have: " << trips.size() << endl; //trips of all activities generated: addTrips(temporaTrips, &trips); @@ -163,12 +163,12 @@ /** * Buses in the first direction */ - for (itB = bl.buses.begin() ; itB != bl.buses.end() ; ++itB) { + for (itB = bl.buses.begin(); itB != bl.buses.end(); ++itB) { if (bl.stations.size() < 1) { return false; } AGTrip t(bl.stations.front(), bl.stations.back(), *itB, itB->getDeparture()); - for (itS = bl.stations.begin() ; itS != bl.stations.end() ; ++itS) { + for (itS = bl.stations.begin(); itS != bl.stations.end(); ++itS) { if (*itS == t.getDep() || *itS == t.getArr()) { continue; } @@ -183,12 +183,12 @@ if (bl.revStations.empty()) { return true; //in this case, no return way: everything is ok. } - for (itB = bl.revBuses.begin() ; itB != bl.revBuses.end() ; ++itB) { + for (itB = bl.revBuses.begin(); itB != bl.revBuses.end(); ++itB) { if (bl.revStations.size() < 1) { return false; } AGTrip t(bl.revStations.front(), bl.revStations.back(), *itB, itB->getDeparture()); - for (itS = bl.revStations.begin() ; itS != bl.revStations.end() ; ++itS) { + for (itS = bl.revStations.begin(); itS != bl.revStations.end(); ++itS) { if (*itS == t.getDep() || *itS == t.getArr()) { continue; } @@ -215,7 +215,7 @@ int num = 1; std::list::iterator itA; - for (itA = myCity->peopleIncoming.begin() ; itA != myCity->peopleIncoming.end() ; ++itA) { + for (itA = myCity->peopleIncoming.begin(); itA != myCity->peopleIncoming.end(); ++itA) { int posi = myCity->statData.getRandomCityGateByIncoming(); std::string nom(generateName(num, "carIn")); AGTrip wayTrip(myCity->cityGates[posi], itA->getWorkPosition().getPosition(), nom, itA->getWorkPosition().getOpening()); @@ -241,7 +241,7 @@ //total number of trips during the whole simulation int totalTrips = 0, ttOneDayTrips = 0, ttDailyTrips = 0; std::list::iterator it; - for (it = trips.begin() ; it != trips.end() ; ++it) { + for (it = trips.begin(); it != trips.end(); ++it) { if (it->isDaily()) { ++ttDailyTrips; } else { @@ -261,7 +261,7 @@ //TESTS std::cout << "added uniform random trips: " << nbrRandUni << std::endl; //END OF TESTS - for (int i = 0 ; i < nbrRandUni ; ++i) { + for (int i = 0; i < nbrRandUni; ++i) { AGPosition dep(myCity->getRandomStreet()); AGPosition arr(myCity->getRandomStreet()); AGTime depTime(RandHelper::rand(nbrDays * 86400)); @@ -271,7 +271,7 @@ } //random proportional distribution: - float proportionalPercentage = 0.05f; + //float proportionalPercentage = 0.05f; //TODO generate a proportionally distributed random traffic return true; diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGActivities.h sumo-0.16.0~dfsg/src/activitygen/activities/AGActivities.h --- sumo-0.15.0~dfsg/src/activitygen/activities/AGActivities.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGActivities.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivities.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivities.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Main class that manages activities taken in account and generates the // inhabitants' trip list. @@ -50,8 +50,8 @@ AGActivities(AGCity* city, int days) : myCity(city), nbrDays(days) {}; - void addTrip(AGTrip t, std::list *tripSet); - void addTrips(std::list t, std::list *tripSet); + void addTrip(AGTrip t, std::list* tripSet); + void addTrips(std::list t, std::list* tripSet); void generateActivityTrips(); /** diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGActivity.cpp sumo-0.16.0~dfsg/src/activitygen/activities/AGActivity.cpp --- sumo-0.15.0~dfsg/src/activitygen/activities/AGActivity.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGActivity.cpp 2012-09-25 22:01:41.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivity.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivity.cpp 12475 2012-07-04 14:21:22Z behrisch $ /// // Parent object for all activities. Derived classes generate trips for each // household. @@ -59,27 +59,27 @@ int transp = 0; - if (destination.distanceTo(hh->getPosition()) <= ds->maxFootDistance) { + if (destination.distanceTo(myHousehold->getPosition()) <= myStatData->maxFootDistance) { transp = FOOT; - if (hh->getCarNbr() != 0) { + if (myHousehold->getCarNbr() != 0) { transp += CAR; } - if (destination.minDistanceTo(ds->busStations) <= ds->maxFootDistance - && hh->getPosition().minDistanceTo(ds->busStations) <= ds->maxFootDistance) { + if (destination.minDistanceTo(myStatData->busStations) <= myStatData->maxFootDistance + && myHousehold->getPosition().minDistanceTo(myStatData->busStations) <= myStatData->maxFootDistance) { transp += BUS; } - } else if (hh->getCarNbr() == 0) { - SUMOReal d1 = destination.distanceTo(hh->getPosition()); - SUMOReal d2 = destination.minDistanceTo(ds->busStations) + hh->getPosition().minDistanceTo(ds->busStations); + } else if (myHousehold->getCarNbr() == 0) { + SUMOReal d1 = destination.distanceTo(myHousehold->getPosition()); + SUMOReal d2 = destination.minDistanceTo(myStatData->busStations) + myHousehold->getPosition().minDistanceTo(myStatData->busStations); if (d1 > d2) { transp = BUS; } else { transp = FOOT; } - } else if (hh->getCarNbr() != 0) { //all other cases - if (destination.minDistanceTo(ds->busStations) > ds->maxFootDistance - || hh->getPosition().minDistanceTo(ds->busStations) > ds->maxFootDistance) { + } else if (myHousehold->getCarNbr() != 0) { //all other cases + if (destination.minDistanceTo(myStatData->busStations) > myStatData->maxFootDistance + || myHousehold->getPosition().minDistanceTo(myStatData->busStations) > myStatData->maxFootDistance) { transp = CAR; } else { transp = CAR + BUS; @@ -95,11 +95,11 @@ int available = 0; - if (from.distanceTo(to) <= ds->maxFootDistance) { + if (from.distanceTo(to) <= myStatData->maxFootDistance) { available += FOOT; } - if (from.minDistanceTo(ds->busStations) <= ds->maxFootDistance - && to.minDistanceTo(ds->busStations) <= ds->maxFootDistance) { + if (from.minDistanceTo(myStatData->busStations) <= myStatData->maxFootDistance + && to.minDistanceTo(myStatData->busStations) <= myStatData->maxFootDistance) { available += BUS; } return available; @@ -135,10 +135,9 @@ return (begin + tAlea); } -/****************************************************************************/ - - - - - +std::list& +AGActivity::getPartialActivityTrips() { + return myPartialActivityTrips; +} +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGActivity.h sumo-0.16.0~dfsg/src/activitygen/activities/AGActivity.h --- sumo-0.15.0~dfsg/src/activitygen/activities/AGActivity.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGActivity.h 2012-09-25 22:01:41.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivity.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGActivity.h 12475 2012-07-04 14:21:22Z behrisch $ /// // Parent object for all activities. Derived classes generate trips for each // household. @@ -46,12 +46,12 @@ class AGActivity { public: AGActivity(AGHousehold* hh, AGDataAndStatistics* das, std::list* prevTrips, int prio) : - hh(hh), - ds(das), + myHousehold(hh), + myStatData(das), + myPreviousTrips(prevTrips), activityPriority(prio), genDone(false), timePerKm(das->speedTimePerKm), - previousTrips(prevTrips), carPreference(das->carPreference) {}; /** @@ -62,9 +62,8 @@ /** * main function called for trip generation * this function is overwritten in every child-class (every activity) - * @TO BE OVERWRITEN */ - bool generateTrips(); + virtual bool generateTrips() = 0; /** * determine the possible transportation means, what would be chosen: @@ -104,21 +103,23 @@ */ int randomTimeBetween(int begin, int end); + std::list& getPartialActivityTrips(); - std::list partialActivityTrips; - std::list *previousTrips; - bool genDone; +protected: + AGHousehold* myHousehold; + + AGDataAndStatistics* myStatData; + + std::list* myPreviousTrips; + std::list myPartialActivityTrips; int activityPriority; + bool genDone; SUMOReal timePerKm; /** * rate of taking the car instead of the bus because of personal preference */ SUMOReal carPreference; - AGHousehold* hh; - - AGDataAndStatistics* ds; - }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGFreeTime.cpp sumo-0.16.0~dfsg/src/activitygen/activities/AGFreeTime.cpp --- sumo-0.15.0~dfsg/src/activitygen/activities/AGFreeTime.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGFreeTime.cpp 2012-09-25 22:01:41.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGFreeTime.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGFreeTime.cpp 12475 2012-07-04 14:21:22Z behrisch $ /// // Generates trips related to after-work activities // like visiting the family or party. @@ -60,7 +60,7 @@ // =========================================================================== int AGFreeTime::decideTypeOfTrip() { - if (hh->adults.front().decide(freqOut)) { + if (myHousehold->getAdults().front().decide(freqOut)) { int num_poss = 0; //(possibleType % 2) + (possibleType / 4) + ((possibleType / 2) % 2); if (possibleType & DAY) { ++num_poss; @@ -104,16 +104,16 @@ int AGFreeTime::possibleTypeOfTrip() { int val = 0; - if (hh->adults.front().getAge() >= ds->limitAgeRetirement && tReady == 0) { + if (myHousehold->getAdults().front().getAge() >= myStatData->limitAgeRetirement && tReady == 0) { val += DAY + EVENING; } else { - if (hh->getPeopleNbr() > hh->getAdultNbr()) { + if (myHousehold->getPeopleNbr() > myHousehold->getAdultNbr()) { val += NIGHT; } - std::list::iterator itA; + std::list::const_iterator itA; bool noBodyWorks = true; - for (itA = hh->adults.begin() ; itA != hh->adults.end() ; ++itA) { + for (itA = myHousehold->getAdults().begin(); itA != myHousehold->getAdults().end(); ++itA) { if (itA->isWorking()) { noBodyWorks = false; } @@ -132,42 +132,42 @@ bool AGFreeTime::typeFromHomeDay(int day) { int backHome = whenBackHomeThisDay(day); - if (hh->cars.empty()) { + if (myHousehold->getCars().empty()) { return true; } - AGPosition destination(hh->getTheCity()->getRandomStreet()); + AGPosition destination(myHousehold->getTheCity()->getRandomStreet()); int depTime = randomTimeBetween(MAX2(backHome, TB_DAY), (TB_DAY + TE_DAY) / 2); - int arrTime = this->arrHour(hh->getPosition(), destination, depTime); + int arrTime = this->arrHour(myHousehold->getPosition(), destination, depTime); int retTime = randomTimeBetween(arrTime, TE_DAY); if (depTime < 0 || retTime < 0) { return true; // not enough time during the day } - AGTrip depTrip(hh->getPosition(), destination, hh->cars.front().getName(), depTime, day); - AGTrip retTrip(destination, hh->getPosition(), hh->cars.front().getName(), retTime, day); + AGTrip depTrip(myHousehold->getPosition(), destination, myHousehold->getCars().front().getName(), depTime, day); + AGTrip retTrip(destination, myHousehold->getPosition(), myHousehold->getCars().front().getName(), retTime, day); - this->partialActivityTrips.push_back(depTrip); - this->partialActivityTrips.push_back(retTrip); + myPartialActivityTrips.push_back(depTrip); + myPartialActivityTrips.push_back(retTrip); return true; } bool AGFreeTime::typeFromHomeEvening(int day) { int backHome = whenBackHomeThisDay(day); - if (hh->cars.empty()) { + if (myHousehold->getCars().empty()) { return true; } - AGPosition destination(hh->getTheCity()->getRandomStreet()); + AGPosition destination(myHousehold->getTheCity()->getRandomStreet()); int depTime = randomTimeBetween(MAX2(backHome, TB_EVENING), TE_EVENING); - int arrTime = this->arrHour(hh->getPosition(), destination, depTime); + int arrTime = this->arrHour(myHousehold->getPosition(), destination, depTime); int retTime = randomTimeBetween(arrTime, TE_EVENING); if (depTime < 0 || retTime < 0) { return true; // not enough time during the day } - AGTrip depTrip(hh->getPosition(), destination, hh->cars.front().getName(), depTime, day); - AGTrip retTrip(destination, hh->getPosition(), hh->cars.front().getName(), retTime, day); + AGTrip depTrip(myHousehold->getPosition(), destination, myHousehold->getCars().front().getName(), depTime, day); + AGTrip retTrip(destination, myHousehold->getPosition(), myHousehold->getCars().front().getName(), retTime, day); - this->partialActivityTrips.push_back(depTrip); - this->partialActivityTrips.push_back(retTrip); + myPartialActivityTrips.push_back(depTrip); + myPartialActivityTrips.push_back(retTrip); return true; } @@ -176,15 +176,15 @@ int backHome = whenBackHomeThisDay(day); int ActivitiesNextDay = whenBeginActivityNextDay(day); // is equal to 2 days if there is nothing the next day int nextDay = 0; - if (hh->cars.empty()) { + if (myHousehold->getCars().empty()) { return true; } - AGPosition destination(hh->getTheCity()->getRandomStreet()); + AGPosition destination(myHousehold->getTheCity()->getRandomStreet()); int depTime = randomTimeBetween(MAX2(backHome, TB_NIGHT), TE_NIGHT); - int arrTime = this->arrHour(hh->getPosition(), destination, depTime); + int arrTime = this->arrHour(myHousehold->getPosition(), destination, depTime); //we have to go back home before the beginning of next day activities. - int lastRetTime = this->depHour(destination, hh->getPosition(), MIN2(TE_NIGHT, ActivitiesNextDay)); + int lastRetTime = this->depHour(destination, myHousehold->getPosition(), MIN2(TE_NIGHT, ActivitiesNextDay)); int retTime = randomTimeBetween(arrTime, lastRetTime); if (depTime < 0 || retTime < 0) { return true; // not enough time during the day @@ -193,15 +193,15 @@ AGTime departureTime(depTime); nextDay = departureTime.getDay(); departureTime.setDay(0); - AGTrip depTrip(hh->getPosition(), destination, hh->cars.front().getName(), departureTime.getTime(), day + nextDay); + AGTrip depTrip(myHousehold->getPosition(), destination, myHousehold->getCars().front().getName(), departureTime.getTime(), day + nextDay); AGTime returnTime(depTime); nextDay = returnTime.getDay(); returnTime.setDay(0); - AGTrip retTrip(destination, hh->getPosition(), hh->cars.front().getName(), returnTime.getTime(), day + nextDay); + AGTrip retTrip(destination, myHousehold->getPosition(), myHousehold->getCars().front().getName(), returnTime.getTime(), day + nextDay); - this->partialActivityTrips.push_back(depTrip); - this->partialActivityTrips.push_back(retTrip); + myPartialActivityTrips.push_back(depTrip); + myPartialActivityTrips.push_back(retTrip); return true; } @@ -211,7 +211,7 @@ possibleType = possibleTypeOfTrip(); int type; - for (int day = 1 ; day <= nbrDays ; ++day) { + for (int day = 1; day <= nbrDays; ++day) { type = decideTypeOfTrip(); if (type == 0) { continue; @@ -236,12 +236,9 @@ int AGFreeTime::whenBackHome() { int timeBack = 0; - if (!this->previousTrips->empty()) { - std::list::iterator itT; - for (itT = previousTrips->begin() ; itT != previousTrips->end() ; ++itT) { - if (timeBack < itT->getArrTime(this->timePerKm) && itT->isDaily()) { - timeBack = itT->getArrTime(this->timePerKm); - } + for (std::list::iterator itT = myPreviousTrips->begin(); itT != myPreviousTrips->end(); ++itT) { + if (timeBack < itT->getArrTime(this->timePerKm) && itT->isDaily()) { + timeBack = itT->getArrTime(this->timePerKm); } } return timeBack; @@ -250,12 +247,9 @@ int AGFreeTime::whenBackHomeThisDay(int day) { int timeBack = 0; - if (!this->previousTrips->empty()) { - std::list::iterator itT; - for (itT = previousTrips->begin() ; itT != previousTrips->end() ; ++itT) { - if (timeBack < itT->getArrTime(this->timePerKm) && (itT->getDay() == day || itT->isDaily())) { - timeBack = itT->getArrTime(this->timePerKm); - } + for (std::list::iterator itT = myPreviousTrips->begin(); itT != myPreviousTrips->end(); ++itT) { + if (timeBack < itT->getArrTime(this->timePerKm) && (itT->getDay() == day || itT->isDaily())) { + timeBack = itT->getArrTime(this->timePerKm); } } return timeBack; @@ -264,12 +258,9 @@ int AGFreeTime::whenBeginActivityNextDay(int day) { AGTime timeBack(1, 0, 0); - if (!this->previousTrips->empty()) { - std::list::iterator itT; - for (itT = previousTrips->begin() ; itT != previousTrips->end() ; ++itT) { - if (timeBack.getTime() > itT->getTime() && (itT->getDay() == (day + 1) || itT->isDaily())) { - timeBack.setTime(itT->getTime()); - } + for (std::list::iterator itT = myPreviousTrips->begin(); itT != myPreviousTrips->end(); ++itT) { + if (timeBack.getTime() > itT->getTime() && (itT->getDay() == (day + 1) || itT->isDaily())) { + timeBack.setTime(itT->getTime()); } } timeBack.addDays(1); // this the beginning of activities of the next day diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGFreeTime.h sumo-0.16.0~dfsg/src/activitygen/activities/AGFreeTime.h --- sumo-0.15.0~dfsg/src/activitygen/activities/AGFreeTime.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGFreeTime.h 2012-09-25 22:01:41.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGFreeTime.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGFreeTime.h 12475 2012-07-04 14:21:22Z behrisch $ /// // Generates trips related to after-work activities // like visiting the family or party. @@ -95,6 +95,10 @@ private: /** + * frequency of going out or see family is assumed to be once a week (in mean) + */ + SUMOReal freqOut; + /** * number of days for the simulation * households are likely to go out some days but not others */ @@ -108,10 +112,6 @@ * possible type of trips for this household */ int possibleType; - /** - * frequency of going out or see family is assumed to be once a week (in mean) - */ - SUMOReal freqOut; static const int DAY;// = 1; static const int EVENING;// = 2; diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGTrip.cpp sumo-0.16.0~dfsg/src/activitygen/activities/AGTrip.cpp --- sumo-0.15.0~dfsg/src/activitygen/activities/AGTrip.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGTrip.cpp 2012-09-25 22:01:41.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGTrip.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGTrip.cpp 12468 2012-07-03 19:15:42Z behrisch $ /// // Class containing all information of a given trip (car, bus) /****************************************************************************/ @@ -54,80 +54,80 @@ AGTrip::print() { std::cout << "Trip: " << std::endl; std::cout << "\t-From= "; - from.print(); + myFrom.print(); std::cout << "\t-To= "; - to.print(); - std::cout << "\t-At= " << atTime << " -Day= " << day << std::endl; - std::cout << "\t-Vehicle= " << vehicle << std::endl; - std::cout << "\t-type= " << type << std::endl; + myTo.print(); + std::cout << "\t-At= " << myDepTime << " -Day= " << myDay << std::endl; + std::cout << "\t-Vehicle= " << myVehicle << std::endl; + std::cout << "\t-type= " << myType << std::endl; } void AGTrip::addLayOver(AGPosition by) { - passBy.push_back(by); + myPassBy.push_back(by); } void AGTrip::addLayOver(AGTrip& trip) { std::list::iterator it; - for (it = trip.passBy.begin() ; it != trip.passBy.end() ; ++it) { - passBy.push_back(*it); + for (it = trip.myPassBy.begin(); it != trip.myPassBy.end(); ++it) { + myPassBy.push_back(*it); } - passBy.push_back(trip.to); + myPassBy.push_back(trip.myTo); } void AGTrip::addLayOverWithoutDestination(AGTrip& trip) { std::list::iterator it; - for (it = trip.passBy.begin() ; it != trip.passBy.end() ; ++it) { - passBy.push_back(*it); + for (it = trip.myPassBy.begin(); it != trip.myPassBy.end(); ++it) { + myPassBy.push_back(*it); } } std::list* AGTrip::getPassed() { - return &passBy; + return &myPassBy; } std::string AGTrip::getType() { - return type; + return myType; } void AGTrip::setType(std::string type) { - this->type = type; + myType = type; } AGPosition AGTrip::getDep() { - return from; + return myFrom; } AGPosition AGTrip::getArr() { - return to; + return myTo; } int AGTrip::getTime() { - return atTime; + return myDepTime; } int AGTrip::getTimeTrip(SUMOReal secPerKm) { SUMOReal dist = 0; std::list positions; - positions.push_back(from); + positions.push_back(myFrom); std::list::iterator it; - for (it = passBy.begin() ; it != passBy.end() ; ++it) { + for (it = myPassBy.begin(); it != myPassBy.end(); ++it) { positions.push_back(*it); } - positions.push_back(to); + positions.push_back(myTo); bool firstPass = true; AGPosition* temp; - for (it = positions.begin() ; it != positions.end() ; ++it) { + for (it = positions.begin(); it != positions.end(); ++it) { if (firstPass) { temp = &*it; continue; @@ -140,66 +140,57 @@ int AGTrip::getArrTime(SUMOReal secPerKm) { - int arrTime = atTime + getTimeTrip(secPerKm); - return arrTime; + return myDepTime + getTimeTrip(secPerKm); } int AGTrip::getRideBackArrTime(SUMOReal secPerKm) { - int arrAtTime = getArrTime(secPerKm); - int time = (int)(secPerKm * to.distanceTo(from) / 1000.0); - int arrTime = arrAtTime + time; - return arrTime; + return getArrTime(secPerKm) + (int)(secPerKm * myTo.distanceTo(myFrom) / 1000.0); } void AGTrip::setDepTime(int time) { - atTime = time; + myDepTime = time; } int AGTrip::estimateDepTime(int arrTime, SUMOReal secPerKm) { - int depTime = arrTime - getTimeTrip(secPerKm); - return depTime; + return arrTime - getTimeTrip(secPerKm); } std::string AGTrip::getVehicleName() { - return vehicle; + return myVehicle; } void AGTrip::setVehicleName(std::string name) { - vehicle = name; + myVehicle = name; } void AGTrip::setArr(AGPosition arrival) { - to = *new AGPosition(arrival.getStreet(), arrival.getPosition()); + myTo = *new AGPosition(arrival.getStreet(), arrival.getPosition()); } void AGTrip::setDep(AGPosition departure) { - from = *new AGPosition(departure.getStreet(), departure.getPosition()); + myFrom = *new AGPosition(departure.getStreet(), departure.getPosition()); } bool AGTrip::isDaily() { - if (day == 0) { - return true; - } else { - return false; - } + return (myDay == 0); } int AGTrip::getDay() { - return day; + return myDay; } void AGTrip::setDay(int d) { - day = d; + myDay = d; } /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGTrip.h sumo-0.16.0~dfsg/src/activitygen/activities/AGTrip.h --- sumo-0.15.0~dfsg/src/activitygen/activities/AGTrip.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGTrip.h 2012-09-25 22:01:41.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGTrip.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGTrip.h 12468 2012-07-03 19:15:42Z behrisch $ /// // Class containing all information of a given trip (car, bus) /****************************************************************************/ @@ -45,43 +45,40 @@ // =========================================================================== class AGTrip { public: - /*Trip() : - atTime(-1) - {};*/ AGTrip(AGPosition from, AGPosition to, int at) : //vehicle not specified - from(from), - to(to), - atTime(at), - type("default"), - day(0) {}; + myFrom(from), + myTo(to), + myDepTime(at), + myType("default"), + myDay(0) {}; AGTrip(AGPosition from, AGPosition to, AGCar c, int at) : - from(from), - to(to), - atTime(at), - vehicle(c.getName()), - type("default"), - day(0) {}; + myFrom(from), + myTo(to), + myDepTime(at), + myVehicle(c.getName()), + myType("default"), + myDay(0) {}; AGTrip(AGPosition from, AGPosition to, AGBus b, int at) : - from(from), - to(to), - atTime(at), - vehicle(b.getName()), - type("bus"), - day(0) {}; + myFrom(from), + myTo(to), + myDepTime(at), + myVehicle(b.getName()), + myType("bus"), + myDay(0) {}; AGTrip(AGPosition from, AGPosition to, std::string v, int at) : - from(from), - to(to), - atTime(at), - vehicle(v), - type("default"), - day(0) {}; + myFrom(from), + myTo(to), + myDepTime(at), + myVehicle(v), + myType("default"), + myDay(0) {}; AGTrip(AGPosition from, AGPosition to, std::string v, int at, int day) : - from(from), - to(to), - atTime(at), - vehicle(v), - type("default"), - day(day) {}; + myFrom(from), + myTo(to), + myDepTime(at), + myVehicle(v), + myType("default"), + myDay(day) {}; void print(); bool operator<(AGTrip& trip); @@ -131,21 +128,21 @@ bool isDaily(); private: - int atTime; - AGPosition from; - AGPosition to; - std::string vehicle; - std::list passBy; - /** - * if everyday : 0 - * else : number of the day ( != 0 ) - */ - int day; + AGPosition myFrom; + AGPosition myTo; + int myDepTime; + std::string myVehicle; /** * indicates if it is a bus or a car (or any type) * "bus", "default" or "random" (which is a kind of default) */ - std::string type; + std::string myType; + /** + * if everyday : 0 + * else : number of the day ( != 0 ) + */ + int myDay; + std::list myPassBy; }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/AGWorkAndSchool.cpp sumo-0.16.0~dfsg/src/activitygen/activities/AGWorkAndSchool.cpp --- sumo-0.15.0~dfsg/src/activitygen/activities/AGWorkAndSchool.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/AGWorkAndSchool.cpp 2012-09-25 22:01:41.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGWorkAndSchool.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGWorkAndSchool.cpp 12475 2012-07-04 14:21:22Z behrisch $ /// // Generates trips to work and to school /****************************************************************************/ @@ -49,13 +49,13 @@ buildWorkDestinations(); - if (hh->getCarNbr() < (int)personsDrivingCars.size()) { + if (myHousehold->getCarNbr() < (int)personsDrivingCars.size()) { return false; //to rebuild the household } - if (childrenNeedingCarAccompaniment.size() != 0 && hh->getCarNbr() == 0) { + if (childrenNeedingCarAccompaniment.size() != 0 && myHousehold->getCarNbr() == 0) { return false; //to rebuild the household } - if (adultNeedingCarAccompaniment.size() != 0 && hh->getCarNbr() == 0) { + if (adultNeedingCarAccompaniment.size() != 0 && myHousehold->getCarNbr() == 0) { return false; } @@ -76,10 +76,10 @@ void AGWorkAndSchool::buildChildrenAccompaniment() { - std::list::iterator itC; - for (itC = hh->children.begin() ; itC != hh->children.end() ; ++itC) { + std::list::const_iterator itC; + for (itC = myHousehold->getChildren().begin(); itC != myHousehold->getChildren().end(); ++itC) { if (itC->haveASchool()) { - if (this->availableTranspMeans(hh->getPosition(), itC->getSchoolLocation()) == 0) { + if (this->availableTranspMeans(myHousehold->getPosition(), itC->getSchoolLocation()) == 0) { //in this case the school is far from home and bus stations too this->childrenNeedingCarAccompaniment.push_back(*itC); } @@ -89,8 +89,8 @@ void AGWorkAndSchool::buildWorkDestinations() { - std::list::iterator itA; - for (itA = hh->adults.begin() ; itA != hh->adults.end() ; ++itA) { + std::list::const_iterator itA; + for (itA = myHousehold->getAdults().begin(); itA != myHousehold->getAdults().end(); ++itA) { if (itA->isWorking()) { if (this->possibleTranspMean(itA->getWorkPosition().getPosition()) % 2 == 0) { //not too close, to not being able to go by foot @@ -99,7 +99,7 @@ workingPeoplePossCar.push_back(*itA); } else if (this->possibleTranspMean(itA->getWorkPosition().getPosition()) == 4) { //only the car is possible (and there is one (use of possibleTranspMean)) - if (hh->getCarNbr() > (int)personsDrivingCars.size()) { + if (myHousehold->getCarNbr() > (int)personsDrivingCars.size()) { personsDrivingCars.push_back(*itA); } else { adultNeedingCarAccompaniment.push_back(*itA); @@ -111,10 +111,10 @@ // sometimes, people still have choice: when vehicles are available and their car take a bus. std::list::iterator it; - for (it = workingPeoplePossCar.begin() ; it != workingPeoplePossCar.end() ; ++it) { - if (possibleTranspMean(it->getWorkPosition().getPosition()) == 6 && hh->getCarNbr() > (int)personsDrivingCars.size()) { + for (it = workingPeoplePossCar.begin(); it != workingPeoplePossCar.end(); ++it) { + if (possibleTranspMean(it->getWorkPosition().getPosition()) == 6 && myHousehold->getCarNbr() > (int)personsDrivingCars.size()) { //car or bus (always because of workDestinations' construction) AND at least one car not used - if (hh->adults.front().decide(this->carPreference)) { + if (myHousehold->getAdults().front().decide(this->carPreference)) { personsDrivingCars.push_back(*it); } } @@ -137,9 +137,9 @@ } if (personsDrivingCars.empty() && ! childrenNeedingCarAccompaniment.empty()) { //at least one adult exists because no household contains less than one adult - if (workingPeoplePossCar.size() != hh->getAdultNbr()) { //personsDrivingCars.size() + adultNeedingCarAccompaniment.size() is equal to 0 - std::list::iterator itUA; - for (itUA = hh->adults.begin() ; itUA != hh->adults.end() ; ++itUA) { + if (workingPeoplePossCar.size() != myHousehold->getAdultNbr()) { //personsDrivingCars.size() + adultNeedingCarAccompaniment.size() is equal to 0 + std::list::const_iterator itUA; + for (itUA = myHousehold->getAdults().begin(); itUA != myHousehold->getAdults().end(); ++itUA) { if (! itUA->isWorking()) { notNeedingDrivers.push_back(*itUA); break; @@ -154,27 +154,27 @@ bool AGWorkAndSchool::carsToTrips() { - std::list::iterator itDriA; - std::list::iterator itCar = hh->cars.begin(); - for (itDriA = personsDrivingCars.begin() ; itDriA != personsDrivingCars.end() ; ++itDriA) { + std::list::const_iterator itDriA; + std::list::const_iterator itCar = myHousehold->getCars().begin(); + for (itDriA = personsDrivingCars.begin(); itDriA != personsDrivingCars.end(); ++itDriA) { //check if the number of cars is lower than the number of drivers - if (itCar == hh->cars.end()) { + if (itCar == myHousehold->getCars().end()) { return false; } - AGTrip trip(hh->getPosition(), itDriA->getWorkPosition().getPosition(), *itCar, depHour(hh->getPosition(), itDriA->getWorkPosition().getPosition(), itDriA->getWorkPosition().getOpening())); + AGTrip trip(myHousehold->getPosition(), itDriA->getWorkPosition().getPosition(), *itCar, depHour(myHousehold->getPosition(), itDriA->getWorkPosition().getPosition(), itDriA->getWorkPosition().getOpening())); ++itCar; tempTrip.push_back(trip); } std::list::iterator itAccA; - for (itAccA = adultNeedingCarAccompaniment.begin() ; itAccA != adultNeedingCarAccompaniment.end() ; ++itAccA) { - AGTrip trip(hh->getPosition(), itAccA->getWorkPosition().getPosition(), depHour(hh->getPosition(), itAccA->getWorkPosition().getPosition(), itAccA->getWorkPosition().getOpening())); + for (itAccA = adultNeedingCarAccompaniment.begin(); itAccA != adultNeedingCarAccompaniment.end(); ++itAccA) { + AGTrip trip(myHousehold->getPosition(), itAccA->getWorkPosition().getPosition(), depHour(myHousehold->getPosition(), itAccA->getWorkPosition().getPosition(), itAccA->getWorkPosition().getOpening())); tempAccTrip.push_back(trip); } std::list::iterator itAccC; - for (itAccC = childrenNeedingCarAccompaniment.begin() ; itAccC != childrenNeedingCarAccompaniment.end() ; ++itAccC) { - AGTrip trip(hh->getPosition(), itAccC->getSchoolLocation(), depHour(hh->getPosition(), itAccC->getSchoolLocation(), itAccC->getSchoolOpeining())); + for (itAccC = childrenNeedingCarAccompaniment.begin(); itAccC != childrenNeedingCarAccompaniment.end(); ++itAccC) { + AGTrip trip(myHousehold->getPosition(), itAccC->getSchoolLocation(), depHour(myHousehold->getPosition(), itAccC->getSchoolLocation(), itAccC->getSchoolOpening())); tempAccTrip.push_back(trip); } @@ -189,7 +189,7 @@ bool AGWorkAndSchool::isThereUnusedCar() { - return (hh->getCarNbr() > static_cast(notNeedingDrivers.size() + personsDrivingCars.size())); + return (myHousehold->getCarNbr() > static_cast(notNeedingDrivers.size() + personsDrivingCars.size())); } bool @@ -201,8 +201,8 @@ while (!finish) { finish = true; - for (it1 = tempAccTrip.begin() ; it1 != tempAccTrip.end() ; ++it1) { - for (it2 = tempAccTrip.begin() ; it2 != tempAccTrip.end() ; ++it2) { + for (it1 = tempAccTrip.begin(); it1 != tempAccTrip.end(); ++it1) { + for (it2 = tempAccTrip.begin(); it2 != tempAccTrip.end(); ++it2) { if (it1 == it2) { continue; } @@ -239,13 +239,13 @@ std::list::iterator itAccT; std::list::iterator itDriT; std::list::iterator itA; - for (itAccT = tempAccTrip.begin() ; itAccT != tempAccTrip.end() ; ++itAccT) { - for (itDriT = tempTrip.begin() ; itDriT != tempTrip.end() ; ++itDriT) { + for (itAccT = tempAccTrip.begin(); itAccT != tempAccTrip.end(); ++itAccT) { + for (itDriT = tempTrip.begin(); itDriT != tempTrip.end(); ++itDriT) { if (itAccT->getArrTime(this->timePerKm) < itDriT->getArrTime(this->timePerKm)) { check = true; } } - for (itA = notNeedingDrivers.begin() ; itA != notNeedingDrivers.end() ; ++itA) { + for (itA = notNeedingDrivers.begin(); itA != notNeedingDrivers.end(); ++itA) { if (!itA->isWorking()) { check = true; } else if (itAccT->getRideBackArrTime(this->timePerKm) < itA->getWorkPosition().getOpening()) { @@ -271,9 +271,9 @@ /** * 1 / 3 : Accompaniment */ - for (itAccT = tempAccTrip.begin() ; itAccT != tempAccTrip.end() ; ++itAccT) { + for (itAccT = tempAccTrip.begin(); itAccT != tempAccTrip.end(); ++itAccT) { alreadyDone = false; - for (itDriT = tempTrip.begin() ; itDriT != tempTrip.end() ; ++itDriT) { + for (itDriT = tempTrip.begin(); itDriT != tempTrip.end(); ++itDriT) { if (!alreadyDone) { if (itAccT->getArrTime(this->timePerKm) < itDriT->getArrTime(this->timePerKm) && !alreadyDone) { //Add the accompaniment trip to the driver's trip OR new trip @@ -281,8 +281,8 @@ //there is enough time to accompany people and go back home before going to work itAccT->setVehicleName(itDriT->getVehicleName()); itAccT->addLayOver(itAccT->getArr()); //final destination is the last accompaniment stop: not the destination of the course - itAccT->setArr(hh->getPosition()); //final destination of the whole trip: home - partialActivityTrips.push_back(*itAccT); + itAccT->setArr(myHousehold->getPosition()); //final destination of the whole trip: home + myPartialActivityTrips.push_back(*itAccT); alreadyDone = true; } else { //the driver drives people to their working place or school and goes directly to work after that @@ -297,14 +297,14 @@ } } - for (itA = notNeedingDrivers.begin() ; itA != notNeedingDrivers.end() ; ++itA) { + for (itA = notNeedingDrivers.begin(); itA != notNeedingDrivers.end(); ++itA) { if (!itA->isWorking() && !alreadyDone) { std::string nameC = getUnusedCar(); if (nameC.size() != 0) { itAccT->setVehicleName(getUnusedCar()); itAccT->addLayOver(itAccT->getArr()); - itAccT->setArr(hh->getPosition()); - partialActivityTrips.push_back(*itAccT); + itAccT->setArr(myHousehold->getPosition()); + myPartialActivityTrips.push_back(*itAccT); alreadyDone = true; } } else if (itAccT->getRideBackArrTime(this->timePerKm) < itA->getWorkPosition().getOpening() && !alreadyDone) { @@ -312,8 +312,8 @@ if (nameC.size() != 0) { itAccT->setVehicleName(getUnusedCar()); itAccT->addLayOver(itAccT->getArr()); - itAccT->setArr(hh->getPosition()); - partialActivityTrips.push_back(*itAccT); + itAccT->setArr(myHousehold->getPosition()); + myPartialActivityTrips.push_back(*itAccT); alreadyDone = true; } } @@ -323,18 +323,18 @@ /** * 2/3 : drivers way */ - for (itDriT = tempTrip.begin() ; itDriT != tempTrip.end() ; ++itDriT) { - partialActivityTrips.push_back(*itDriT); + for (itDriT = tempTrip.begin(); itDriT != tempTrip.end(); ++itDriT) { + myPartialActivityTrips.push_back(*itDriT); } /** * 3/3: way return */ - for (itA = personsDrivingCars.begin() ; itA != personsDrivingCars.end() ; ++itA) { - for (itDriT = tempTrip.begin() ; itDriT != tempTrip.end() ; ++itDriT) { + for (itA = personsDrivingCars.begin(); itA != personsDrivingCars.end(); ++itA) { + for (itDriT = tempTrip.begin(); itDriT != tempTrip.end(); ++itDriT) { if (itA->getWorkPosition().getPosition() == itDriT->getArr()) { - AGTrip trip(itA->getWorkPosition().getPosition(), hh->getPosition(), itDriT->getVehicleName(), itA->getWorkPosition().getClosing()); - partialActivityTrips.push_back(trip); + AGTrip trip(itA->getWorkPosition().getPosition(), myHousehold->getPosition(), itDriT->getVehicleName(), itA->getWorkPosition().getClosing()); + myPartialActivityTrips.push_back(trip); tempTrip.erase(itDriT); break; } @@ -349,15 +349,15 @@ //only two cars can be used in the household, so: the first one or the last one is not used. if (!tempTrip.empty()) { nameCarUsed = tempTrip.front().getVehicleName(); - } else if (!partialActivityTrips.empty()) { - nameCarUsed = partialActivityTrips.front().getVehicleName(); + } else if (!myPartialActivityTrips.empty()) { + nameCarUsed = myPartialActivityTrips.front().getVehicleName(); } if (nameCarUsed.size() != 0) { - if (hh->cars.front().getName() == nameCarUsed) { - nameCar = hh->cars.back().getName(); + if (myHousehold->getCars().front().getName() == nameCarUsed) { + nameCar = myHousehold->getCars().back().getName(); } else { - nameCar = hh->cars.front().getName(); + nameCar = myHousehold->getCars().front().getName(); } } return nameCar; @@ -366,9 +366,9 @@ void AGWorkAndSchool::makePossibleDriversDrive() { //give to a non working adult the ability to drive children or someone else. - if (workingPeoplePossCar.size() + personsDrivingCars.size() + adultNeedingCarAccompaniment.size() != hh->getAdultNbr()) { - std::list::iterator itUA; - for (itUA = hh->adults.begin() ; itUA != hh->adults.end() ; ++itUA) { + if (workingPeoplePossCar.size() + personsDrivingCars.size() + adultNeedingCarAccompaniment.size() != myHousehold->getAdultNbr()) { + std::list::const_iterator itUA; + for (itUA = myHousehold->getAdults().begin(); itUA != myHousehold->getAdults().end(); ++itUA) { if (! itUA->isWorking()) { notNeedingDrivers.push_back(*itUA); break; diff -Nru sumo-0.15.0~dfsg/src/activitygen/activities/Makefile.in sumo-0.16.0~dfsg/src/activitygen/activities/Makefile.in --- sumo-0.15.0~dfsg/src/activitygen/activities/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activities/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/activitygen/activitygen_main.cpp sumo-0.16.0~dfsg/src/activitygen/activitygen_main.cpp --- sumo-0.15.0~dfsg/src/activitygen/activitygen_main.cpp 2012-02-18 00:03:44.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/activitygen_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jul 2010 -/// @version $Id: activitygen_main.cpp 11927 2012-02-17 10:03:39Z namdre $ +/// @version $Id: activitygen_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main object of the ActivityGen application /****************************************************************************/ @@ -98,16 +98,16 @@ RONet* net = 0; try { // Initialise subsystems and process options - XMLSubSys::init(false); + XMLSubSys::init(); AGFrame::fillOptions(); OptionsIO::getOptions(true, argc, argv); - MsgHandler::initOutputOptions(); - RandHelper::initRandGlobal(); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); + MsgHandler::initOutputOptions(); + RandHelper::initRandGlobal(); // Load network net = new RONet(); @@ -140,19 +140,24 @@ WRITE_MESSAGE("\n\t ---- end of ActivityGen ----\n"); } ret = 0; - } catch (ProcessError& pe) { - if (std::string(pe.what()) != std::string("Process Error") && std::string(pe.what()) != std::string("")) { - WRITE_ERROR(pe.what()); + } catch (const ProcessError& e) { + if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } - OutputDevice::closeAll(); SystemFrame::close(); if (ret == 0) { std::cout << "Success." << std::endl; diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGAdult.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGAdult.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGAdult.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGAdult.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date July 2010 -/// @version $Id: AGAdult.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGAdult.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Person in working age: can be linked to a work position. /****************************************************************************/ @@ -42,7 +42,7 @@ // method definitions // =========================================================================== AGWorkPosition* -AGAdult::randomFreeWorkPosition(std::vector *wps) { +AGAdult::randomFreeWorkPosition(std::vector* wps) { size_t wpsIndex = 0; // TODO: Could end up in an endless loop diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGAdult.h sumo-0.16.0~dfsg/src/activitygen/city/AGAdult.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGAdult.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGAdult.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date July 2010 -/// @version $Id: AGAdult.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGAdult.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Person in working age: can be linked to a work position. /****************************************************************************/ @@ -60,17 +60,17 @@ * * @param[in] the age of the AGPerson */ - AGAdult(int age) ; + AGAdult(int age); /** @brief Puts out a summary of the attributes. */ - void print() const ; + void print() const; /** @brief States whether this person occupies a work position at present. * * @return true if she has a work position */ - bool isWorking() const ; + bool isWorking() const; /** @brief Tries to get a new work position. * @@ -84,7 +84,7 @@ * @param[in]: employmentRate (1 - unemploymentRate) * @param[in]: wps the list of work positions (open or not) in the city */ - void tryToWork(SUMOReal employmentRate, std::vector* wps) ; + void tryToWork(SUMOReal employmentRate, std::vector* wps); /** @brief Called when the adult has lost her job. * @@ -92,14 +92,14 @@ * her job, be it because it got fired or because its resignation has * been accepted. */ - void lostWorkPosition() ; + void lostWorkPosition(); /** @brief Called when the adult should resign her job. * * This method asks the WorkPosition to quit the job. The WorkPosition in * turn calls AGAdult::lostWorkPosition. */ - void resignFromWorkPosition() ; + void resignFromWorkPosition(); /** @brief Provides the work position of the adult. * @@ -123,7 +123,7 @@ * @param[in] the list of work positions (free or not) * @return the chosen free work position */ - static AGWorkPosition* randomFreeWorkPosition(std::vector* wps) ; + static AGWorkPosition* randomFreeWorkPosition(std::vector* wps); }; #endif /* AGADULT_H */ diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGBusLine.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGBusLine.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGBusLine.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGBusLine.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGBusLine.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGBusLine.cpp 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Bus line of the city: contains all the buses of this line /****************************************************************************/ @@ -164,11 +164,11 @@ std::list::iterator it; std::cout << "\n ----------- BUS LINE " << lineNumber << " PRINTING -------------\n" << std::endl; std::cout << "\n -------------------------- First way ---------------------------\n" << std::endl; - for (it = buses.begin() ; it != buses.end() ; ++it) { + for (it = buses.begin(); it != buses.end(); ++it) { it->print(); } std::cout << "\n -------------------------- Second way --------------------------\n" << std::endl; - for (it = revBuses.begin() ; it != revBuses.end() ; ++it) { + for (it = revBuses.begin(); it != revBuses.end(); ++it) { it->print(); } std::cout << "\n ----------------------------------------------------------------\n" << std::endl; diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGCar.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGCar.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGCar.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGCar.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGCar.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGCar.cpp 12475 2012-07-04 14:21:22Z behrisch $ /// // Cars owned by people of the city: included in households. /****************************************************************************/ @@ -59,12 +59,12 @@ } bool -AGCar::isAssociated() { +AGCar::isAssociated() const { return (currentUser != NULL); } std::string -AGCar::getName() { +AGCar::getName() const { return idName; } diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGCar.h sumo-0.16.0~dfsg/src/activitygen/city/AGCar.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGCar.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGCar.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGCar.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGCar.h 12475 2012-07-04 14:21:22Z behrisch $ /// // Cars owned by people of the city: included in households. /****************************************************************************/ @@ -49,8 +49,8 @@ AGCar(int idHH, int idCar) : idName(createName(idHH, idCar)) {}; bool associateTo(AGAdult* pers); - bool isAssociated(); - std::string getName(); + bool isAssociated() const; + std::string getName() const; private: std::string createName(int idHH, int idCar); diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGChild.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGChild.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGChild.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGChild.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGChild.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGChild.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Person in age to go to school: linked to a school object /****************************************************************************/ @@ -61,7 +61,7 @@ } bool -AGChild::alocateASchool(std::list *schools, AGPosition housePos) { +AGChild::allocateASchool(std::list* schools, AGPosition housePos) { SUMOReal minDist = std::numeric_limits::infinity(); AGSchool* sch = NULL; if (schools->size() == 0) { @@ -69,7 +69,7 @@ } std::list::iterator it; - for (it = schools->begin() ; it != schools->end() ; ++it) { + for (it = schools->begin(); it != schools->end(); ++it) { if (it->acceptThisAge(age) && it->getPlaces() > 0 && housePos.distanceTo(it->getPosition()) < minDist) { minDist = housePos.distanceTo(it->getPosition()); sch = &(*it); @@ -89,25 +89,22 @@ } bool -AGChild::haveASchool() { - if (school == NULL) { - return false; - } - return true; +AGChild::haveASchool() const { + return (school != NULL); } AGPosition -AGChild::getSchoolLocation() { +AGChild::getSchoolLocation() const { return school->getPosition(); } int -AGChild::getSchoolClosing() { +AGChild::getSchoolClosing() const { return school->getClosingHour(); } int -AGChild::getSchoolOpeining() { +AGChild::getSchoolOpening() const { return school->getOpeningHour(); } diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGChild.h sumo-0.16.0~dfsg/src/activitygen/city/AGChild.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGChild.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGChild.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGChild.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGChild.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Person in age to go to school: linked to a school object /****************************************************************************/ @@ -56,15 +56,15 @@ * @param housepos: Position of the households habitation * @return if a school was found corresponding to the child's age. */ - bool alocateASchool(std::list *schools, AGPosition housePos); + bool allocateASchool(std::list* schools, AGPosition housePos); /** * @return if the child is now without any school */ bool leaveSchool(); - bool haveASchool(); - AGPosition getSchoolLocation(); - int getSchoolOpeining(); - int getSchoolClosing(); + bool haveASchool() const; + AGPosition getSchoolLocation() const; + int getSchoolOpening() const; + int getSchoolClosing() const; private: AGSchool* school; diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGCity.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGCity.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGCity.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGCity.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGCity.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGCity.cpp 12491 2012-07-20 07:14:51Z namdre $ /// // City class that contains all other objects of the city: in particular // streets, households, bus lines, work positions and school @@ -59,29 +59,27 @@ streetsCompleted = true; } - NrStreets = 0; - int pop = 0, work = 0; + SUMOReal pop = 0, work = 0; std::vector::iterator it; - for (it = streets.begin() ; it != streets.end() ; ++it) { - pop += (int)(it->getPopulation()); - work += (int)(it->getWorkplaceNumber()); - ++NrStreets; + for (it = streets.begin(); it != streets.end(); ++it) { + pop += it->getPopulation(); + work += it->getWorkplaceNumber(); } - statData.factorInhabitants = (float)statData.inhabitants / (float)pop; + statData.factorInhabitants = (SUMOReal)statData.inhabitants / pop; //can be improved with other input data SUMOReal neededWorkPositionsInCity = (1.0 - statData.unemployement) - * ((float)statData.getPeopleYoungerThan(statData.limitAgeRetirement) - - (float)statData.getPeopleYoungerThan(statData.limitAgeChildren)) - + (float)statData.incomingTraffic; + * ((SUMOReal)statData.getPeopleYoungerThan(statData.limitAgeRetirement) + - (SUMOReal)statData.getPeopleYoungerThan(statData.limitAgeChildren)) + + (SUMOReal)statData.incomingTraffic; // we generate 5% more work positions that really needed: to avoid any expensive research of random work positions - neededWorkPositionsInCity *= 1.05f; + neededWorkPositionsInCity *= SUMOReal(1.05); statData.workPositions = (int)neededWorkPositionsInCity; - statData.factorWorkPositions = neededWorkPositionsInCity / (float) work; + statData.factorWorkPositions = neededWorkPositionsInCity / (SUMOReal) work; - for (it = streets.begin() ; it != streets.end() ; ++it) { - it->setPopulation((int)(it->getPopulation() * statData.factorInhabitants)); - it->setWorkplaceNumber((int)(it->getWorkplaceNumber() * statData.factorWorkPositions)); + for (it = streets.begin(); it != streets.end(); ++it) { + it->setPopulation(it->getPopulation() * statData.factorInhabitants); + it->setWorkplaceNumber(it->getWorkplaceNumber() * statData.factorWorkPositions); //it->print(); } @@ -89,8 +87,8 @@ std::map::const_iterator itE; std::vector::iterator itS; - for (itE = net->getEdgeMap().begin() ; itE != net->getEdgeMap().end() ; ++itE) { - for (itS = streets.begin() ; itS != streets.end() ; ++itS) { + for (itE = net->getEdgeMap().begin(); itE != net->getEdgeMap().end(); ++itE) { + for (itS = streets.begin(); itS != streets.end(); ++itS) { if (itS->getName() == itE->second->getID()) { break; } @@ -108,10 +106,10 @@ int workPositionCounter = 0; try { - for (it = streets.begin() ; it != streets.end() ; ++it) { + for (it = streets.begin(); it != streets.end(); ++it) { //std::cout << "number of work positions in street: " << it->getWorkplaceNumber() << std::endl; - for (int i = 0 ; i < it->getWorkplaceNumber() ; ++i) { - workPositions.push_back(AGWorkPosition(*it, &statData)); + for (int i = 0; i < it->getWorkplaceNumber(); ++i) { + workPositions.push_back(AGWorkPosition(&statData, *it)); ++workPositionCounter; } } @@ -140,15 +138,15 @@ /** * N_out = N_in * (ProportionOut / (1 - ProportionOut)) = N_out = N_in * (Noutworkers / (Nworkers - Noutworkers)) */ - int nbrOutWorkPositions = static_cast(workPositions.size() * (static_cast(statData.outgoingTraffic)) / (nbrWorkers - static_cast(statData.outgoingTraffic))); + int nbrOutWorkPositions = static_cast(workPositions.size() * (static_cast(statData.outgoingTraffic)) / (nbrWorkers - static_cast(statData.outgoingTraffic))); if (cityGates.empty()) { return; } - for (int i = 0 ; i < nbrOutWorkPositions ; ++i) { + for (int i = 0; i < nbrOutWorkPositions; ++i) { int posi = statData.getRandomCityGateByOutgoing(); - workPositions.push_back(AGWorkPosition(cityGates[posi].getStreet(), cityGates[posi].getPosition(), &statData)); + workPositions.push_back(AGWorkPosition(&statData, cityGates[posi].getStreet(), cityGates[posi].getPosition())); } //cout << "outgoing traffic: " << statData.outgoingTraffic << std::endl; //cout << "total number of workers in the city: " << nbrWorkers << std::endl; @@ -160,7 +158,7 @@ void AGCity::completeBusLines() { std::list::iterator it; - for (it = busLines.begin() ; it != busLines.end() ; ++it) { + for (it = busLines.begin(); it != busLines.end(); ++it) { //it->generateOpositDirection(); it->setBusNames(); } @@ -169,18 +167,39 @@ void AGCity::generatePopulation() { std::vector::iterator it; - int people; + SUMOReal people = 0; nbrCars = 0; - int idHouseholds = 0; - - for (it = streets.begin() ; it != streets.end() ; ++it) { - people = it->getPopulation(); - while (people > 0) { + unsigned int idHouseholds = 0; + std::vector numAdults(statData.households); + std::vector numChilds(statData.households); + int totalChildrenLeft = statData.inhabitants - statData.getPeopleOlderThan(statData.limitAgeChildren); + const SUMOReal retiredProb = statData.getPeopleOlderThan(statData.limitAgeRetirement) / statData.getPeopleOlderThan(statData.limitAgeChildren); + for (int i = 0; i < statData.households; i++) { + numAdults[i] = 1; + numChilds[i] = 0; + if (RandHelper::rand() < retiredProb) { + numAdults[i] = -numAdults[i]; + } else if (totalChildrenLeft > 0) { + numChilds[i] = statData.getPoissonsNumberOfChildren(statData.meanNbrChildren); + totalChildrenLeft -= numChilds[i]; + } + } + //compensate with adults for too many / missing children + const int numSecondPers = statData.getPeopleOlderThan(statData.limitAgeChildren) - statData.households + totalChildrenLeft; + for (int i = 0; i < numSecondPers; i++) { + numAdults[i] *= 2; + } + for (it = streets.begin(); it != streets.end(); ++it) { + people += it->getPopulation(); + while (people > 0 && idHouseholds < (unsigned int)numAdults.size()) { + size_t i = RandHelper::rand(numAdults.size() - idHouseholds); ++idHouseholds; households.push_back(AGHousehold(&*it, this, idHouseholds)); - households.back().generatePeople(); //&statData + households.back().generatePeople(abs(numAdults[i]), numChilds[i], numAdults[i] < 0); //&statData //households.back().generateCars(statData.carRate); people -= households.back().getPeopleNbr(); + numAdults[i] = numAdults[numAdults.size() - idHouseholds]; + numChilds[i] = numChilds[numAdults.size() - idHouseholds]; } } @@ -194,19 +213,19 @@ int nbrHH = 0; int workingP = 0; std::list::iterator itt; - for (itt = households.begin() ; itt != households.end() ; ++itt) { + for (itt = households.begin(); itt != households.end(); ++itt) { if (itt->getAdultNbr() == 1) { nbrSingle++; - if (itt->adults.front().isWorking()) { + if (itt->getAdults().front().isWorking()) { workingP++; } } if (itt->getAdultNbr() == 2) { nbrCouple += 2; - if (itt->adults.front().isWorking()) { + if (itt->getAdults().front().isWorking()) { workingP++; } - if (itt->adults.back().isWorking()) { + if (itt->getAdults().back().isWorking()) { workingP++; } } @@ -236,7 +255,7 @@ void AGCity::generateIncomingPopulation() { - for (int i = 0 ; i < statData.incomingTraffic ; ++i) { + for (int i = 0; i < statData.incomingTraffic; ++i) { AGAdult ad(statData.getRandomPopDistributed(statData.limitAgeChildren, statData.limitAgeRetirement)); peopleIncoming.push_back(ad); } @@ -246,7 +265,7 @@ AGCity::schoolAllocation() { std::list::iterator it; bool shortage; - for (it = households.begin() ; it != households.end() ; ++it) { + for (it = households.begin(); it != households.end(); ++it) { shortage = !it->allocateChildrenSchool(); if (shortage) { /*ofstream fichier("test.txt", ios::app); // ouverture en écriture avec effacement du fichier ouvert @@ -273,7 +292,7 @@ std::list::iterator it; bool shortage; - for (it = households.begin() ; it != households.end() ; ++it) { + for (it = households.begin(); it != households.end(); ++it) { if (it->retiredHouseholders()) { continue; } @@ -288,7 +307,7 @@ * people from outside */ std::list::iterator itA; - for (itA = peopleIncoming.begin() ; itA != peopleIncoming.end() ; ++itA) { + for (itA = peopleIncoming.begin(); itA != peopleIncoming.end(); ++itA) { if (statData.workPositions > 0) { itA->tryToWork(1, &workPositions); } else { @@ -300,17 +319,17 @@ //BEGIN TESTS int workingP = 0; std::list::iterator itt; - for (itt = households.begin() ; itt != households.end() ; ++itt) { + for (itt = households.begin(); itt != households.end(); ++itt) { if (itt->getAdultNbr() == 1) { - if (itt->adults.front().isWorking()) { + if (itt->getAdults().front().isWorking()) { workingP++; } } if (itt->getAdultNbr() == 2) { - if (itt->adults.front().isWorking()) { + if (itt->getAdults().front().isWorking()) { workingP++; } - if (itt->adults.back().isWorking()) { + if (itt->getAdults().back().isWorking()) { workingP++; } } @@ -326,7 +345,7 @@ statData.hhFarFromPT = 0; nbrCars = 0; std::list::iterator it; - for (it = households.begin() ; it != households.end() ; ++it) { + for (it = households.begin(); it != households.end(); ++it) { if (!it->isCloseFromPubTransport(&(statData.busStations))) { statData.hhFarFromPT++; nbrCars++; @@ -344,7 +363,7 @@ nbrCars = 0; int nbrAdults = 0; - for (it = households.begin() ; it != households.end() ; ++it) { + for (it = households.begin(); it != households.end(); ++it) { it->generateCars(newRate); nbrCars += it->getCarNbr(); nbrAdults += it->getAdultNbr(); @@ -356,7 +375,7 @@ //std::cout << "number of people far from public transport: " << statData.hhFarFromPT << std::endl; //std::cout << "original rate: " << setprecision(4) << statData.carRate << std::endl; //std::cout << "new rate: " << setprecision(4) << newRate << std::endl; - //std::cout << "real rate: " << setprecision(4) << (float)nbrCars / (float)statData.getPeopleOlderThan(statData.limitAgeChildren) << std::endl; + //std::cout << "real rate: " << setprecision(4) << (SUMOReal)nbrCars / (SUMOReal)statData.getPeopleOlderThan(statData.limitAgeChildren) << std::endl; //END TEST RESULTS } diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGCity.h sumo-0.16.0~dfsg/src/activitygen/city/AGCity.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGCity.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGCity.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGCity.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGCity.h 12468 2012-07-03 19:15:42Z behrisch $ /// // City class that contains all other objects of the city: in particular // streets, households, bus lines, work positions and schools @@ -112,8 +112,11 @@ */ bool streetsCompleted; - int NrStreets; int nbrCars; + +private: + /// @brief invalidated assignment operator + AGCity& operator=(const AGCity&); }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGDataAndStatistics.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGDataAndStatistics.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGDataAndStatistics.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGDataAndStatistics.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGDataAndStatistics.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGDataAndStatistics.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Contains various data, statistical values and functions from input used // by various objects @@ -68,18 +68,8 @@ if (m > limitEndAge) { m = limitEndAge; } - SUMOReal alea = RandHelper::rand(); - SUMOReal beginProp = getPropYoungerThan(n); - SUMOReal total = getPropYoungerThan(m) - beginProp; - if (total <= 0) { - return -1; - } - /** - * alea = alea * total + beginProp =====> easier test - * than: alea < (getPropYoungerThan(a+1)-beginProp)/total - */ - alea = alea * total + beginProp; - for (int a = n ; a < m ; ++a) { + const SUMOReal alea = RandHelper::rand(getPropYoungerThan(n), getPropYoungerThan(m)); + for (int a = n; a < m; ++a) { if (alea < getPropYoungerThan(a + 1)) { return a; } @@ -91,7 +81,7 @@ AGDataAndStatistics::getPoissonsNumberOfChildren(SUMOReal mean) { SUMOReal alea = RandHelper::rand(); SUMOReal cumul = 0; - for (int nbr = 0 ; nbr < LIMIT_CHILDREN_NUMBER ; ++nbr) { + for (int nbr = 0; nbr < LIMIT_CHILDREN_NUMBER; ++nbr) { cumul += poisson(mean, nbr); if (cumul > alea) { return nbr; @@ -102,10 +92,7 @@ SUMOReal AGDataAndStatistics::poisson(SUMOReal mean, int occ) { - SUMOReal proba = exp(-mean); - proba *= pow(mean, occ); - proba /= (SUMOReal)factorial(occ); - return proba; + return exp(-mean) * pow(mean, occ) / (SUMOReal)factorial(occ); } int @@ -140,7 +127,7 @@ int previousAge = 0; SUMOReal prop = 0; - for (it = population.begin() ; it != population.end() ; ++it) { + for (it = population.begin(); it != population.end(); ++it) { if (it->first < age) { sum += it->second; } else if (it->first >= age && previousAge < age) { @@ -155,7 +142,7 @@ int AGDataAndStatistics::getPeopleYoungerThan(int age) { - return (int)((SUMOReal)inhabitants * getPropYoungerThan(age)); + return (int)((SUMOReal)inhabitants * getPropYoungerThan(age) + .5); } int @@ -164,16 +151,16 @@ } void -AGDataAndStatistics::normalizeMapProb(std::map *myMap) { +AGDataAndStatistics::normalizeMapProb(std::map* myMap) { SUMOReal sum = 0; std::map::iterator it; - for (it = myMap->begin() ; it != myMap->end() ; ++it) { + for (it = myMap->begin(); it != myMap->end(); ++it) { sum += it->second; } if (sum == 0) { return; } - for (it = myMap->begin() ; it != myMap->end() ; ++it) { + for (it = myMap->begin(); it != myMap->end(); ++it) { it->second = it->second / sum; } } @@ -187,7 +174,7 @@ //we have to scale the distribution because maxVar is different from INF SUMOReal scale = exp((-1) * maxVar); //new p: scaled - p = p * (1 - scale) + scale; // p = [scale ; 1) ==> (1-p) = (0 ; 1-scale] + p = p * (1 - scale) + scale; // p = [scale; 1) ==> (1-p) = (0; 1-scale] SUMOReal variation = (-1) * log(p); //decide the side of the mean value @@ -204,7 +191,7 @@ SUMOReal alea = RandHelper::rand(); SUMOReal total = 0; std::map::iterator it; - for (it = incoming.begin() ; it != incoming.end() ; ++it) { + for (it = incoming.begin(); it != incoming.end(); ++it) { total += it->second; if (alea < total) { return it->first; @@ -219,7 +206,7 @@ SUMOReal alea = RandHelper::rand(); SUMOReal total = 0; std::map::iterator it; - for (it = outgoing.begin() ; it != outgoing.end() ; ++it) { + for (it = outgoing.begin(); it != outgoing.end(); ++it) { total += it->second; if (alea < total) { return it->first; diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGDataAndStatistics.h sumo-0.16.0~dfsg/src/activitygen/city/AGDataAndStatistics.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGDataAndStatistics.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGDataAndStatistics.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGDataAndStatistics.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGDataAndStatistics.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Contains various data, statistical values and functions from input used // by various objects @@ -111,7 +111,7 @@ //households far from public transports int hhFarFromPT; - static AGDataAndStatistics& getDataAndStatistics() ; + static AGDataAndStatistics& getDataAndStatistics(); /** * function returning a random number between the two given numbers: [n;m[ (m cannot occur) @@ -136,7 +136,7 @@ int getPoissonsNumberOfChildren(SUMOReal mean); /** * these functions return the number of people having more (or less) than the given age - * (inclusive for getPeopleOlderThan ; exclusive for getPeopleYoungerThan) + * (inclusive for getPeopleOlderThan; exclusive for getPeopleYoungerThan) * getPeopleOlderThan(n) + getPeopleYoungerThan(n) = inhabitants * these first two function are based on the third one. */ @@ -183,7 +183,7 @@ int factorial(int n); //function normalizing the map's probabilities: Sum(floats) = 1 - void normalizeMapProb(std::map *myMap); + void normalizeMapProb(std::map* myMap); }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGHousehold.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGHousehold.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGHousehold.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGHousehold.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGHousehold.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGHousehold.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A household contains the people and cars of the city: roughly represents // families with their address, cars, adults and possibly children @@ -43,39 +43,36 @@ // method definitions // =========================================================================== void -AGHousehold::generatePeople() { +AGHousehold::generatePeople(int numAdults, int numChilds, bool firstRetired) { AGDataAndStatistics* ds = &(myCity->statData); //the first adult AGAdult pers(ds->getRandomPopDistributed(ds->limitAgeChildren, ds->limitEndAge)); - adults.push_back(pers); - - //the second adult - if (decisionProba(ds->secondPersProb)) { - if (pers.getAge() < ds->limitAgeRetirement) { - AGAdult pers2(ds->getRandomPopDistributed(ds->limitAgeChildren, ds->limitAgeRetirement)); - adults.push_back(pers2); - } else { + if (firstRetired) { + pers = AGAdult(ds->getRandomPopDistributed(ds->limitAgeRetirement, ds->limitEndAge)); + } + myAdults.push_back(pers); + //further adults + while (static_cast(myAdults.size()) < numAdults) { + if (firstRetired) { AGAdult pers2(ds->getRandomPopDistributed(ds->limitAgeRetirement, ds->limitEndAge)); - adults.push_back(pers2); + myAdults.push_back(pers2); + } else { + AGAdult pers2(ds->getRandomPopDistributed(ds->limitAgeChildren, ds->limitAgeRetirement)); + myAdults.push_back(pers2); } } - //Children - if (pers.getAge() < ds->limitAgeRetirement) { - int numChild = ds->getPoissonsNumberOfChildren(ds->meanNbrChildren); - while (numChild > 0) { - AGChild chl(ds->getRandomPopDistributed(0, ds->limitAgeChildren)); - children.push_back(chl); - --numChild; - } + while (static_cast(myChildren.size()) < numChilds) { + AGChild chl(ds->getRandomPopDistributed(0, ds->limitAgeChildren)); + myChildren.push_back(chl); } } void AGHousehold::generateCars(SUMOReal rate) { - int peopleInNeed = static_cast(adults.size()) - static_cast(cars.size()); + int peopleInNeed = static_cast(myAdults.size()) - static_cast(myCars.size()); while (peopleInNeed > 0) { - if (decisionProba(rate)) { + if (RandHelper::rand() < rate) { addACar(); } --peopleInNeed; @@ -84,28 +81,43 @@ void AGHousehold::addACar() { - int numCar = static_cast(cars.size() + 1); - cars.push_back(AGCar(idHH, numCar)); + int numCar = static_cast(myCars.size() + 1); + myCars.push_back(AGCar(myId, numCar)); } int AGHousehold::getCarNbr() { - return static_cast(cars.size()); + return static_cast(myCars.size()); } -int +unsigned int AGHousehold::getPeopleNbr() { - return static_cast(adults.size() + children.size()); + return static_cast(myAdults.size() + myChildren.size()); } -int +unsigned int AGHousehold::getAdultNbr() { - return static_cast(adults.size()); + return static_cast(myAdults.size()); +} + +const std::list& +AGHousehold::getAdults() const { + return myAdults; +} + +const std::list& +AGHousehold::getChildren() const { + return myChildren; +} + +const std::list& +AGHousehold::getCars() const { + return myCars; } bool -AGHousehold::isCloseFromPubTransport(std::list *pubTransport) { - SUMOReal distToPT = location.minDistanceTo(*pubTransport); +AGHousehold::isCloseFromPubTransport(std::list* pubTransport) { + SUMOReal distToPT = myLocation.minDistanceTo(*pubTransport); if (distToPT > myCity->statData.maxFootDistance) { return false; } @@ -113,8 +125,8 @@ } bool -AGHousehold::isCloseFromPubTransport(std::map *pubTransport) { - SUMOReal distToPT = location.minDistanceTo(*pubTransport); +AGHousehold::isCloseFromPubTransport(std::map* pubTransport) { + SUMOReal distToPT = myLocation.minDistanceTo(*pubTransport); if (distToPT > myCity->statData.maxFootDistance) { return false; } @@ -126,16 +138,16 @@ //only allocation of work or school to people will change std::list::iterator itC; std::list::iterator itA; - for (itC = children.begin() ; itC != children.end() ; ++itC) { + for (itC = myChildren.begin(); itC != myChildren.end(); ++itC) { if (itC->haveASchool()) { if (itC->leaveSchool()) { - itC->alocateASchool(&(myCity->schools), getPosition()); + itC->allocateASchool(&(myCity->schools), getPosition()); } } else { - itC->alocateASchool(&(myCity->schools), getPosition()); + itC->allocateASchool(&(myCity->schools), getPosition()); } } - for (itA = adults.begin() ; itA != adults.end() ; ++itA) { + for (itA = myAdults.begin(); itA != myAdults.end(); ++itA) { if (itA->isWorking()) { itA->resignFromWorkPosition(); } @@ -154,8 +166,8 @@ std::list::iterator it; bool oneRemainsAtHome = false; - for (it = children.begin() ; it != children.end() ; ++it) { - if (!it->alocateASchool(&(myCity->schools), location)) { + for (it = myChildren.begin(); it != myChildren.end(); ++it) { + if (!it->allocateASchool(&(myCity->schools), myLocation)) { oneRemainsAtHome = true; } } @@ -165,7 +177,7 @@ bool AGHousehold::allocateAdultsWork() { std::list::iterator it; - for (it = adults.begin() ; it != adults.end() ; ++it) { + for (it = myAdults.begin(); it != myAdults.end(); ++it) { if (myCity->statData.workPositions <= 0) { std::cout << "Not enough free work positions in AGHousehold::allocateAdultsWork. Should not happen." << std::endl; return false; @@ -177,14 +189,9 @@ return true; } -bool -AGHousehold::decisionProba(SUMOReal p) { - return (RandHelper::rand() < p); -} - AGPosition AGHousehold::getPosition() { - return location; + return myLocation; } AGCity* @@ -194,7 +201,7 @@ bool AGHousehold::retiredHouseholders() { - return (adults.front().getAge() >= myCity->statData.limitAgeRetirement); + return (myAdults.front().getAge() >= myCity->statData.limitAgeRetirement); } /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGHousehold.h sumo-0.16.0~dfsg/src/activitygen/city/AGHousehold.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGHousehold.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGHousehold.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGHousehold.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGHousehold.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A household contains the people and cars of the city: roughly represents // families with their address, cars, adults and possibly children @@ -58,29 +58,27 @@ class AGHousehold { public: AGHousehold(AGPosition pos, AGCity* city, int idHouseholds) : - location(pos), myCity(city), - idHH(idHouseholds) {}; + myLocation(pos), + myId(idHouseholds) {}; AGHousehold(AGStreet* str, AGCity* city, int idHouseholds) : - location(*str), myCity(city), - idHH(idHouseholds) {}; + myLocation(*str), + myId(idHouseholds) {}; /** - * - function generating one first Adult. - * - a second person is created depending on the mean number of adults per Households - * (and depending on the age of the first person) - * - and children are created for households of one or two people in age to work. - * Children are created in relation to the mean number of children and - * they are distributed with the POISSON's lay of probability. - */ - void generatePeople(); - int getPeopleNbr(); - int getAdultNbr(); + * function generating the given number of adults (1 or 2) and possibly children + */ + void generatePeople(int numAdults, int numChilds, bool firstRetired); + unsigned int getPeopleNbr(); + unsigned int getAdultNbr(); + const std::list& getAdults() const; + const std::list& getChildren() const; + const std::list& getCars() const; /** * function returning true if the household is close to the given stations stations */ - bool isCloseFromPubTransport(std::list *pubTransport); - bool isCloseFromPubTransport(std::map *pubTransport); + bool isCloseFromPubTransport(std::list* pubTransport); + bool isCloseFromPubTransport(std::map* pubTransport); /** * function regenerating the household: * --> work positions and schools are resigned @@ -120,19 +118,17 @@ * returns the position of the household and other private entities */ AGPosition getPosition(); - std::list adults; - std::list children; - std::list cars; private: - - bool decisionProba(SUMOReal p); - AGCity* myCity; - AGPosition location; - int numberOfPeople; - int numberOfCars; - int idHH; + AGPosition myLocation; + int myNumberOfCars; + int myId; + +private: + std::list myAdults; + std::list myChildren; + std::list myCars; }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGPerson.h sumo-0.16.0~dfsg/src/activitygen/city/AGPerson.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGPerson.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGPerson.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date July 2010 -/// @version $Id: AGPerson.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGPerson.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Parent object of every person, contains age and any natural characteristic /****************************************************************************/ @@ -52,7 +52,7 @@ * * @return the age in years */ - virtual int getAge() const ; + virtual int getAge() const; /** @brief Lets the person make a decision. * @@ -62,11 +62,11 @@ * @param[in] degreeOfBelief how strong the person beliefs the proposition * @return whether the person agrees with the proposition */ - virtual bool decide(SUMOReal probability) const ; + virtual bool decide(SUMOReal probability) const; /** @brief Puts out a summary of the class properties. */ - virtual void print() const ; + virtual void print() const; protected: int age; @@ -75,11 +75,11 @@ * * @param[in] age the age of the person */ - AGPerson(int age) ; + AGPerson(int age); /** @brief Cleans up everything. */ - virtual ~AGPerson() ; + virtual ~AGPerson(); }; #endif /* AGPerson */ diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGPosition.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGPosition.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGPosition.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGPosition.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGPosition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGPosition.cpp 12128 2012-03-19 11:54:26Z dkrajzew $ /// // References a street of the city and defines a position in this street /****************************************************************************/ @@ -78,7 +78,7 @@ SUMOReal tempDist; std::list::const_iterator itt; - for (itt = positions.begin() ; itt != positions.end() ; ++itt) { + for (itt = positions.begin(); itt != positions.end(); ++itt) { tempDist = this->distanceTo(*itt); if (tempDist < minDist) { minDist = tempDist; @@ -94,7 +94,7 @@ SUMOReal tempDist; std::map::const_iterator itt; - for (itt = positions.begin() ; itt != positions.end() ; ++itt) { + for (itt = positions.begin(); itt != positions.end(); ++itt) { tempDist = this->distanceTo(itt->second); if (tempDist < minDist) { minDist = tempDist; diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGPosition.h sumo-0.16.0~dfsg/src/activitygen/city/AGPosition.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGPosition.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGPosition.h 2012-09-25 22:01:42.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGPosition.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGPosition.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // References a street of the city and defines a position in this street /****************************************************************************/ @@ -71,7 +71,7 @@ * param[in] str the street on which the AGPosition is located * param[in] pos the distance from the from node of the street */ - AGPosition(const AGStreet& str, SUMOReal pos) ; + AGPosition(const AGStreet& str, SUMOReal pos); /** @brief Constructs an AGPosition at a random point on a street. * * This constructor determines the distance from the from node with @@ -79,13 +79,13 @@ * * param[in] str the street on which the AGPosition is located */ - AGPosition(const AGStreet& str) ; + AGPosition(const AGStreet& str); /** @brief Provides the street this AGPosition is located on. * * @return the street */ - const AGStreet& getStreet() const ; + const AGStreet& getStreet() const; /** @brief Provides the relative position of this AGPosition on the street. * @@ -94,7 +94,7 @@ * * @return the relative position */ - SUMOReal getPosition() const ; + SUMOReal getPosition() const; /** @brief Tests whether two positions are at the same place. * @@ -104,14 +104,14 @@ * @param[in] pos the position with which the comparison is done * @return true if both AGPositions are (almost) at the same place */ - bool operator==(const AGPosition& pos) const ; + bool operator==(const AGPosition& pos) const; /** @brief Computes the distance between two AGPosition objects. * * @param[in] the other position the distance in computed to * @return the distance */ - SUMOReal distanceTo(const AGPosition& otherPos) const ; + SUMOReal distanceTo(const AGPosition& otherPos) const; /** @brief Computes the distance to the closest position in a list. * @@ -121,7 +121,7 @@ * @param[in] positions the list of positions the distances are computed to * @return the minimal distance */ - SUMOReal minDistanceTo(const std::list& positions) const ; + SUMOReal minDistanceTo(const std::list& positions) const; /** @brief Computes the distance to the closest position in a map. * @@ -131,12 +131,12 @@ * @param[in] positions the map of positions the distances are computed to * @return the minimal distance */ - SUMOReal minDistanceTo(const std::map& positions) const ; + SUMOReal minDistanceTo(const std::map& positions) const; /** @brief Prints out a summary of the properties of this class * on standard output. */ - void print() const ; + void print() const; private: const AGStreet* street; @@ -147,7 +147,7 @@ * * @return the random relative position */ - static SUMOReal randomPositionInStreet(const AGStreet& street) ; + static SUMOReal randomPositionInStreet(const AGStreet& street); /** Creates a Position object to the street and position attribute of * this class. @@ -156,7 +156,7 @@ * * @return the Position object */ - Position compute2dPosition() const ; + Position compute2dPosition() const; }; #endif /* AGPOSITION_H */ diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGStreet.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGStreet.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGStreet.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGStreet.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date July 2010 -/// @version $Id: AGStreet.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGStreet.cpp 12459 2012-07-02 21:47:24Z behrisch $ /// // Represents a SUMO edge and contains people and work densities /****************************************************************************/ @@ -42,56 +42,49 @@ // =========================================================================== AGStreet::AGStreet(const ROEdge* edge, SUMOReal popDensity, SUMOReal workDensity) : edge(edge) { - pop = static_cast(popDensity * edge->getLength()); - work = static_cast(workDensity * edge->getLength()); + pop = popDensity * edge->getLength(); + work = workDensity * edge->getLength(); } -/****************************************************************************/ void AGStreet::print() const { std::cout << "- AGStreet: Name=" << edge->getID() << " Length=" << edge->getLength() << " pop=" << pop << " work=" << work << std::endl; } -/****************************************************************************/ SUMOReal AGStreet::getLength() const { return edge->getLength(); } -/****************************************************************************/ const std::string& AGStreet::getName() const { return edge->getID(); } -/****************************************************************************/ -int +SUMOReal AGStreet::getPopulation() const { return pop; } -/****************************************************************************/ void -AGStreet::setPopulation(const int& population) { +AGStreet::setPopulation(const SUMOReal population) { pop = population; } -/****************************************************************************/ -int +SUMOReal AGStreet::getWorkplaceNumber() const { return work; } -/****************************************************************************/ void -AGStreet::setWorkplaceNumber(const int& workPositions) { +AGStreet::setWorkplaceNumber(const SUMOReal workPositions) { work = workPositions; } diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGStreet.h sumo-0.16.0~dfsg/src/activitygen/city/AGStreet.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGStreet.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGStreet.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date July 2010 -/// @version $Id: AGStreet.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGStreet.h 12459 2012-07-02 21:47:24Z behrisch $ /// // Represents a SUMO edge and contains people and work densities /****************************************************************************/ @@ -56,55 +56,55 @@ */ class AGStreet { public: - AGStreet(const ROEdge* edge, SUMOReal popD = 0, SUMOReal workD = 0) ; + AGStreet(const ROEdge* edge, SUMOReal popD = 0, SUMOReal workD = 0); /** @brief Provides the length of this edge. * * @return the length of this edge */ - SUMOReal getLength() const ; + SUMOReal getLength() const; /** @brief Provides the id of this edge. * * @return the id of this edge */ - const std::string& getName() const ; + const std::string& getName() const; /** @brief Provides the number of persons living in this street. * * @return the number of inhabitants */ - int getPopulation() const ; + SUMOReal getPopulation() const; /** @brief Modifies the number of persons living in this street. * * @param[in] pop the new number of inhabitants */ - void setPopulation(const int& pop) ; + void setPopulation(const SUMOReal pop); /** @brief Provides the number of work places in this street. * * @return the number of work places */ - int getWorkplaceNumber() const ; + SUMOReal getWorkplaceNumber() const; /** @brief Modifies the number of work places in this street. * * @param[in] work the new number of work places */ - void setWorkplaceNumber(const int& work) ; + void setWorkplaceNumber(const SUMOReal work); /** @brief Prints a summary of the properties of this street to standard * output. */ - void print() const ; + void print() const; private: friend class AGPosition; const ROEdge* edge; - int pop; - int work; + SUMOReal pop; + SUMOReal work; }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGWorkPosition.cpp sumo-0.16.0~dfsg/src/activitygen/city/AGWorkPosition.cpp --- sumo-0.15.0~dfsg/src/activitygen/city/AGWorkPosition.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGWorkPosition.cpp 2012-09-25 22:01:42.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGWorkPosition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGWorkPosition.cpp 12475 2012-07-04 14:21:22Z behrisch $ /// // Location and schedules of a work position: linked with one adult /****************************************************************************/ @@ -45,23 +45,22 @@ // =========================================================================== // method definitions // =========================================================================== -AGWorkPosition::AGWorkPosition(const AGStreet& inStreet, AGDataAndStatistics* ds) : - location(inStreet), - openingTime(generateOpeningTime(*ds)), - closingTime(generateClosingTime(*ds)), - ds(ds), - adult(0) { +AGWorkPosition::AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet) : + myStatData(ds), + myLocation(inStreet), + myAdult(0), + myOpeningTime(generateOpeningTime(*ds)), + myClosingTime(generateClosingTime(*ds)) { ds->workPositions++; } -/****************************************************************************/ -AGWorkPosition::AGWorkPosition(const AGStreet& inStreet, SUMOReal pos, AGDataAndStatistics* ds) : - location(inStreet, pos), - openingTime(generateOpeningTime(*ds)), - closingTime(generateClosingTime(*ds)), - ds(ds), - adult(0) { +AGWorkPosition::AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet, SUMOReal pos) : + myStatData(ds), + myLocation(inStreet, pos), + myAdult(0), + myOpeningTime(generateOpeningTime(*ds)), + myClosingTime(generateClosingTime(*ds)) { ds->workPositions++; } @@ -69,16 +68,14 @@ // let(); } -/****************************************************************************/ void AGWorkPosition::print() const { - std::cout << "- AGWorkPosition: open=" << openingTime << " closingTime=" << closingTime << " taken=" << isTaken() << std::endl; + std::cout << "- AGWorkPosition: open=" << myOpeningTime << " closingTime=" << myClosingTime << " taken=" << isTaken() << std::endl; std::cout << "\t"; - location.print(); + myLocation.print(); } -/****************************************************************************/ int AGWorkPosition::generateOpeningTime(const AGDataAndStatistics& ds) { @@ -96,7 +93,6 @@ return 900; } -/****************************************************************************/ int AGWorkPosition::generateClosingTime(const AGDataAndStatistics& ds) { @@ -113,55 +109,49 @@ return 1700; } -/****************************************************************************/ bool AGWorkPosition::isTaken() const { - return (adult != 0); + return (myAdult != 0); } -/****************************************************************************/ void AGWorkPosition::let() { - if (adult != 0) { - ds->workPositions++; - adult->lostWorkPosition(); - adult = 0; + if (myAdult != 0) { + myStatData->workPositions++; + myAdult->lostWorkPosition(); + myAdult = 0; } } -/****************************************************************************/ void AGWorkPosition::take(AGAdult* worker) throw(std::runtime_error) { - if (adult == 0) { - ds->workPositions--; - adult = worker; + if (myAdult == 0) { + myStatData->workPositions--; + myAdult = worker; } else { throw(std::runtime_error("Work position already occupied. Cannot give it to another adult.")); } } -/****************************************************************************/ AGPosition AGWorkPosition::getPosition() const { - return location; + return myLocation; } -/****************************************************************************/ int AGWorkPosition::getClosing() const { - return closingTime; + return myClosingTime; } -/****************************************************************************/ int AGWorkPosition::getOpening() const { - return openingTime; + return myOpeningTime; } /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/AGWorkPosition.h sumo-0.16.0~dfsg/src/activitygen/city/AGWorkPosition.h --- sumo-0.15.0~dfsg/src/activitygen/city/AGWorkPosition.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/AGWorkPosition.h 2012-09-25 22:01:42.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGWorkPosition.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AGWorkPosition.h 12475 2012-07-04 14:21:22Z behrisch $ /// // Location and schedules of a work position: linked with one adult /****************************************************************************/ @@ -54,30 +54,30 @@ // TODO: Change name of openingTime to something like startHour or openingHour class AGWorkPosition { public: - // TODO: Change order: ds, inStreet [, pos] - AGWorkPosition(const AGStreet& inStreet, AGDataAndStatistics* ds) ; - AGWorkPosition(const AGStreet& inStreet, SUMOReal pos, AGDataAndStatistics* ds) ; - ~AGWorkPosition() ; + AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet); + AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet, SUMOReal pos); + ~AGWorkPosition(); void take(AGAdult* ad) throw(std::runtime_error); - void let() ; - bool isTaken() const ; + void let(); + bool isTaken() const; - AGPosition getPosition() const ; - int getOpening() const ; - int getClosing() const ; + AGPosition getPosition() const; + int getOpening() const; + int getClosing() const; - void print() const ; + void print() const; private: - AGDataAndStatistics* ds; - AGAdult* adult; - AGPosition location; - int openingTime; - int closingTime; + static int generateOpeningTime(const AGDataAndStatistics& ds); + static int generateClosingTime(const AGDataAndStatistics& ds); - static int generateOpeningTime(const AGDataAndStatistics& ds) ; - static int generateClosingTime(const AGDataAndStatistics& ds) ; +private: + AGDataAndStatistics* myStatData; + AGPosition myLocation; + AGAdult* myAdult; + int myOpeningTime; + int myClosingTime; }; #endif diff -Nru sumo-0.15.0~dfsg/src/activitygen/city/Makefile.in sumo-0.16.0~dfsg/src/activitygen/city/Makefile.in --- sumo-0.15.0~dfsg/src/activitygen/city/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/activitygen/city/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -105,6 +105,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -135,6 +136,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -169,6 +171,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -202,7 +205,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/config.h sumo-0.16.0~dfsg/src/config.h --- sumo-0.15.0~dfsg/src/config.h 2012-03-14 00:12:04.000000000 +0000 +++ sumo-0.16.0~dfsg/src/config.h 2012-12-04 00:13:26.000000000 +0000 @@ -174,7 +174,7 @@ #define PACKAGE_NAME "sumo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "sumo 0.15.0" +#define PACKAGE_STRING "sumo 0.16.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "sumo" @@ -183,7 +183,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.15.0" +#define PACKAGE_VERSION "0.16.0" /* defines the epsilon to use on position comparison */ #define POSITION_EPS 0.1 @@ -211,6 +211,9 @@ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 +/* defines the type for very long integers */ +#define SUMOLong long long int + /* defines the precision of floats */ #define SUMOReal double @@ -221,7 +224,7 @@ /* #undef TM_IN_SYS_TIME */ /* Version number of package */ -#define VERSION "0.15.0" +#define VERSION "0.16.0" /* Defined if auto-generated version.h is unavailable. */ /* #undef VERSION_STRING */ diff -Nru sumo-0.15.0~dfsg/src/config.h.in sumo-0.16.0~dfsg/src/config.h.in --- sumo-0.15.0~dfsg/src/config.h.in 2012-03-14 00:11:49.000000000 +0000 +++ sumo-0.16.0~dfsg/src/config.h.in 2012-12-04 00:13:18.000000000 +0000 @@ -210,6 +210,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* defines the type for very long integers */ +#undef SUMOLong + /* defines the precision of floats */ #undef SUMOReal diff -Nru sumo-0.15.0~dfsg/src/dfrouter/Makefile.am sumo-0.16.0~dfsg/src/dfrouter/Makefile.am --- sumo-0.15.0~dfsg/src/dfrouter/Makefile.am 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -16,8 +16,8 @@ dfrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/dfrouter/Makefile.in sumo-0.16.0~dfsg/src/dfrouter/Makefile.in --- sumo-0.15.0~dfsg/src/dfrouter/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -56,8 +56,8 @@ RODFFrame.$(OBJEXT) dfrouter_OBJECTS = $(am_dfrouter_OBJECTS) dfrouter_DEPENDENCIES = ../router/librouter.a \ - ../utils/options/liboptions.a ../utils/common/libcommon.a \ - ../utils/xml/libxml.a ../utils/importio/libimportio.a \ + ../utils/options/liboptions.a ../utils/xml/libxml.a \ + ../utils/common/libcommon.a ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../foreign/tcpip/libtcpip.a $(MEM_LIBS) dfrouter_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @@ -112,6 +112,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -142,6 +143,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -176,6 +178,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -209,7 +212,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -241,8 +243,8 @@ dfrouter_LDFLAGS = $(XERCES_LDFLAGS) dfrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetFlowLoader.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFDetFlowLoader.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetFlowLoader.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetFlowLoader.cpp 2012-11-17 00:02:19.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetFlowLoader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetFlowLoader.cpp 13004 2012-11-16 22:31:43Z behrisch $ /// // A loader for detector flows /****************************************************************************/ @@ -80,7 +80,7 @@ if (!myDetectorContainer.knows(detName)) { continue; } - const SUMOTime time = TplConvert::_2int((myLineHandler.get("time").c_str())) * myTimeScale - myTimeOffset; + const SUMOTime time = TplConvert::_2int((myLineHandler.get("time").c_str())) * myTimeScale - myTimeOffset; if (time < myStartTime || time > myEndTime) { if (!myHaveWarnedAboutOverridingBoundaries) { myHaveWarnedAboutOverridingBoundaries = true; @@ -90,15 +90,18 @@ } FlowDef fd; fd.isLKW = 0; - fd.qPKW = TplConvert::_2SUMOReal(myLineHandler.get("qpkw").c_str()); - fd.vPKW = TplConvert::_2SUMOReal(myLineHandler.get("vpkw").c_str()); + fd.qPKW = TplConvert::_2SUMOReal(myLineHandler.get("qpkw").c_str()); + fd.vPKW = 0; + if (myLineHandler.know("vPKW")) { + fd.vPKW = TplConvert::_2SUMOReal(myLineHandler.get("vpkw").c_str()); + } fd.qLKW = 0; if (myLineHandler.know("qLKW")) { - fd.qLKW = TplConvert::_2SUMOReal(myLineHandler.get("qlkw").c_str()); + fd.qLKW = TplConvert::_2SUMOReal(myLineHandler.get("qlkw").c_str()); } fd.vLKW = 0; if (myLineHandler.know("vLKW")) { - fd.vLKW = TplConvert::_2SUMOReal(myLineHandler.get("vlkw").c_str()); + fd.vLKW = TplConvert::_2SUMOReal(myLineHandler.get("vlkw").c_str()); } if (fd.qLKW < 0) { fd.qLKW = 0; @@ -114,7 +117,7 @@ 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', 'vPKW'\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-0.15.0~dfsg/src/dfrouter/RODFDetFlowLoader.h sumo-0.16.0~dfsg/src/dfrouter/RODFDetFlowLoader.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetFlowLoader.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetFlowLoader.h 2012-09-25 22:01:44.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetFlowLoader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetFlowLoader.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A loader for detector flows /****************************************************************************/ @@ -59,11 +59,11 @@ */ RODFDetFlowLoader(const RODFDetectorCon& dets, RODFDetectorFlows& into, SUMOTime startTime, SUMOTime endTime, - SUMOTime timeOffset, int timeScale) ; + SUMOTime timeOffset, int timeScale); /// @brief Destructor - ~RODFDetFlowLoader() ; + ~RODFDetFlowLoader(); /** @brief Reads the given file assuming it contains detector values diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetector.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFDetector.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetector.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetector.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetector.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetector.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Class representing a detector within the DFROUTER /****************************************************************************/ @@ -33,6 +33,7 @@ #include #endif +#include #include "RODFDetector.h" #include #include @@ -45,6 +46,7 @@ #include "RODFDetectorFlow.h" #include #include +#include #include #include "RODFNet.h" #include @@ -102,7 +104,7 @@ return; } // compute edges to determine split probabilities - const std::vector &routes = myRoutes->get(); + const std::vector& routes = myRoutes->get(); std::vector nextDetEdges; for (std::vector::const_iterator i = routes.begin(); i != routes.end(); ++i) { const RODFRouteDesc& rd = *i; @@ -144,22 +146,16 @@ void RODFDetector::buildDestinationDistribution(const RODFDetectorCon& detectors, - const RODFDetectorFlows& flows, - SUMOTime startTime, - SUMOTime endTime, - SUMOTime stepOffset, + SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, const RODFNet& net, - std::map* > &into, - int maxFollower) const { - UNUSED_PARAMETER(maxFollower); + std::map* >& into) const { if (myRoutes == 0) { if (myType != DISCARDED_DETECTOR && myType != BETWEEN_DETECTOR) { WRITE_ERROR("Missing routes for detector '" + myID + "'."); } return; } - std::vector &descs = myRoutes->get(); -// const std::vector &mflows = flows.getFlowDefs(myID); + std::vector& descs = myRoutes->get(); // iterate through time (in output interval steps) for (SUMOTime time = startTime; time < endTime; time += stepOffset) { into[time] = new RandomDistributor(); @@ -173,12 +169,12 @@ continue; } const RODFDetector& det = detectors.getAnyDetectorForEdge(static_cast(*j)); - const std::vector > &probs = det.getSplitProbabilities(); + const std::vector >& probs = det.getSplitProbabilities(); if (probs.size() == 0) { prob = 0; continue; } - const std::map &tprobs = probs[(time - startTime) / stepOffset]; + const std::map& tprobs = probs[(time - startTime) / stepOffset]; for (std::map::const_iterator k = tprobs.begin(); k != tprobs.end(); ++k) { if (find(j, (*ri).edges2Pass.end(), (*k).first) != (*ri).edges2Pass.end()) { prob *= (*k).second; @@ -192,7 +188,7 @@ } -const std::vector & +const std::vector& RODFDetector::getRouteVector() const { return myRoutes->get(); } @@ -210,13 +206,13 @@ } -const std::vector & +const std::vector& RODFDetector::getPriorDetectors() const { return myPriorDetectors; } -const std::vector & +const std::vector& RODFDetector::getFollowerDetectors() const { return myFollowingDetectors; } @@ -247,7 +243,7 @@ bool RODFDetector::writeEmitterDefinition(const std::string& file, - const std::map* > &dists, + const std::map* >& dists, const RODFDetectorFlows& flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, @@ -261,8 +257,8 @@ } // routes if (myRoutes != 0 && myRoutes->get().size() != 0) { - const std::vector &routes = myRoutes->get(); - out.openTag("routeDistribution") << " id=\"" << myID << "\">\n"; + const std::vector& routes = myRoutes->get(); + out.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_ID, myID).closeOpener(); bool isEmptyDist = true; for (std::vector::const_iterator i = routes.begin(); i != routes.end(); ++i) { if ((*i).overallProb > 0) { @@ -271,49 +267,43 @@ } for (std::vector::const_iterator i = routes.begin(); i != routes.end(); ++i) { if ((*i).overallProb > 0 || includeUnusedRoutes) { - out.openTag("route") << " refId=\"" << (*i).routename << "\" probability=\"" << (*i).overallProb << "\""; - out.closeTag(true); + out.openTag(SUMO_TAG_ROUTE).writeAttr(SUMO_ATTR_REFID, (*i).routename).writeAttr(SUMO_ATTR_PROB, (*i).overallProb).closeTag(true); } if (isEmptyDist) { - out.openTag("route") << " refId=\"" << (*i).routename << "\" probability=\"1\""; - out.closeTag(true); + out.openTag(SUMO_TAG_ROUTE).writeAttr(SUMO_ATTR_REFID, (*i).routename).writeAttr(SUMO_ATTR_PROB, SUMOReal(1)).closeTag(true); } } - out.closeTag(); + out.closeTag(); // routeDistribution } else { WRITE_ERROR("Detector '" + getID() + "' has no routes!?"); return false; } - // emissions + // insertions if (insertionsOnly || flows.knows(myID)) { // get the flows for this detector - - const std::vector &mflows = flows.getFlowDefs(myID); + const std::vector& mflows = flows.getFlowDefs(myID); // go through the simulation seconds - int index = 0; + unsigned int index = 0; for (SUMOTime time = startTime; time < endTime; time += stepOffset, index++) { // get own (departure flow) assert(index < mflows.size()); const FlowDef& srcFD = mflows[index]; // !!! check stepOffset // get flows at end - RandomDistributor *destDist = dists.find(time) != dists.end() ? dists.find(time)->second : 0; + RandomDistributor* destDist = dists.find(time) != dists.end() ? dists.find(time)->second : 0; // go through the cars size_t carNo = (size_t)((srcFD.qPKW + srcFD.qLKW) * scale); for (size_t car = 0; car < carNo; ++car) { // get the vehicle parameter - std::string type = "test"; SUMOReal v = -1; int destIndex = destDist != 0 && destDist->getOverallProb() > 0 ? (int) destDist->get() : -1; if (srcFD.isLKW >= 1) { srcFD.isLKW = srcFD.isLKW - (SUMOReal) 1.; -//!!! type = lkwTypes[vehSpeedDist.get()]; v = srcFD.vLKW; } else { -//!!! type = pkwTypes[vehSpeedDist.get()]; v = srcFD.vPKW; } - // compute emission speed - if (v < 0 || v > 250) { + // compute insertion speed + if (v <= 0 || v > 250) { v = defaultSpeed; } else { v = (SUMOReal)(v / 3.6); @@ -322,26 +312,23 @@ SUMOTime ctime = (SUMOTime)(time + ((SUMOReal) stepOffset * (SUMOReal) car / (SUMOReal) carNo)); // write - out.openTag("vehicle") << " id=\""; + out.openTag(SUMO_TAG_VEHICLE); if (getType() == SOURCE_DETECTOR) { - out << "emitter_" << myID; + out.writeAttr(SUMO_ATTR_ID, "emitter_" + myID + "_" + toString(ctime)); } else { - out << "calibrator_" << myID; + out.writeAttr(SUMO_ATTR_ID, "calibrator_" + myID + "_" + toString(ctime)); } - out << "_" << ctime << "\"" // !!! running - << " depart=\"" << time2string(ctime) << "\"" - << " departSpeed=\""; + out.writeAttr(SUMO_ATTR_DEPART, time2string(ctime)); if (v > defaultSpeed) { - out << "max"; + out.writeAttr(SUMO_ATTR_DEPARTSPEED, "max"); } else { - out << v; + out.writeAttr(SUMO_ATTR_DEPARTSPEED, v); } - out << "\" departPos=\"" << myPosition << "\"" - << " departLane=\"" << myLaneID.substr(myLaneID.rfind("_") + 1) << "\" route=\""; + out.writeAttr(SUMO_ATTR_DEPARTPOS, myPosition).writeAttr(SUMO_ATTR_DEPARTLANE, TplConvert::_2int(myLaneID.substr(myLaneID.rfind("_") + 1).c_str())); if (destIndex >= 0) { - out << myRoutes->get()[destIndex].routename << "\""; + out.writeAttr(SUMO_ATTR_ROUTE, myRoutes->get()[destIndex].routename); } else { - out << myID << "\""; + out.writeAttr(SUMO_ATTR_ROUTE, myID); } out.closeTag(true); srcFD.isLKW += srcFD.fLKW; @@ -356,7 +343,7 @@ bool -RODFDetector::writeRoutes(std::vector &saved, +RODFDetector::writeRoutes(std::vector& saved, OutputDevice& out) { if (myRoutes != 0) { return myRoutes->save(saved, "", out); @@ -372,8 +359,8 @@ SUMOTime stepOffset, SUMOReal defaultSpeed) { OutputDevice& out = OutputDevice::getDevice(file); out.writeXMLHeader("vss"); - const std::vector &mflows = flows.getFlowDefs(myID); - int index = 0; + const std::vector& mflows = flows.getFlowDefs(myID); + unsigned int index = 0; for (SUMOTime t = startTime; t < endTime; t += stepOffset, index++) { assert(index < mflows.size()); const FlowDef& srcFD = mflows[index]; @@ -383,7 +370,7 @@ } else { speed = (SUMOReal)(speed / 3.6); } - out << " \n"; + out.openTag(SUMO_TAG_STEP).writeAttr(SUMO_ATTR_TIME, time2string(t)).writeAttr(SUMO_ATTR_SPEED, speed).closeTag(true); } out.close(); } @@ -445,7 +432,7 @@ } -const std::vector< RODFDetector*> & +const std::vector< RODFDetector*>& RODFDetectorCon::getDetectors() const { return myDetectors; } @@ -456,26 +443,24 @@ OutputDevice& out = OutputDevice::getDevice(file); out.writeXMLHeader("detectors"); for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { - out << " <" << toString(SUMO_TAG_DETECTOR_DEFINITION) << " id=\"" << StringUtils::escapeXML((*i)->getID()) - << "\" lane=\"" << (*i)->getLaneID() - << "\" pos=\"" << (*i)->getPos(); + out.openTag(SUMO_TAG_DETECTOR_DEFINITION).writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML((*i)->getID())).writeAttr(SUMO_ATTR_LANE, (*i)->getLaneID()).writeAttr(SUMO_ATTR_POSITION, (*i)->getPos()); switch ((*i)->getType()) { case BETWEEN_DETECTOR: - out << "\" type=\"between\""; + out.writeAttr(SUMO_ATTR_TYPE, "between"); break; case SOURCE_DETECTOR: - out << "\" type=\"source\""; + out.writeAttr(SUMO_ATTR_TYPE, "source"); break; case SINK_DETECTOR: - out << "\" type=\"sink\""; + out.writeAttr(SUMO_ATTR_TYPE, "sink"); break; case DISCARDED_DETECTOR: - out << "\" type=\"discarded\""; + out.writeAttr(SUMO_ATTR_TYPE, "discarded"); break; default: throw 1; } - out << "/>\n"; + out.closeTag(true); } out.close(); } @@ -486,25 +471,24 @@ OutputDevice& out = OutputDevice::getDevice(file); out.writeXMLHeader("pois"); for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { - out << " getID()); + out.openTag(SUMO_TAG_POI).writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML((*i)->getID())); switch ((*i)->getType()) { case BETWEEN_DETECTOR: - out << "\" type=\"between_detector_position\" color=\"0,0,1\""; + out.writeAttr(SUMO_ATTR_TYPE, "between_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(0, 0, 1)); break; case SOURCE_DETECTOR: - out << "\" type=\"source_detector_position\" color=\"0,1,0\""; + out.writeAttr(SUMO_ATTR_TYPE, "source_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(0, 1, 0)); break; case SINK_DETECTOR: - out << "\" type=\"sink_detector_position\" color=\"1,0,0\""; + out.writeAttr(SUMO_ATTR_TYPE, "sink_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(1, 0, 0)); break; case DISCARDED_DETECTOR: - out << "\" type=\"discarded_detector_position\" color=\".2,.2,.2\""; + out.writeAttr(SUMO_ATTR_TYPE, "discarded_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(.2, .2, .2)); break; default: throw 1; } - out << " lane=\"" << (*i)->getLaneID() << "\" pos=\"" - << (*i)->getPos() << "\"/>\n"; + out.writeAttr(SUMO_ATTR_LANE, (*i)->getLaneID()).writeAttr(SUMO_ATTR_POSITION, (*i)->getPos()).closeTag(true); } out.close(); } @@ -552,7 +536,6 @@ bool writeCalibrators, bool includeUnusedRoutes, SUMOReal scale, - int maxFollower, bool insertionsOnly) { // compute turn probabilities at detector for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { @@ -579,7 +562,7 @@ // ... compute routes' distribution over time std::map* > dists; if (!insertionsOnly && flows.knows(det->getID())) { - det->buildDestinationDistribution(*this, flows, startTime, endTime, stepOffset, net, dists, maxFollower); + det->buildDestinationDistribution(*this, startTime, endTime, stepOffset, net, dists); } // ... write the definition if (!det->writeEmitterDefinition(defFileName, dists, flows, startTime, endTime, stepOffset, includeUnusedRoutes, scale, insertionsOnly, defaultSpeed)) { @@ -590,11 +573,8 @@ clearDists(dists); // write the declaration into the file if (writeCalibrators && det->getType() == BETWEEN_DETECTOR) { - out << " getPos() << "\" " - << "lane=\"" << det->getLaneID() << "\" " - << "friendlyPos=\"x\" " // !!! - << "file=\"" << defFileName << "\"/>\n"; + out.openTag(SUMO_TAG_CALIBRATOR).writeAttr(SUMO_ATTR_ID, "calibrator_" + escapedID).writeAttr(SUMO_ATTR_POSITION, det->getPos()); + out.writeAttr(SUMO_ATTR_LANE, det->getLaneID()).writeAttr(SUMO_ATTR_FRIENDLY_POS, true).writeAttr(SUMO_ATTR_FILE, defFileName).closeTag(true); } } out.close(); @@ -611,26 +591,24 @@ SUMOReal flow = flows.getFlowSumSecure(det->getID()); SUMOReal col = flow / flows.getMaxDetectorFlow(); col = (SUMOReal)(col / 2. + .5); - SUMOReal r, g, b; - r = g = b = 0; - out << " getID()) << ":" << flow; + out.openTag(SUMO_TAG_POI).writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML((*i)->getID()) + ":" + toString(flow)); switch ((*i)->getType()) { case BETWEEN_DETECTOR: - out << "\" type=\"between_detector_position\" color=\"0,0," << col << "\""; + out.writeAttr(SUMO_ATTR_TYPE, "between_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(0, 0, col)); break; case SOURCE_DETECTOR: - out << "\" type=\"source_detector_position\" color=\"0," << col << ",0\""; + out.writeAttr(SUMO_ATTR_TYPE, "source_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(0, col, 0)); break; case SINK_DETECTOR: - out << "\" type=\"sink_detector_position\" color=\"" << col << ",0,0\""; + out.writeAttr(SUMO_ATTR_TYPE, "sink_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(col, 0, 0)); break; case DISCARDED_DETECTOR: - out << "\" type=\"discarded_detector_position\" color=\".2,.2,.2\""; + out.writeAttr(SUMO_ATTR_TYPE, "discarded_detector_position").writeAttr(SUMO_ATTR_COLOR, RGBColor(.2, .2, .2)); break; default: throw 1; } - out << " lane=\"" << (*i)->getLaneID() << "\" pos=\"" << (*i)->getPos() << "\"/>\n"; + out.writeAttr(SUMO_ATTR_LANE, (*i)->getLaneID()).writeAttr(SUMO_ATTR_POSITION, (*i)->getPos()).closeTag(true); } out.close(); } @@ -648,7 +626,7 @@ // SUMOReal startTime = 0; // !!! // cout << edge->getID() << endl; assert(myDetectorEdgeMap.find(edge->getID()) != myDetectorEdgeMap.end()); - const std::vector &flows = static_cast(edge)->getFlows(); + const std::vector& flows = static_cast(edge)->getFlows(); SUMOReal agg = 0; for (std::vector::const_iterator i = flows.begin(); i != flows.end(); ++i) { const FlowDef& srcFD = *i; @@ -693,9 +671,7 @@ // write the declaration into the file if (det->getType() == SINK_DETECTOR && flows.knows(det->getID())) { std::string filename = FileHelpers::getFilePath(file) + "vss_" + det->getID() + ".def.xml"; - out << " getID()) << '\"' - << " lanes=\"" << det->getLaneID() << '\"' - << " file=\"" << filename << "\"/>\n"; + out.openTag(SUMO_TAG_VSS).writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(det->getID())).writeAttr(SUMO_ATTR_LANES, det->getLaneID()).writeAttr(SUMO_ATTR_FILE, filename).closeTag(true); SUMOReal defaultSpeed = net != 0 ? net->getEdge(det->getEdgeID())->getSpeed() : (SUMOReal) 200.; det->writeSingleSpeedTrigger(filename, flows, startTime, endTime, stepOffset, defaultSpeed); } @@ -712,10 +688,8 @@ RODFDetector* det = *i; // write the declaration into the file if (det->getType() == SINK_DETECTOR) { - out << " getID()) - << "\" edges=\"" << - det->getLaneID() << "\" attr=\"reroute\" pos=\"0\" file=\"endrerouter_" - << det->getID() << ".def.xml\"/>\n"; + out.openTag(SUMO_TAG_REROUTER).writeAttr(SUMO_ATTR_ID, "endrerouter_" + StringUtils::escapeXML(det->getID())).writeAttr(SUMO_ATTR_EDGES, det->getLaneID()); + out.writeAttr(SUMO_ATTR_POSITION, SUMOReal(0)).writeAttr(SUMO_ATTR_FILE, "endrerouter_" + det->getID() + ".def.xml").closeTag(true); } } out.close(); @@ -736,18 +710,17 @@ if (det->getType() == SOURCE_DETECTOR) { pos += 1; } - out << " getID()) << "\" " - << "lane=\"" << det->getLaneID() << "\" " - << "pos=\"" << pos << "\" " - << "freq=\"60\" "; + out.openTag(SUMO_TAG_E1DETECTOR).writeAttr(SUMO_ATTR_ID, "validation_" + StringUtils::escapeXML(det->getID())).writeAttr(SUMO_ATTR_LANE, det->getLaneID()); + out.writeAttr(SUMO_ATTR_POSITION, pos).writeAttr(SUMO_ATTR_FREQUENCY, 60); if (friendly) { - out << "friendlyPos=\"x\" "; + out.writeAttr(SUMO_ATTR_FRIENDLY_POS, true); } if (!singleFile) { - out << "file=\"validation_det_" << StringUtils::escapeXML(det->getID()) << ".xml\"/>\n"; + out.writeAttr(SUMO_ATTR_FILE, "validation_det_" + StringUtils::escapeXML(det->getID()) + ".xml"); } else { - out << "file=\"validation_dets.xml\"/>\n";//!!! + out.writeAttr(SUMO_ATTR_FILE, "validation_dets.xml"); } + out.closeTag(true); } } out.close(); @@ -767,7 +740,7 @@ // bool found = false; for (std::map >::iterator rr3 = myDetectorEdgeMap.begin(); !found && rr3 != myDetectorEdgeMap.end(); ++rr3) { - std::vector &dets = (*rr3).second; + std::vector& dets = (*rr3).second; for (std::vector::iterator ri3 = dets.begin(); !found && ri3 != dets.end();) { if (*ri3 == oldDet) { found = true; @@ -790,8 +763,8 @@ while (changed) { for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { RODFDetector* det = *i; - const std::vector &prior = det->getPriorDetectors(); - const std::vector &follower = det->getFollowerDetectors(); + const std::vector& prior = det->getPriorDetectors(); + const std::vector& follower = det->getFollowerDetectors(); size_t noFollowerWithRoutes = 0; size_t noPriorWithRoutes = 0; // count occurences of detectors with/without routes @@ -837,7 +810,7 @@ void -RODFDetectorCon::clearDists(std::map* > &dists) const { +RODFDetectorCon::clearDists(std::map* >& dists) const { for (std::map* >::iterator i = dists.begin(); i != dists.end(); ++i) { delete(*i).second; } @@ -846,7 +819,7 @@ void RODFDetectorCon::mesoJoin(const std::string& nid, - const std::vector &oldids) { + const std::vector& oldids) { // build the new detector const RODFDetector& first = getDetector(*(oldids.begin())); RODFDetector* newDet = new RODFDetector(nid, first); diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetector.h sumo-0.16.0~dfsg/src/dfrouter/RODFDetector.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetector.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetector.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetector.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetector.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Class representing a detector within the DFROUTER /****************************************************************************/ @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include "RODFRouteCont.h" @@ -97,7 +96,7 @@ * @see RODFDetectorType */ RODFDetector(const std::string& id, const std::string& laneID, - SUMOReal pos, const RODFDetectorType type) ; + SUMOReal pos, const RODFDetectorType type); /** @brief Constructor @@ -107,11 +106,11 @@ * @param[in] id The id of the detector * @param[in] f A detector from which routes shall be copied */ - RODFDetector(const std::string& id, const RODFDetector& f) ; + RODFDetector(const std::string& id, const RODFDetector& f); /// @brief Destructor - ~RODFDetector() ; + ~RODFDetector(); @@ -164,23 +163,23 @@ void addRoute(RODFRouteDesc& nrd); void addRoutes(RODFRouteCont* routes); bool hasRoutes() const; - const std::vector &getRouteVector() const; + const std::vector& getRouteVector() const; void addPriorDetector(RODFDetector* det); void addFollowingDetector(RODFDetector* det); - const std::vector &getPriorDetectors() const; - const std::vector &getFollowerDetectors() const; + const std::vector& getPriorDetectors() const; + const std::vector& getFollowerDetectors() const; /// @name Writing methods /// @{ bool writeEmitterDefinition(const std::string& file, - const std::map* > &dists, + const std::map* >& dists, const RODFDetectorFlows& flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, bool includeUnusedRoutes, SUMOReal scale, bool insertionsOnly, SUMOReal defaultSpeed) const; - bool writeRoutes(std::vector &saved, + bool writeRoutes(std::vector& saved, OutputDevice& out); void writeSingleSpeedTrigger(const std::string& file, const RODFDetectorFlows& flows, @@ -190,17 +189,15 @@ /// @} void buildDestinationDistribution(const RODFDetectorCon& detectors, - const RODFDetectorFlows& flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, const RODFNet& net, - std::map* > &into, - int maxFollower) const; + std::map* >& into) const; void computeSplitProbabilities(const RODFNet* net, const RODFDetectorCon& detectors, const RODFDetectorFlows& flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset); - const std::vector > &getSplitProbabilities() const { + const std::vector >& getSplitProbabilities() const { return mySplitProbabilities; } @@ -242,7 +239,7 @@ void removeDetector(const std::string& id); bool detectorsHaveCompleteTypes() const; bool detectorsHaveRoutes() const; - const std::vector &getDetectors() const; + const std::vector& getDetectors() const; void save(const std::string& file) const; void saveAsPOIs(const std::string& file) const; void saveRoutes(const std::string& file) const; @@ -256,7 +253,7 @@ SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, const RODFNet& net, bool writeCalibrators, bool includeUnusedRoutes, - SUMOReal scale, int maxFollower, + SUMOReal scale, bool insertionsOnly); void writeEmitterPOIs(const std::string& file, @@ -275,14 +272,14 @@ void guessEmptyFlows(RODFDetectorFlows& flows); - void mesoJoin(const std::string& nid, const std::vector &oldids); + void mesoJoin(const std::string& nid, const std::vector& oldids); protected: /** @brief Clears the given distributions map, deleting the timed distributions * @param[in] dists The distribution map to clear */ - void clearDists(std::map* > &dists) const ; + void clearDists(std::map* >& dists) const; protected: diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorFlow.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorFlow.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorFlow.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorFlow.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorFlow.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetectorFlow.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for flows within the DFROUTER /****************************************************************************/ @@ -56,7 +56,7 @@ if (myFastAccessFlows.find(id) == myFastAccessFlows.end()) { size_t noItems = (size_t)((myEndTime - myBeginTime) / myStepOffset); myFastAccessFlows[id] = std::vector(noItems); - std::vector &cflows = myFastAccessFlows[id]; + std::vector& cflows = myFastAccessFlows[id]; // initialise for (std::vector::iterator i = cflows.begin(); i < cflows.end(); ++i) { (*i).qPKW = 0; @@ -80,7 +80,7 @@ ofd.vPKW = ofd.vPKW + fd.vPKW; //!!! mean value? } if (ofd.qLKW != 0 && ofd.qPKW != 0) { - ofd.fLKW = ofd.qLKW / ofd.qPKW ; + ofd.fLKW = ofd.qLKW / ofd.qPKW; } else if (ofd.qPKW != 0) { ofd.fLKW = 0; } else { @@ -94,11 +94,11 @@ void RODFDetectorFlows::setFlows(const std::string& detector_id, - std::vector &flows) { + std::vector& flows) { for (std::vector::iterator i = flows.begin(); i < flows.end(); ++i) { FlowDef& ofd = *i; if (ofd.qLKW != 0 && ofd.qPKW != 0) { - ofd.fLKW = ofd.qLKW / ofd.qPKW ; + ofd.fLKW = ofd.qLKW / ofd.qPKW; } else { ofd.fLKW = 0; } @@ -119,7 +119,7 @@ } -const std::vector & +const std::vector& RODFDetectorFlows::getFlowDefs(const std::string& id) const { assert(myFastAccessFlows.find(id) != myFastAccessFlows.end()); assert(myFastAccessFlows.find(id)->second.size() != 0); @@ -131,7 +131,7 @@ RODFDetectorFlows::getFlowSumSecure(const std::string& id) const { SUMOReal ret = 0; if (knows(id)) { - const std::vector &flows = getFlowDefs(id); + const std::vector& flows = getFlowDefs(id); for (std::vector::const_iterator i = flows.begin(); i != flows.end(); ++i) { ret += (*i).qPKW; ret += (*i).qLKW; @@ -148,7 +148,7 @@ std::map >::const_iterator j; for (j = myFastAccessFlows.begin(); j != myFastAccessFlows.end(); ++j) { SUMOReal curr = 0; - const std::vector &flows = (*j).second; + const std::vector& flows = (*j).second; for (std::vector::const_iterator i = flows.begin(); i != flows.end(); ++i) { curr += (*i).qPKW; curr += (*i).qLKW; @@ -165,12 +165,12 @@ void RODFDetectorFlows::mesoJoin(const std::string& nid, - const std::vector &oldids) { + const std::vector& oldids) { for (std::vector::const_iterator i = oldids.begin(); i != oldids.end(); ++i) { if (!knows(*i)) { continue; } - std::vector &flows = myFastAccessFlows[*i]; + std::vector& flows = myFastAccessFlows[*i]; size_t index = 0; for (SUMOTime t = myBeginTime; t != myEndTime; t += myStepOffset) { addFlow(nid, t, flows[index++]); // !!! @@ -184,7 +184,7 @@ RODFDetectorFlows::printAbsolute() const { for (std::map >::const_iterator i = myFastAccessFlows.begin(); i != myFastAccessFlows.end(); ++i) { std::cout << (*i).first << ":"; - const std::vector &flows = (*i).second; + const std::vector& flows = (*i).second; SUMOReal qPKW = 0; SUMOReal qLKW = 0; for (std::vector::const_iterator j = flows.begin(); j != flows.end(); ++j) { diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorFlow.h sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorFlow.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorFlow.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorFlow.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorFlow.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetectorFlow.h 13107 2012-12-02 13:57:34Z behrisch $ /// // missing_desc /****************************************************************************/ @@ -80,15 +80,15 @@ void addFlow(const std::string& detector_id, SUMOTime timestamp, const FlowDef& fd); void removeFlow(const std::string& detector_id); - void setFlows(const std::string& detector_id, std::vector &); + void setFlows(const std::string& detector_id, std::vector&); - const std::vector &getFlowDefs(const std::string& id) const; + const std::vector& getFlowDefs(const std::string& id) const; bool knows(const std::string& det_id) const; SUMOReal getFlowSumSecure(const std::string& id) const; SUMOReal getMaxDetectorFlow() const; void printAbsolute() const; - void mesoJoin(const std::string& nid, const std::vector &oldids); + void mesoJoin(const std::string& nid, const std::vector& oldids); protected: std::map > myFastAccessFlows; diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorHandler.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorHandler.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorHandler.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorHandler.cpp 2012-09-25 22:01:44.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetectorHandler.cpp 12599 2012-08-27 11:15:34Z dkrajzew $ /// // A handler for loading detector descriptions /****************************************************************************/ @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,8 +54,7 @@ RODFDetectorHandler::RODFDetectorHandler(RODFNet* optNet, bool ignoreErrors, RODFDetectorCon& con, const std::string& file) : SUMOSAXHandler(file), - myNet(optNet), myIgnoreErrors(ignoreErrors), myContainer(con), - myHaveWarnedAboutDeprecatedDetectorDefinition(false) {} + myNet(optNet), myIgnoreErrors(ignoreErrors), myContainer(con) {} RODFDetectorHandler::~RODFDetectorHandler() {} @@ -64,11 +63,7 @@ void RODFDetectorHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { - if (element == SUMO_TAG_DETECTOR_DEFINITION__DEPRECATED && !myHaveWarnedAboutDeprecatedDetectorDefinition) { - myHaveWarnedAboutDeprecatedDetectorDefinition = true; - WRITE_WARNING("Using '" + toString(SUMO_TAG_DETECTOR_DEFINITION__DEPRECATED) + "' is deprecated. Please use '" + toString(SUMO_TAG_DETECTOR_DEFINITION) + "' instead."); - } - if (element == SUMO_TAG_DETECTOR_DEFINITION || element == SUMO_TAG_DETECTOR_DEFINITION__DEPRECATED) { + if (element == SUMO_TAG_DETECTOR_DEFINITION) { try { bool ok = true; // get the id, report an error if not given or empty... @@ -81,7 +76,7 @@ throw ProcessError(); } ROEdge* edge = myNet->getEdge(lane.substr(0, lane.rfind('_'))); - unsigned int laneIndex = TplConvertSec::_2intSec(lane.substr(lane.rfind('_') + 1).c_str(), INT_MAX); + unsigned int laneIndex = TplConvert::_2intSec(lane.substr(lane.rfind('_') + 1).c_str(), INT_MAX); if (edge == 0 || laneIndex >= edge->getLaneNo()) { throw ProcessError("Unknown lane '" + lane + "' for detector '" + id + "' in '" + getFileName() + "'."); } diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorHandler.h sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorHandler.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFDetectorHandler.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFDetectorHandler.h 2012-09-25 22:01:44.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFDetectorHandler.h 12599 2012-08-27 11:15:34Z dkrajzew $ /// // missing_desc /****************************************************************************/ @@ -53,7 +53,7 @@ const std::string& file); /// Destructor - virtual ~RODFDetectorHandler() ; + virtual ~RODFDetectorHandler(); protected: /// @name inherited from GenericSAXHandler @@ -67,7 +67,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} private: @@ -80,8 +80,6 @@ /// the container to put the detectors into RODFDetectorCon& myContainer; - bool myHaveWarnedAboutDeprecatedDetectorDefinition; - private: /// invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFEdge.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFEdge.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFEdge.cpp 2012-02-08 00:02:17.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdge.cpp 11844 2012-02-07 11:33:17Z namdre $ +/// @version $Id: RODFEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An edge within the DFROUTER /****************************************************************************/ @@ -30,7 +30,6 @@ #endif #include -#include #include #include "RODFEdge.h" @@ -50,12 +49,12 @@ void -RODFEdge::setFlows(const std::vector &flows) { +RODFEdge::setFlows(const std::vector& flows) { myFlows = flows; } -const std::vector & +const std::vector& RODFEdge::getFlows() const { return myFlows; } diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFEdge.h sumo-0.16.0~dfsg/src/dfrouter/RODFEdge.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFEdge.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFEdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdge.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFEdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An edge within the DFROUTER /****************************************************************************/ @@ -60,15 +60,15 @@ * @param[in] to The node the edge ends at * @param[in] index The numeric id of the edge */ - RODFEdge(const std::string& id, RONode* from, RONode* to, unsigned int index) ; + RODFEdge(const std::string& id, RONode* from, RONode* to, unsigned int index); /// @brief Destructor - ~RODFEdge() ; + ~RODFEdge(); - void setFlows(const std::vector &flows); + void setFlows(const std::vector& flows); - const std::vector &getFlows() const; + const std::vector& getFlows() const; private: diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFEdgeBuilder.h sumo-0.16.0~dfsg/src/dfrouter/RODFEdgeBuilder.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFEdgeBuilder.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFEdgeBuilder.h 2012-09-25 22:01:44.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdgeBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFEdgeBuilder.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Interface for building instances of dfrouter-edges /****************************************************************************/ @@ -56,11 +56,11 @@ class RODFEdgeBuilder : public ROAbstractEdgeBuilder { public: /// @brief Constructor - RODFEdgeBuilder() ; + RODFEdgeBuilder(); /// @brief Destructor - ~RODFEdgeBuilder() ; + ~RODFEdgeBuilder(); /// @name Methods to be implemented, inherited from ROAbstractEdgeBuilder @@ -76,7 +76,7 @@ * @return A proper instance of the named edge * @see RODFEdge */ - ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to) ; + ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to); /// @} diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFNet.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFNet.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFNet.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFNet.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFNet.cpp 12060 2012-03-12 12:10:36Z behrisch $ +/// @version $Id: RODFNet.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A DFROUTER-network /****************************************************************************/ @@ -29,6 +29,7 @@ #include #endif +#include #include #include #include @@ -66,7 +67,7 @@ void RODFNet::buildApproachList() { - const std::map &edges = getEdgeMap(); + const std::map& edges = getEdgeMap(); for (std::map::const_iterator rit = edges.begin(); rit != edges.end(); ++rit) { ROEdge* ce = (*rit).second; unsigned int i = 0; @@ -100,7 +101,7 @@ RODFNet::buildDetectorEdgeDependencies(RODFDetectorCon& detcont) const { myDetectorsOnEdges.clear(); myDetectorEdges.clear(); - const std::vector &dets = detcont.getDetectors(); + const std::vector& dets = detcont.getDetectors(); for (std::vector::const_iterator i = dets.begin(); i != dets.end(); ++i) { ROEdge* e = getDetectorEdge(**i); myDetectorsOnEdges[e].push_back((*i)->getID()); @@ -113,7 +114,7 @@ RODFNet::computeTypes(RODFDetectorCon& detcont, bool sourcesStrict) const { PROGRESS_BEGIN_MESSAGE("Computing detector types"); - const std::vector< RODFDetector*> &dets = detcont.getDetectors(); + const std::vector< RODFDetector*>& dets = detcont.getDetectors(); // build needed information. first buildDetectorEdgeDependencies(detcont); // compute detector types then @@ -153,7 +154,7 @@ RODFNet::hasInBetweenDetectorsOnly(ROEdge* edge, const RODFDetectorCon& detectors) const { assert(myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end()); - const std::vector &detIDs = myDetectorsOnEdges.find(edge)->second; + const std::vector& detIDs = myDetectorsOnEdges.find(edge)->second; std::vector::const_iterator i; for (i = detIDs.begin(); i != detIDs.end(); ++i) { const RODFDetector& det = detectors.getDetector(*i); @@ -169,7 +170,7 @@ RODFNet::hasSourceDetector(ROEdge* edge, const RODFDetectorCon& detectors) const { assert(myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end()); - const std::vector &detIDs = myDetectorsOnEdges.find(edge)->second; + const std::vector& detIDs = myDetectorsOnEdges.find(edge)->second; std::vector::const_iterator i; for (i = detIDs.begin(); i != detIDs.end(); ++i) { const RODFDetector& det = detectors.getDetector(*i); @@ -186,11 +187,11 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/, bool keepUnfoundEnds, bool keepShortestOnly, - std::vector &/*visited*/, + std::vector& /*visited*/, const RODFDetector& det, RODFRouteCont& into, const RODFDetectorCon& detectors, int maxFollowingLength, - std::vector &seen) const { + std::vector& seen) const { std::vector unfoundEnds; std::priority_queue, DFRouteDescByTimeComperator> toSolve; std::map > dets2Follow; @@ -291,7 +292,7 @@ } } // ... else: loop over the next edges - const std::vector &appr = myApproachedEdges.find(last)->second; + const std::vector& appr = myApproachedEdges.find(last)->second; bool hadOne = false; for (size_t i = 0; i < appr.size(); i++) { if (find(current.edges2Pass.begin(), current.edges2Pass.end(), appr[i]) != current.edges2Pass.end()) { @@ -348,7 +349,7 @@ buildDetectorEdgeDependencies(detcont); // then build the routes std::map doneEdges; - const std::vector< RODFDetector*> &dets = detcont.getDetectors(); + const std::vector< RODFDetector*>& dets = detcont.getDetectors(); for (std::vector< RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) { if ((*i)->getType() != SOURCE_DETECTOR) { // do not build routes for other than sources @@ -387,7 +388,7 @@ // add routes to in-between detectors if wished if (includeInBetween) { // go through the routes - const std::vector &r = routes->get(); + const std::vector& r = routes->get(); for (std::vector::const_iterator j = r.begin(); j != r.end(); ++j) { const RODFRouteDesc& mrd = *j; SUMOReal duration = mrd.duration_2; @@ -402,7 +403,7 @@ continue; } // get the detectors - const std::vector &dets = myDetectorsOnEdges.find(*k)->second; + 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); @@ -437,7 +438,7 @@ SUMOTime stepOffset) { { if (flows.knows(detector->getID())) { - const std::vector &detFlows = flows.getFlowDefs(detector->getID()); + const std::vector& detFlows = flows.getFlowDefs(detector->getID()); for (std::vector::const_iterator j = detFlows.begin(); j != detFlows.end(); ++j) { if ((*j).qPKW > 0 || (*j).qLKW > 0) { return; @@ -532,7 +533,7 @@ { // !! time difference is missing for (std::vector::iterator i = previous.begin(); i != previous.end(); ++i) { - const std::vector &flows = static_cast(*i)->getFlows(); + const std::vector& flows = static_cast(*i)->getFlows(); if (flows.size() != 0) { const FlowDef& srcFD = flows[index]; inFlow.qLKW += srcFD.qLKW; @@ -553,7 +554,7 @@ { // !! time difference is missing for (std::vector::iterator i = latter.begin(); i != latter.end(); ++i) { - const std::vector &flows = static_cast(*i)->getFlows(); + const std::vector& flows = static_cast(*i)->getFlows(); if (flows.size() != 0) { const FlowDef& srcFD = flows[index]; outFlow.qLKW += srcFD.qLKW; @@ -583,7 +584,7 @@ RODFDetectorFlows& flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset) { - const std::vector &dets = detectors.getDetectors(); + const std::vector& dets = detectors.getDetectors(); for (std::vector::const_iterator i = dets.begin(); i != dets.end(); ++i) { // check whether there is at least one entry with a flow larger than zero revalidateFlows(*i, flows, startTime, endTime, stepOffset); @@ -595,7 +596,7 @@ void RODFNet::removeEmptyDetectors(RODFDetectorCon& detectors, RODFDetectorFlows& flows) { - const std::vector &dets = detectors.getDetectors(); + const std::vector& dets = detectors.getDetectors(); for (std::vector::const_iterator i = dets.begin(); i != dets.end();) { bool remove = true; // check whether there is at least one entry with a flow larger than zero @@ -618,7 +619,7 @@ void RODFNet::reportEmptyDetectors(RODFDetectorCon& detectors, RODFDetectorFlows& flows) { - const std::vector &dets = detectors.getDetectors(); + const std::vector& dets = detectors.getDetectors(); for (std::vector::const_iterator i = dets.begin(); i != dets.end(); ++i) { bool remove = true; // check whether there is at least one entry with a flow larger than zero @@ -672,7 +673,7 @@ } -const std::vector & +const std::vector& RODFNet::getDetectorList(ROEdge* edge) const { return myDetectorsOnEdges.find(edge)->second; } @@ -710,7 +711,7 @@ bool RODFNet::isSource(const RODFDetector& det, ROEdge* edge, - std::vector &seen, + std::vector& seen, const RODFDetectorCon& detectors, bool strict) const { if (seen.size() == 1000) { // !!! @@ -720,7 +721,7 @@ if (edge == getDetectorEdge(det)) { // maybe there is another detector at the same edge // get the list of this/these detector(s) - const std::vector &detsOnEdge = myDetectorsOnEdges.find(edge)->second; + const std::vector& detsOnEdge = myDetectorsOnEdges.find(edge)->second; for (std::vector::const_iterator i = detsOnEdge.begin(); i != detsOnEdge.end(); ++i) { if ((*i) == det.getID()) { continue; @@ -752,7 +753,7 @@ } // the next is a hack for the A100 scenario... // We have to look into further edges herein edges - const std::vector &appr = myApproachingEdges.find(edge)->second; + const std::vector& appr = myApproachingEdges.find(edge)->second; size_t noOk = 0; size_t noFalse = 0; size_t noSkipped = 0; @@ -786,7 +787,7 @@ } // let's check the edges in front - const std::vector &appr = myApproachingEdges.find(edge)->second; + const std::vector& appr = myApproachingEdges.find(edge)->second; size_t noOk = 0; size_t noFalse = 0; size_t noSkipped = 0; @@ -812,7 +813,7 @@ bool -RODFNet::isDestination(const RODFDetector& det, ROEdge* edge, std::vector &seen, +RODFNet::isDestination(const RODFDetector& det, ROEdge* edge, std::vector& seen, const RODFDetectorCon& detectors) const { if (seen.size() == 1000) { // !!! WRITE_WARNING("Quitting checking for being a destination for detector '" + det.getID() + "' due to seen edge limit."); @@ -821,7 +822,7 @@ if (edge == getDetectorEdge(det)) { // maybe there is another detector at the same edge // get the list of this/these detector(s) - const std::vector &detsOnEdge = myDetectorsOnEdges.find(edge)->second; + const std::vector& detsOnEdge = myDetectorsOnEdges.find(edge)->second; for (std::vector::const_iterator i = detsOnEdge.begin(); i != detsOnEdge.end(); ++i) { if ((*i) == det.getID()) { continue; @@ -871,7 +872,7 @@ myDetectorEdges.find(det.getID())->second != edge) { return false; } - const std::vector &appr = myApproachedEdges.find(edge)->second; + const std::vector& appr = myApproachedEdges.find(edge)->second; bool isall = true; size_t no = 0; seen.push_back(edge); @@ -888,7 +889,7 @@ } bool -RODFNet::isFalseSource(const RODFDetector& det, ROEdge* edge, std::vector &seen, +RODFNet::isFalseSource(const RODFDetector& det, ROEdge* edge, std::vector& seen, const RODFDetectorCon& detectors) const { if (seen.size() == 1000) { // !!! WRITE_WARNING("Quitting checking for being a false source for detector '" + det.getID() + "' due to seen edge limit."); @@ -898,7 +899,7 @@ if (edge != getDetectorEdge(det)) { // ok, we are at one of the edges coming behind if (hasDetector(edge)) { - const std::vector &dets = myDetectorsOnEdges.find(edge)->second; + const std::vector& dets = myDetectorsOnEdges.find(edge)->second; for (std::vector::const_iterator i = dets.begin(); i != dets.end(); ++i) { if (detectors.getDetector(*i).getType() == SINK_DETECTOR) { return false; @@ -921,7 +922,7 @@ return false; } - const std::vector &appr = myApproachedEdges.find(edge)->second; + const std::vector& appr = myApproachedEdges.find(edge)->second; bool isall = false; for (size_t i = 0; i < appr.size() && !isall; i++) { //printf("checking %s->\n", appr[i].c_str()); @@ -944,7 +945,7 @@ std::map, idComp>::iterator i; for (i = myDetectorsOnEdges.begin(); i != myDetectorsOnEdges.end(); ++i) { ROEdge* into = (*i).first; - const std::vector &dets = (*i).second; + const std::vector& dets = (*i).second; std::map > cliques; std::vector* maxClique = 0; for (std::vector::const_iterator j = dets.begin(); j != dets.end(); ++j) { @@ -983,7 +984,7 @@ } for (std::vector::iterator l = maxClique->begin(); l != maxClique->end(); ++l) { bool didWarn = false; - const std::vector &dflows = flows.getFlowDefs(*l); + const std::vector& dflows = flows.getFlowDefs(*l); int index = 0; for (SUMOTime t = startTime; t < endTime; t += stepOffset, index++) { const FlowDef& srcFD = dflows[index]; @@ -1025,18 +1026,18 @@ // mark current detectors std::vector last; { - const std::vector &detNames = myDetectorsOnEdges.find((*i).second)->second; + const std::vector& detNames = myDetectorsOnEdges.find((*i).second)->second; for (std::vector::const_iterator j = detNames.begin(); j != detNames.end(); ++j) { last.push_back((RODFDetector*) &detectors.getDetector(*j)); } } // iterate over the current detector's routes - const std::vector &routes = det.getRouteVector(); + const std::vector& routes = det.getRouteVector(); for (std::vector::const_iterator j = routes.begin(); j != routes.end(); ++j) { - const std::vector &edges2Pass = (*j).edges2Pass; + const std::vector& edges2Pass = (*j).edges2Pass; for (std::vector::const_iterator k = edges2Pass.begin() + 1; k != edges2Pass.end(); ++k) { if (myDetectorsOnEdges.find(*k) != myDetectorsOnEdges.end()) { - const std::vector &detNames = myDetectorsOnEdges.find(*k)->second; + const std::vector& detNames = myDetectorsOnEdges.find(*k)->second; // ok, consecutive detector found for (std::vector::iterator l = last.begin(); l != last.end(); ++l) { // mark as follower of current @@ -1061,7 +1062,7 @@ buildDetectorEdgeDependencies(detectors); std::map, idComp>::iterator i; for (i = myDetectorsOnEdges.begin(); i != myDetectorsOnEdges.end(); ++i) { - const std::vector &dets = (*i).second; + const std::vector& dets = (*i).second; std::map > cliques; // compute detector cliques for (std::vector::const_iterator j = dets.begin(); j != dets.end(); ++j) { diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFNet.h sumo-0.16.0~dfsg/src/dfrouter/RODFNet.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFNet.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFNet.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFNet.h 12060 2012-03-12 12:10:36Z behrisch $ +/// @version $Id: RODFNet.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A DFROUTER-network /****************************************************************************/ @@ -53,11 +53,11 @@ /** @brief Constructor * @param[in] amInHighwayMode Whether search for following edges shall stop at slow edges */ - RODFNet(bool amInHighwayMode) ; + RODFNet(bool amInHighwayMode); /// @brief Destructor - ~RODFNet() ; + ~RODFNet(); void buildApproachList(); @@ -89,7 +89,7 @@ void mesoJoin(RODFDetectorCon& detectors, RODFDetectorFlows& flows); bool hasDetector(ROEdge* edge) const; - const std::vector &getDetectorList(ROEdge* edge) const; + const std::vector& getDetectorList(ROEdge* edge) const; protected: @@ -105,20 +105,20 @@ ROEdge* getDetectorEdge(const RODFDetector& det) const; bool isSource(const RODFDetector& det, ROEdge* edge, - std::vector &seen, const RODFDetectorCon& detectors, + std::vector& seen, const RODFDetectorCon& detectors, bool strict) const; bool isFalseSource(const RODFDetector& det, ROEdge* edge, - std::vector &seen, const RODFDetectorCon& detectors) const; - bool isDestination(const RODFDetector& det, ROEdge* edge, std::vector &seen, + std::vector& seen, const RODFDetectorCon& detectors) const; + bool isDestination(const RODFDetector& det, ROEdge* edge, std::vector& seen, const RODFDetectorCon& detectors) const; void computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int no, bool keepUnfoundEnds, bool keepShortestOnly, - std::vector &visited, const RODFDetector& det, + std::vector& visited, const RODFDetector& det, RODFRouteCont& into, const RODFDetectorCon& detectors, int maxFollowingLength, - std::vector &seen) const; + std::vector& seen) const; void buildDetectorEdgeDependencies(RODFDetectorCon& dets) const; @@ -153,7 +153,7 @@ private: /// @brief comparator for maps using edges as key, used only in myDetectorsOnEdges to make tests comparable struct idComp { - bool operator() (ROEdge* const lhs, ROEdge* const rhs) { + bool operator()(ROEdge* const lhs, ROEdge* const rhs) const { return lhs->getID() < rhs->getID(); } }; diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFRouteCont.cpp sumo-0.16.0~dfsg/src/dfrouter/RODFRouteCont.cpp --- sumo-0.15.0~dfsg/src/dfrouter/RODFRouteCont.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFRouteCont.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFRouteCont.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFRouteCont.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A container for routes /****************************************************************************/ @@ -79,7 +79,7 @@ bool -RODFRouteCont::save(std::vector &saved, +RODFRouteCont::save(std::vector& saved, const std::string& prependix, OutputDevice& out) { bool haveSavedOneAtLeast = false; for (std::vector::const_iterator j = myRoutes.begin(); j != myRoutes.end(); ++j) { @@ -89,14 +89,16 @@ } saved.push_back((*j).routename); assert(desc.edges2Pass.size() >= 1); - out << " ::const_iterator k = desc.edges2Pass.begin(); k != desc.edges2Pass.end(); k++) { if (k != desc.edges2Pass.begin()) { out << ' '; } out << (*k)->getID(); } - out << "\"/>\n"; + out << '"'; + out.closeTag(true); haveSavedOneAtLeast = true; } return haveSavedOneAtLeast; @@ -110,7 +112,7 @@ void -RODFRouteCont::removeIllegal(const std::vector > &illegals) { +RODFRouteCont::removeIllegal(const std::vector >& illegals) { for (std::vector::iterator i = myRoutes.begin(); i != myRoutes.end();) { RODFRouteDesc& desc = *i; bool remove = false; diff -Nru sumo-0.15.0~dfsg/src/dfrouter/RODFRouteCont.h sumo-0.16.0~dfsg/src/dfrouter/RODFRouteCont.h --- sumo-0.15.0~dfsg/src/dfrouter/RODFRouteCont.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/RODFRouteCont.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFRouteCont.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RODFRouteCont.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A container for routes /****************************************************************************/ @@ -63,10 +63,10 @@ class RODFRouteCont { public: /// @brief Constructor - RODFRouteCont() ; + RODFRouteCont(); /// @brief Destructor - ~RODFRouteCont() ; + ~RODFRouteCont(); /** @brief Adds a route to the container @@ -80,7 +80,7 @@ * @param[in] desc The route description to add * @see setID */ - void addRouteDesc(RODFRouteDesc& desc) ; + void addRouteDesc(RODFRouteDesc& desc); /** @brief Removes the given route description from the container @@ -92,7 +92,7 @@ * @return Whether the route was removed (a similar was found) * @see RODFRouteCont::route_finder */ - bool removeRouteDesc(RODFRouteDesc& desc) ; + bool removeRouteDesc(RODFRouteDesc& desc); /** @brief Saves routes @@ -103,14 +103,14 @@ * @return Whether at least one route was saved * @exception IOError not yet implemented */ - bool save(std::vector &saved, + bool save(std::vector& saved, const std::string& prependix, OutputDevice& out); /** @brief Returns the container of stored routes * @return The stored routes */ - std::vector &get() { + std::vector& get() { return myRoutes; } @@ -120,7 +120,7 @@ * Done using by_distance_sorter. * @see RODFRouteCont::by_distance_sorter */ - void sortByDistance() ; + void sortByDistance(); /** @brief Removes "illegal" routes @@ -130,12 +130,12 @@ * @param[in] illegals List of edge combinations that shall not be passed * @todo Not used, yet */ - void removeIllegal(const std::vector > &illegals) ; + void removeIllegal(const std::vector >& illegals); /** @brief All routes are replaced by their versions extended by follower edges */ - void addAllEndFollower() ; + void addAllEndFollower(); protected: @@ -146,7 +146,7 @@ * * @param[in] desc The route description to add */ - void setID(RODFRouteDesc& desc) const ; + void setID(RODFRouteDesc& desc) const; /** @brief A class for sorting route descriptions by their length */ @@ -179,6 +179,9 @@ /// @brief The route description for which a same shall be found const RODFRouteDesc& myDesc; + private: + /// @brief invalidated assignment operator + route_finder& operator=(const route_finder&); }; protected: diff -Nru sumo-0.15.0~dfsg/src/dfrouter/dfrouter_main.cpp sumo-0.16.0~dfsg/src/dfrouter/dfrouter_main.cpp --- sumo-0.15.0~dfsg/src/dfrouter/dfrouter_main.cpp 2012-02-18 00:03:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/dfrouter/dfrouter_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Thu, 16.03.2006 -/// @version $Id: dfrouter_main.cpp 11927 2012-02-17 10:03:39Z namdre $ +/// @version $Id: dfrouter_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for the DFROUTER /****************************************************************************/ @@ -64,7 +64,6 @@ #include "RODFRouteCont.h" #include "RODFDetectorFlow.h" #include "RODFDetFlowLoader.h" -#include #include #include @@ -206,7 +205,7 @@ oc.getBool("calibrator-output"), oc.getBool("include-unused-routes"), oc.getFloat("scale"), - oc.getInt("max-search-depth"), +// oc.getInt("max-search-depth"), oc.getBool("emissions-only")); PROGRESS_DONE_MESSAGE(); } @@ -261,14 +260,14 @@ RODFDetectorFlows* flows = 0; try { // initialise the application system (messaging, xml, options) - XMLSubSys::init(false); + XMLSubSys::init(); RODFFrame::fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!RODFFrame::checkOptions()) { throw ProcessError(); @@ -289,13 +288,19 @@ readDetectorFlows(*flows, oc, *detectors); // build routes startComputation(net, *flows, *detectors, oc); - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; @@ -304,7 +309,6 @@ delete net; delete flows; delete detectors; - OutputDevice::closeAll(); SystemFrame::close(); if (ret == 0) { std::cout << "Success." << std::endl; diff -Nru sumo-0.15.0~dfsg/src/duarouter/Makefile.am sumo-0.16.0~dfsg/src/duarouter/Makefile.am --- sumo-0.15.0~dfsg/src/duarouter/Makefile.am 2012-02-09 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/duarouter/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -12,8 +12,8 @@ duarouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/duarouter/Makefile.in sumo-0.16.0~dfsg/src/duarouter/Makefile.in --- sumo-0.15.0~dfsg/src/duarouter/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/duarouter/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -52,8 +52,8 @@ RODUAEdgeBuilder.$(OBJEXT) RODUAFrame.$(OBJEXT) duarouter_OBJECTS = $(am_duarouter_OBJECTS) duarouter_DEPENDENCIES = ../router/librouter.a \ - ../utils/options/liboptions.a ../utils/common/libcommon.a \ - ../utils/xml/libxml.a ../utils/importio/libimportio.a \ + ../utils/options/liboptions.a ../utils/xml/libxml.a \ + ../utils/common/libcommon.a ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../foreign/tcpip/libtcpip.a $(MEM_LIBS) duarouter_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @@ -108,6 +108,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -138,6 +139,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -172,6 +174,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -205,7 +208,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -233,8 +235,8 @@ duarouter_LDFLAGS = $(XERCES_LDFLAGS) duarouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/duarouter/RODUAEdgeBuilder.h sumo-0.16.0~dfsg/src/duarouter/RODUAEdgeBuilder.h --- sumo-0.15.0~dfsg/src/duarouter/RODUAEdgeBuilder.h 2012-02-08 00:02:18.000000000 +0000 +++ sumo-0.16.0~dfsg/src/duarouter/RODUAEdgeBuilder.h 2012-09-25 22:01:57.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: RODUAEdgeBuilder.h 11844 2012-02-07 11:33:17Z namdre $ +/// @version $Id: RODUAEdgeBuilder.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Interface for building instances of duarouter-edges /****************************************************************************/ @@ -61,11 +61,11 @@ * @param[in] interpolate Whether edges shall interpolate at interval boundaries * @todo useBoundariesOnOverride should not be a member of the edges */ - RODUAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate) ; + RODUAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate); /// @brief Destructor - ~RODUAEdgeBuilder() ; + ~RODUAEdgeBuilder(); /// @name Methods to be implemented, inherited from ROAbstractEdgeBuilder @@ -81,7 +81,7 @@ * @return A proper instance of the named edge * @see ROEdge */ - ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to) ; + ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to); /// @} diff -Nru sumo-0.15.0~dfsg/src/duarouter/RODUAFrame.cpp sumo-0.16.0~dfsg/src/duarouter/RODUAFrame.cpp --- sumo-0.15.0~dfsg/src/duarouter/RODUAFrame.cpp 2012-02-24 00:03:03.000000000 +0000 +++ sumo-0.16.0~dfsg/src/duarouter/RODUAFrame.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RODUAFrame.cpp 11946 2012-02-23 21:21:00Z behrisch $ +/// @version $Id: RODUAFrame.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Sets and checks options for dua-routing /****************************************************************************/ @@ -140,14 +140,36 @@ RODUAFrame::checkOptions() { OptionsCont& oc = OptionsCont::getOptions(); bool ok = ROFrame::checkOptions(oc); - ok &= (!oc.isSet("departlane") || SUMOVehicleParameter::departlaneValidate(oc.getString("departlane"))); - ok &= (!oc.isSet("departpos") || SUMOVehicleParameter::departposValidate(oc.getString("departpos"))); - ok &= (!oc.isSet("departspeed") || SUMOVehicleParameter::departspeedValidate(oc.getString("departspeed"))); - ok &= (!oc.isSet("arrivallane") || SUMOVehicleParameter::arrivallaneValidate(oc.getString("arrivallane"))); - ok &= (!oc.isSet("arrivalpos") || SUMOVehicleParameter::arrivalposValidate(oc.getString("arrivalpos"))); - ok &= (!oc.isSet("arrivalspeed") || SUMOVehicleParameter::arrivalspeedValidate(oc.getString("arrivalspeed"))); + + SUMOVehicleParameter p; + std::string error; + if (oc.isSet("departlane") && !SUMOVehicleParameter::parseDepartLane(oc.getString("departlane"), "option", "departlane", p.departLane, p.departLaneProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("departpos") && !SUMOVehicleParameter::parseDepartPos(oc.getString("departpos"), "option", "departpos", p.departPos, p.departPosProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("departspeed") && !SUMOVehicleParameter::parseDepartSpeed(oc.getString("departspeed"), "option", "departspeed", p.departSpeed, p.departSpeedProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivallane") && !SUMOVehicleParameter::parseArrivalLane(oc.getString("arrivallane"), "option", "arrivallane", p.arrivalLane, p.arrivalLaneProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivalpos") && !SUMOVehicleParameter::parseArrivalPos(oc.getString("arrivalpos"), "option", "arrivalpos", p.arrivalPos, p.arrivalPosProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivalspeed") && !SUMOVehicleParameter::parseArrivalSpeed(oc.getString("arrivalspeed"), "option", "arrivalspeed", p.arrivalSpeed, p.arrivalSpeedProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.getString("routing-algorithm") != "dijkstra" && oc.getString("weight-attribute") != "traveltime") { - WRITE_ERROR("Only routing algorithm 'dijkstra' supports weight-attribute '" + oc.getString("weight-attribute") + "'."); + WRITE_ERROR("Routing algorithm '" + oc.getString("routing-algorithm") + "' does not support weight-attribute '" + oc.getString("weight-attribute") + "'."); return false; } return ok; diff -Nru sumo-0.15.0~dfsg/src/duarouter/duarouter_main.cpp sumo-0.16.0~dfsg/src/duarouter/duarouter_main.cpp --- sumo-0.15.0~dfsg/src/duarouter/duarouter_main.cpp 2012-03-10 00:03:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/duarouter/duarouter_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 06 Jun 2002 -/// @version $Id: duarouter_main.cpp 12047 2012-03-09 14:37:20Z namdre $ +/// @version $Id: duarouter_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for DUAROUTER /****************************************************************************/ @@ -62,11 +62,11 @@ #include "RODUAFrame.h" #include -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff #include #include #include -#endif // have HAVE_MESOSIM +#endif // have HAVE_INTERNAL #ifdef CHECK_MEMORY_LEAKS #include @@ -110,7 +110,7 @@ // prepare the output net.openOutput(oc.getString("output-file"), true, oc.getString("vtype-output")); // build the router - SUMOAbstractRouter *router; + SUMOAbstractRouter* router; const std::string measure = oc.getString("weight-attribute"); const std::string routingAlgorithm = oc.getString("routing-algorithm"); if (measure == "traveltime") { @@ -130,7 +130,7 @@ router = new AStarRouterTT_Direct >( net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime); } -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff } else if (routingAlgorithm == "bulkstar") { if (net.hasRestrictions()) { router = new BulkStarRouterTT >( @@ -145,9 +145,9 @@ // it is mainly needed for its maximum speed. @todo XXX make this configurable ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID)); const SUMOTime begin = string2time(oc.getString("begin")); - const SUMOTime weightPeriod = (oc.isSet("weight-files") ? - string2time(oc.getString("weight-period")) : - std::numeric_limits::max()); + const SUMOTime weightPeriod = (oc.isSet("weight-files") ? + string2time(oc.getString("weight-period")) : + std::numeric_limits::max()); if (net.hasRestrictions()) { router = new CHRouter >( net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime, &defaultVehicle, begin, weightPeriod, true); @@ -158,17 +158,17 @@ } else if (routingAlgorithm == "CHWrapper") { const SUMOTime begin = string2time(oc.getString("begin")); - const SUMOTime weightPeriod = (oc.isSet("weight-files") ? - string2time(oc.getString("weight-period")) : - std::numeric_limits::max()); + const SUMOTime weightPeriod = (oc.isSet("weight-files") ? + string2time(oc.getString("weight-period")) : + std::numeric_limits::max()); if (!net.hasRestrictions()) { WRITE_WARNING("CHWrapper is only needed for a restricted network"); } router = new CHRouterWrapper >( - oc.getBool("ignore-errors"), &ROEdge::getTravelTime, begin, weightPeriod); + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime, begin, weightPeriod); -#endif // have HAVE_MESOSIM +#endif // have HAVE_INTERNAL } else { throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!"); } @@ -204,12 +204,14 @@ // process route definitions try { if (routingAlgorithm == "bulkstar") { +#ifdef HAVE_INTERNAL // catchall for internal stuff // need to load all routes for spatial aggregation loader.processAllRoutesWithBulkRouter(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, *router); +#endif } else if (!oc.getBool("unsorted-input")) { // the routes are sorted - process stepwise loader.processRoutesStepWise(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, *router); - } else { + } else { // the routes are not sorted: load all and process loader.processAllRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, *router); } @@ -238,14 +240,14 @@ int ret = 0; RONet* net = 0; try { - XMLSubSys::init(false); + XMLSubSys::init(); RODUAFrame::fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!RODUAFrame::checkOptions()) { throw ProcessError(); @@ -258,30 +260,35 @@ // build routes try { computeRoutes(*net, loader, oc); - } catch (SAXParseException& e) { + } catch (XERCES_CPP_NAMESPACE::SAXParseException& e) { WRITE_ERROR(toString(e.getLineNumber())); ret = 1; - } catch (SAXException& e) { - WRITE_ERROR(TplConvert::_2str(e.getMessage())); + } catch (XERCES_CPP_NAMESPACE::SAXException& e) { + WRITE_ERROR(TplConvert::_2str(e.getMessage())); ret = 1; } if (MsgHandler::getErrorInstance()->wasInformed() || ret != 0) { throw ProcessError(); } - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } delete net; - OutputDevice::closeAll(); SystemFrame::close(); if (ret == 0) { std::cout << "Success." << std::endl; diff -Nru sumo-0.15.0~dfsg/src/foreign/Makefile.in sumo-0.16.0~dfsg/src/foreign/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -109,6 +109,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -139,6 +140,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -173,6 +175,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -206,7 +209,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/foreign/gl2ps/Makefile.in sumo-0.16.0~dfsg/src/foreign/gl2ps/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/gl2ps/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/gl2ps/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -91,6 +91,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -121,6 +122,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -155,6 +157,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -188,7 +191,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/foreign/gl2ps/gl2ps.h sumo-0.16.0~dfsg/src/foreign/gl2ps/gl2ps.h --- sumo-0.15.0~dfsg/src/foreign/gl2ps/gl2ps.h 2012-01-07 19:53:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/gl2ps/gl2ps.h 2012-09-25 22:01:43.000000000 +0000 @@ -47,7 +47,9 @@ # pragma warning(disable:4115) # pragma warning(disable:4996) # endif +# define NOMINMAX # include +# undef NOMINMAX # if defined(GL2PSDLL) # if defined(GL2PSDLL_EXPORTS) # define GL2PSDLL_API __declspec(dllexport) diff -Nru sumo-0.15.0~dfsg/src/foreign/mersenne/Makefile.in sumo-0.16.0~dfsg/src/foreign/mersenne/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/mersenne/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/mersenne/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -69,6 +69,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -99,6 +100,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -133,6 +135,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -166,7 +169,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/foreign/mersenne/MersenneTwister.h sumo-0.16.0~dfsg/src/foreign/mersenne/MersenneTwister.h --- sumo-0.15.0~dfsg/src/foreign/mersenne/MersenneTwister.h 2012-01-07 19:53:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/mersenne/MersenneTwister.h 2012-09-25 22:01:43.000000000 +0000 @@ -125,6 +125,8 @@ friend std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ); friend std::istream& operator>>( std::istream& is, MTRand& mtrand ); + static uint32 hash( time_t t, clock_t c ); // !!! dk moved to public + protected: void initialize( const uint32 oneSeed ); void reload(); @@ -135,7 +137,6 @@ { return hiBit(u) | loBits(v); } uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const { return m ^ (mixBits(s0,s1)>>1) ^ (-loBit(s1) & 0x9908b0dfUL); } - static uint32 hash( time_t t, clock_t c ); }; @@ -282,7 +283,7 @@ } // Was not successful, so use time() and clock() instead - seed( hash( time(NULL), clock() ) ); + seed( hash( time(NULL), clock() ) ); } diff -Nru sumo-0.15.0~dfsg/src/foreign/nvwa/Makefile.in sumo-0.16.0~dfsg/src/foreign/nvwa/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/nvwa/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/nvwa/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -100,6 +100,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -130,6 +131,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -164,6 +166,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -197,7 +200,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/foreign/nvwa/debug_new.cpp sumo-0.16.0~dfsg/src/foreign/nvwa/debug_new.cpp --- sumo-0.15.0~dfsg/src/foreign/nvwa/debug_new.cpp 2012-01-07 19:53:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/nvwa/debug_new.cpp 2012-09-25 22:01:43.000000000 +0000 @@ -504,7 +504,7 @@ { fast_mutex_autolock lock(new_output_lock); fprintf(new_output_fp, - "new%s: allocated %p (size %u, ", + "new%s: allocated %p (size %lu, ", is_array ? "[]" : "", pointer, size); if (line != 0) @@ -553,7 +553,7 @@ msg = "delete after new[]"; fast_mutex_autolock lock(new_output_lock); fprintf(new_output_fp, - "%s: pointer %p (size %u)\n\tat ", + "%s: pointer %p (size %lu)\n\tat ", msg, (char*)ptr + ALIGNED_LIST_ITEM_SIZE, ptr->size); @@ -586,7 +586,7 @@ { fast_mutex_autolock lock(new_output_lock); fprintf(new_output_fp, - "delete%s: freed %p (size %u, %u bytes still allocated)\n", + "delete%s: freed %p (size %lu, %lu bytes still allocated)\n", is_array ? "[]" : "", (char*)ptr + ALIGNED_LIST_ITEM_SIZE, ptr->size, total_mem_alloc); @@ -624,7 +624,7 @@ } #endif fprintf(new_output_fp, - "Leaked object at %p (size %u, ", + "Leaked object at %p (size %lu, ", pointer, ptr->size); if (ptr->line != 0) @@ -668,7 +668,7 @@ { #endif fprintf(new_output_fp, - "Heap data corrupt near %p (size %u, ", + "Heap data corrupt near %p (size %lu, ", pointer, ptr->size); #if _DEBUG_NEW_TAILCHECK diff -Nru sumo-0.15.0~dfsg/src/foreign/nvwa/fast_mutex.h sumo-0.16.0~dfsg/src/foreign/nvwa/fast_mutex.h --- sumo-0.15.0~dfsg/src/foreign/nvwa/fast_mutex.h 2012-01-07 19:53:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/nvwa/fast_mutex.h 2012-09-25 22:01:43.000000000 +0000 @@ -181,7 +181,9 @@ # endif // _PTHREADS # ifdef _WIN32THREADS +# define NOMINMAX # include +# undef NOMINMAX /** * Macro alias to `volatile' semantics. Here it is truly volatile since * it is in a multi-threaded (Win32 threads) environment. diff -Nru sumo-0.15.0~dfsg/src/foreign/polyfonts/Makefile.in sumo-0.16.0~dfsg/src/foreign/polyfonts/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/polyfonts/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/polyfonts/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -92,6 +92,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -122,6 +123,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -156,6 +158,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -189,7 +192,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/foreign/polyfonts/pfPSansBold16.c sumo-0.16.0~dfsg/src/foreign/polyfonts/pfPSansBold16.c --- sumo-0.15.0~dfsg/src/foreign/polyfonts/pfPSansBold16.c 2008-06-12 01:02:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/polyfonts/pfPSansBold16.c 2012-09-25 22:01:44.000000000 +0000 @@ -26,7 +26,7 @@ #include "polyfonttypes.h" //#include "../sgl.h" -#ifdef _WIN32 +#ifdef WIN32 #include #endif diff -Nru sumo-0.15.0~dfsg/src/foreign/polyfonts/polyfonts.c sumo-0.16.0~dfsg/src/foreign/polyfonts/polyfonts.c --- sumo-0.15.0~dfsg/src/foreign/polyfonts/polyfonts.c 2010-12-15 00:02:47.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/polyfonts/polyfonts.c 2012-09-25 22:01:44.000000000 +0000 @@ -41,7 +41,7 @@ #include #include -#ifdef _WIN32 +#ifdef WIN32 #include #endif diff -Nru sumo-0.15.0~dfsg/src/foreign/rtree/LayeredRTree.h sumo-0.16.0~dfsg/src/foreign/rtree/LayeredRTree.h --- sumo-0.15.0~dfsg/src/foreign/rtree/LayeredRTree.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/rtree/LayeredRTree.h 2012-10-18 23:02:43.000000000 +0000 @@ -0,0 +1,137 @@ +/****************************************************************************/ +/// @file LayeredRTree.h +/// @author Jakob Erdmann +/// @date 16.10.2012 +/// @version $Id: LayeredRTree.h 12652 2012-09-03 11:11:04Z dkrajzew $ +/// +// A wrapper around RT-trees for for efficient storing of SUMO's GL-objects and +// accessing them ordered by their layer +// Note that we only need two layers at this time: +// 1 (GLO_LANE, GLO_VEHICLE, GLO_POI) +// 2 all the rest +// The search order returns layer 2 first because it must be drawn before layer +// 1 for alpha blending to work +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef LayeredRTree_h +#define LayeredRTree_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include + +#include "SUMORTree.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class LayeredRTree + * @brief A RT-tree for efficient storing of SUMO's GL-objects in layers + * + * This class maintains SUMORTrees for each layer (only 2 at the moment) but + * provides the same interface as SUMORTree + */ +class LayeredRTree : public SUMORTree { +public: + /// @brief Constructor + LayeredRTree() { + myLayers.push_back(new SUMORTree()); + myLayers.push_back(new SUMORTree()); + } + + + /// @brief Destructor + ~LayeredRTree() { + for (std::vector::iterator it = myLayers.begin(); it != myLayers.end(); ++it) { + delete *it; + } + myLayers.clear(); + } + + + /** @brief Insert entry (delegate to appropriate layer) + * @param a_min Min of bounding rect + * @param a_max Max of bounding rect + * @param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. + */ + void Insert(const float a_min[2], const float a_max[2], GUIGlObject* a_dataId) { + myLayers[selectLayer(a_dataId)]->Insert(a_min, a_max, a_dataId); + } + + + /** @brief Remove entry (delegate to appropriate layer) + * @param a_min Min of bounding rect + * @param a_max Max of bounding rect + * @param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. + */ + void Remove(const float a_min[2], const float a_max[2], GUIGlObject* a_dataId) { + myLayers[selectLayer(a_dataId)]->Remove(a_min, a_max, a_dataId); + } + + /** @brief Find all within search rectangle (searches all layers in order) + * @param a_min Min of search bounding rect + * @param a_max Max of search bounding rect + * @param a_searchResult Search result array. Caller should set grow size. Function will reset, not append to array. + * @param a_resultCallback Callback function to return result. Callback should return 'true' to continue searching + * @param a_context User context to pass as parameter to a_resultCallback + * @return Returns the number of entries found + */ + int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings& c) { + int result = 0; + for (std::vector::iterator it = myLayers.begin(); it != myLayers.end(); ++it) { + result += (*it)->Search(a_min, a_max, c); + } + return result; + } + + +protected: + /// @brief the layers for drawing + std::vector myLayers; + +private: + + /// @brief select the appropriate layer for each object + inline size_t selectLayer(GUIGlObject* o) { + switch (o->getType()) { + case GLO_EDGE: + case GLO_LANE: + case GLO_POI: + case GLO_VEHICLE: + case GLO_PERSON: + return 1; + break; + default: + return 0; + } + } + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/foreign/rtree/Makefile.am sumo-0.16.0~dfsg/src/foreign/rtree/Makefile.am --- sumo-0.15.0~dfsg/src/foreign/rtree/Makefile.am 2010-09-06 23:02:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/rtree/Makefile.am 2012-10-16 16:26:47.000000000 +0000 @@ -1 +1 @@ -EXTRA_DIST = RTree.h SUMORTree.h +EXTRA_DIST = RTree.h SUMORTree.h LayeredRTree.h diff -Nru sumo-0.15.0~dfsg/src/foreign/rtree/Makefile.in sumo-0.16.0~dfsg/src/foreign/rtree/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/rtree/Makefile.in 2012-03-14 00:11:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/rtree/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -69,6 +69,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -99,6 +100,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -133,6 +135,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -166,7 +169,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -186,7 +188,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -EXTRA_DIST = RTree.h SUMORTree.h +EXTRA_DIST = RTree.h SUMORTree.h LayeredRTree.h all: all-am .SUFFIXES: diff -Nru sumo-0.15.0~dfsg/src/foreign/rtree/RTree.h sumo-0.16.0~dfsg/src/foreign/rtree/RTree.h --- sumo-0.15.0~dfsg/src/foreign/rtree/RTree.h 2012-01-07 19:53:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/rtree/RTree.h 2012-09-25 22:01:42.000000000 +0000 @@ -85,13 +85,13 @@ /// \param a_min Min of bounding rect /// \param a_max Max of bounding rect /// \param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. - void Insert(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId); + virtual void Insert(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId); /// Remove entry /// \param a_min Min of bounding rect /// \param a_max Max of bounding rect /// \param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. - void Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId); + virtual void Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId); /// DK 15.10.2008 - begin @@ -104,7 +104,7 @@ /// \param a_resultCallback Callback function to return result. Callback should return 'true' to continue searching /// \param a_context User context to pass as parameter to a_resultCallback /// \return Returns the number of entries found - int Search(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const CONTEXT &c); + virtual int Search(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const CONTEXT &c); /// DK 15.10.2008 - end @@ -1053,8 +1053,8 @@ ELEMTYPEREAL increase; ELEMTYPEREAL bestIncr = (ELEMTYPEREAL)-1; ELEMTYPEREAL area; - ELEMTYPEREAL bestArea; - int best; + ELEMTYPEREAL bestArea = 0; + int best = 0; Rect tempRect; for(int index=0; index < a_node->m_count; ++index) @@ -1242,7 +1242,7 @@ ASSERT(a_parVars); ELEMTYPEREAL biggestDiff; - int group, chosen, betterGroup; + int group, chosen = 0, betterGroup = 0; InitParVars(a_parVars, a_parVars->m_branchCount, a_minFill); PickSeeds(a_parVars); diff -Nru sumo-0.15.0~dfsg/src/foreign/rtree/SUMORTree.h sumo-0.16.0~dfsg/src/foreign/rtree/SUMORTree.h --- sumo-0.15.0~dfsg/src/foreign/rtree/SUMORTree.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/rtree/SUMORTree.h 2012-10-16 16:26:47.000000000 +0000 @@ -2,9 +2,9 @@ /// @file SUMORTree.h /// @author Daniel Krajzewicz /// @date 27.10.2008 -/// @version $Id: SUMORTree.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SUMORTree.h 12840 2012-10-16 09:20:45Z namdre $ /// -// An rtree for networks +// A RT-tree for efficient storing of SUMO's GL-objects /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -33,6 +33,7 @@ #include #include #include +#include #include "RTree.h" @@ -51,16 +52,65 @@ // =========================================================================== // class definitions // =========================================================================== -class SUMORTree : public RTree, public Boundary +/** @class SUMORTree + * @brief A RT-tree for efficient storing of SUMO's GL-objects + * + * This class specialises the used RT-tree implementation from "rttree.h" and + * extends it by a mutex for avoiding parallel change and traversal of the tree. + */ +class SUMORTree : private RTree, public Boundary { public: + /// @brief Constructor SUMORTree() : RTree(&GUIGlObject::drawGL){ } - ~SUMORTree() { + + /// @brief Destructor + virtual ~SUMORTree() { + } + + + /** @brief Insert entry + * @param a_min Min of bounding rect + * @param a_max Max of bounding rect + * @param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. + * @see RTree::Insert + */ + virtual void Insert(const float a_min[2], const float a_max[2], GUIGlObject* a_dataId) { + AbstractMutex::ScopedLocker locker(myLock); + RTree::Insert(a_min, a_max, a_dataId); + } + + + /** @brief Remove entry + * @param a_min Min of bounding rect + * @param a_max Max of bounding rect + * @param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. + * @see RTree::Remove + */ + virtual void Remove(const float a_min[2], const float a_max[2], GUIGlObject* a_dataId) { + AbstractMutex::ScopedLocker locker(myLock); + RTree::Remove(a_min, a_max, a_dataId); } + + /** @brief Find all within search rectangle + * @param a_min Min of search bounding rect + * @param a_max Max of search bounding rect + * @param a_searchResult Search result array. Caller should set grow size. Function will reset, not append to array. + * @param a_resultCallback Callback function to return result. Callback should return 'true' to continue searching + * @param a_context User context to pass as parameter to a_resultCallback + * @return Returns the number of entries found + * @see RTree::Search + */ + virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings& c) { + AbstractMutex::ScopedLocker locker(myLock); + return RTree::Search(a_min, a_max, c); + } + + /** @brief Adds an additional object (detector/shape/trigger) for visualisation * @param[in] o The object to add */ @@ -71,6 +121,7 @@ Insert(cmin, cmax, o); } + /** @brief Removes an additional object (detector/shape/trigger) from being visualised * @param[in] o The object to remove */ @@ -81,6 +132,11 @@ Remove(cmin, cmax, o); } + +protected: + /// @brief A mutex avoiding parallel change and traversal of the tree + MFXMutex myLock; + }; diff -Nru sumo-0.15.0~dfsg/src/foreign/tcpip/Makefile.in sumo-0.16.0~dfsg/src/foreign/tcpip/Makefile.in --- sumo-0.15.0~dfsg/src/foreign/tcpip/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/tcpip/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -100,6 +100,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -130,6 +131,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -164,6 +166,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -197,7 +200,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/foreign/tcpip/socket.cpp sumo-0.16.0~dfsg/src/foreign/tcpip/socket.cpp --- sumo-0.15.0~dfsg/src/foreign/tcpip/socket.cpp 2012-01-07 19:53:48.000000000 +0000 +++ sumo-0.16.0~dfsg/src/foreign/tcpip/socket.cpp 2012-09-25 22:06:30.000000000 +0000 @@ -25,6 +25,7 @@ #include #include #include + #include #else #ifdef ERROR #undef ERROR @@ -613,8 +614,8 @@ /*----------------------------------------------------------------------- * Source $Source: $ -* Version $Revision: 612 $ -* Date $Date: 2011-06-14 15:16:52 +0200 (Di, 14. Jun 2011) $ +* Version $Revision: 645 $ +* Date $Date: 2012-04-27 14:03:33 +0200 (Fr, 27. Apr 2012) $ *----------------------------------------------------------------------- * $Log: $ *-----------------------------------------------------------------------*/ diff -Nru sumo-0.15.0~dfsg/src/gui/GUIApplicationWindow.cpp sumo-0.16.0~dfsg/src/gui/GUIApplicationWindow.cpp --- sumo-0.15.0~dfsg/src/gui/GUIApplicationWindow.cpp 2012-02-25 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUIApplicationWindow.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUIApplicationWindow.cpp 11954 2012-02-24 12:19:03Z namdre $ +/// @version $Id: GUIApplicationWindow.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The main window of the SUMO-gui. /****************************************************************************/ @@ -35,8 +35,6 @@ #include #endif -#include -#include #include #include #include @@ -56,24 +54,25 @@ #include #include +#include #include #include #include #include #include -#include "GUIGlobals.h" #include #include #include -#include "dialogs/GUIDialog_AboutSUMO.h" -#include "dialogs/GUIDialog_AppSettings.h" -#include "dialogs/GUIDialog_Breakpoints.h" #include #include #include #include #include #include +#include "GUIGlobals.h" +#include "dialogs/GUIDialog_AboutSUMO.h" +#include "dialogs/GUIDialog_AppSettings.h" +#include "dialogs/GUIDialog_Breakpoints.h" #ifndef NO_TRACI #include @@ -147,7 +146,9 @@ : GUIMainWindow(a), myLoadThread(0), myRunThread(0), myAmLoading(false), - mySimDelay(50), myConfigPattern(configPattern), hadDependentBuild(false), myRecentNets(a, "nets") { + mySimDelay(50), + myRecentNets(a, "nets"), myConfigPattern(configPattern), + hadDependentBuild(false) { GUIIconSubSys::init(a); } @@ -509,9 +510,9 @@ GUIIconSubSys::getIcon(ICON_MICROVIEW), this, MID_NEW_MICROVIEW, ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT); #ifdef HAVE_OSG - new FXButton(myToolBar5,"\t\tOpen a new 3D view.", + new FXButton(myToolBar5, "\t\tOpen a new 3D view.", GUIIconSubSys::getIcon(ICON_MICROVIEW), this, MID_NEW_OSGVIEW, - ICON_ABOVE_TEXT|BUTTON_TOOLBAR|FRAME_RAISED|LAYOUT_TOP|LAYOUT_LEFT); + ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT); #endif } } @@ -546,8 +547,7 @@ long GUIApplicationWindow::onCmdEditBreakpoints(FXObject*, FXSelector, void*) { - GUIDialog_Breakpoints* chooser = - new GUIDialog_Breakpoints(this); + GUIDialog_Breakpoints* chooser = new GUIDialog_Breakpoints(this); chooser->create(); chooser->show(); return 1; @@ -791,8 +791,7 @@ #ifdef HAVE_OSG long -GUIApplicationWindow::onCmdNewOSG(FXObject*,FXSelector,void*) -{ +GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector, void*) { openNewView(GUISUMOViewParent::VIEW_3D_OSG); return 1; } @@ -809,7 +808,7 @@ } -long GUIApplicationWindow::onClipboardRequest(FXObject* sender, FXSelector sel, void* ptr) { +long GUIApplicationWindow::onClipboardRequest(FXObject* /* sender */, FXSelector /* sel */, void* ptr) { FXEvent* event = (FXEvent*)ptr; FXString string = GUIUserIO::clipped.c_str(); setDNDData(FROM_CLIPBOARD, event->target, string); @@ -901,17 +900,28 @@ myWasStarted = false; // initialise views myViewNumber = 0; - GUISUMOAbstractView* view = openNewView(); - if (view && ec->mySettingsFile != "") { - GUISettingsHandler settings(ec->mySettingsFile); - std::string settingsName = settings.addSettings(view); - view->addDecals(settings.getDecals()); - settings.setViewport(view); - settings.setSnapshots(view); - if (settings.getDelay() > 0) { - mySimDelayTarget->setValue(settings.getDelay()); + + if (ec->mySettingsFiles.size() > 0) { + // open a view for each file and apply settings + for (std::vector::const_iterator it = ec->mySettingsFiles.begin(); + it != ec->mySettingsFiles.end(); ++it) { + GUISUMOAbstractView* view = openNewView(); + if (view == 0) { + break; + } + GUISettingsHandler settings(*it); + std::string settingsName = settings.addSettings(view); + view->addDecals(settings.getDecals()); + settings.setViewport(view); + settings.setSnapshots(view); + if (settings.getDelay() > 0) { + mySimDelayTarget->setValue(settings.getDelay()); + } } + } else { + openNewView(); } + if (isGaming()) { setTitle("SUMO Traffic Light Game"); } else { @@ -967,7 +977,7 @@ // build the text const std::string text = "Simulation ended at time: " + time2string(ec->getTimeStep()) + ".\nReason: " + MSNet::getStateMessage(ec->getReason()); - FXMessageBox::warning(this, MBOX_OK, "Simulation ended", text.c_str()); + FXMessageBox::warning(this, MBOX_OK, "Simulation ended", "%s", text.c_str()); } } @@ -1056,6 +1066,7 @@ myGeoCoordinate->setText("N/A"); myCartesianCoordinate->setText("N/A"); // + GUITexturesHelper::clearTextures(); update(); } diff -Nru sumo-0.15.0~dfsg/src/gui/GUIApplicationWindow.h sumo-0.16.0~dfsg/src/gui/GUIApplicationWindow.h --- sumo-0.15.0~dfsg/src/gui/GUIApplicationWindow.h 2012-01-24 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUIApplicationWindow.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIApplicationWindow.h 11769 2012-01-23 13:11:07Z dkrajzew $ +/// @version $Id: GUIApplicationWindow.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The main window of the SUMO-gui. /****************************************************************************/ @@ -179,7 +179,7 @@ #ifdef HAVE_OSG /// @brief Called if a new 3D view shall be opened - long onCmdNewOSG(FXObject*,FXSelector,void*); + long onCmdNewOSG(FXObject*, FXSelector, void*); #endif /// @brief Determines whether opening is enabled @@ -234,7 +234,7 @@ /** opens a new simulation display */ - GUISUMOAbstractView* openNewView(GUISUMOViewParent::ViewType vt=GUISUMOViewParent::VIEW_2D_OPENGL); + GUISUMOAbstractView* openNewView(GUISUMOViewParent::ViewType vt = GUISUMOViewParent::VIEW_2D_OPENGL); protected: /// FOX needs this for static members diff -Nru sumo-0.15.0~dfsg/src/gui/GUIEvent_SimulationLoaded.h sumo-0.16.0~dfsg/src/gui/GUIEvent_SimulationLoaded.h --- sumo-0.15.0~dfsg/src/gui/GUIEvent_SimulationLoaded.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUIEvent_SimulationLoaded.h 2012-09-25 22:01:40.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEvent_SimulationLoaded.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIEvent_SimulationLoaded.h 12428 2012-06-26 11:24:19Z behrisch $ /// // Event send when the simulation has been loaded by GUILadThread /****************************************************************************/ @@ -59,30 +59,33 @@ GUIEvent_SimulationLoaded(GUINet* net, SUMOTime startTime, SUMOTime endTime, const std::string& file, - const std::string& settingsFile) + const std::vector& settingsFiles) : GUIEvent(EVENT_SIMULATION_LOADED), myNet(net), myBegin(startTime), myEnd(endTime), - myFile(file), mySettingsFile(settingsFile) { } + myFile(file), mySettingsFiles(settingsFiles) { } /// destructor ~GUIEvent_SimulationLoaded() { } public: /// the loaded net - GUINet* myNet; + GUINet* myNet; /// the time the simulation shall start with - SUMOTime myBegin; + const SUMOTime myBegin; /// the time the simulation shall end with - SUMOTime myEnd; + const SUMOTime myEnd; /// the name of the loaded file - std::string myFile; + const std::string myFile; /// the name of the settings file to load - std::string mySettingsFile; + const std::vector mySettingsFiles; +private: + /// @brief Invalidated assignment operator + GUIEvent_SimulationLoaded& operator=(const GUIEvent_SimulationLoaded& s); }; diff -Nru sumo-0.15.0~dfsg/src/gui/GUILoadThread.cpp sumo-0.16.0~dfsg/src/gui/GUILoadThread.cpp --- sumo-0.15.0~dfsg/src/gui/GUILoadThread.cpp 2012-02-18 00:03:39.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUILoadThread.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILoadThread.cpp 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: GUILoadThread.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Class describing the thread that performs the loading of a simulation /****************************************************************************/ @@ -60,8 +60,8 @@ #include #include -#ifdef HAVE_MESOSIM -#include +#ifdef HAVE_INTERNAL +#include #endif #ifdef CHECK_MEMORY_LEAKS @@ -95,6 +95,7 @@ GUINet* net = 0; int simStartTime = 0; int simEndTime = 0; + std::vector guiSettingsFiles; OptionsCont& oc = OptionsCont::getOptions(); // within gui-based applications, nothing is reported to the console @@ -109,7 +110,7 @@ // try to load the given configuration if (!initOptions()) { // the options are not valid but maybe we want to quit - GUIGlobals::gQuitOnEnd = oc.getBool("quit-on-end"); + GUIGlobals::gQuitOnEnd = oc.getBool("quit-on-end"); submitEndAndCleanup(net, simStartTime, simEndTime); return 0; } @@ -117,6 +118,7 @@ MsgHandler::initOutputOptions(); GUIGlobals::gRunAfterLoad = oc.getBool("start"); GUIGlobals::gQuitOnEnd = oc.getBool("quit-on-end"); + if (!MSFrame::checkOptions()) { MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); submitEndAndCleanup(net, simStartTime, simEndTime); @@ -125,22 +127,23 @@ // initialise global settings RandHelper::initRandGlobal(); + RandHelper::initRandGlobal(&MSVehicleControl::myVehicleParamsRNG); MSFrame::setMSGlobals(oc); gAllowTextures = !oc.getBool("disable-textures"); MSVehicleControl* vehControl = 0; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL GUIVisualizationSettings::UseMesoSim = MSGlobals::gUseMesoSim; if (MSGlobals::gUseMesoSim) { - vehControl = new MEVehicleControl(); - } else + vehControl = new GUIMEVehicleControl(); + } else #endif vehControl = new GUIVehicleControl(); - + net = new GUINet( - vehControl, - new GUIEventControl(), - new GUIEventControl(), - new GUIEventControl()); + vehControl, + new GUIEventControl(), + new GUIEventControl(), + new GUIEventControl()); GUIEdgeControlBuilder* eb = new GUIEdgeControlBuilder(); GUIDetectorBuilder db(*net); NLJunctionControlBuilder jb(*net, db); @@ -158,6 +161,7 @@ net->initGUIStructures(); simStartTime = string2time(oc.getString("begin")); simEndTime = string2time(oc.getString("end")); + guiSettingsFiles = oc.getStringVector("gui-settings-file"); } } catch (ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { @@ -177,7 +181,7 @@ MSNet::clearAll(); } delete eb; - submitEndAndCleanup(net, simStartTime, simEndTime); + submitEndAndCleanup(net, simStartTime, simEndTime, guiSettingsFiles); return 0; } @@ -186,14 +190,14 @@ void GUILoadThread::submitEndAndCleanup(GUINet* net, SUMOTime simStartTime, - SUMOTime simEndTime) { + SUMOTime simEndTime, + const std::vector& guiSettingsFiles) { // remove message callbacks MsgHandler::getErrorInstance()->removeRetriever(myErrorRetriever); MsgHandler::getWarningInstance()->removeRetriever(myWarningRetriever); MsgHandler::getMessageInstance()->removeRetriever(myMessageRetriever); // inform parent about the process - GUIEvent* e = new GUIEvent_SimulationLoaded(net, simStartTime, simEndTime, myFile, - OptionsCont::getOptions().getString("gui-settings-file")); + GUIEvent* e = new GUIEvent_SimulationLoaded(net, simStartTime, simEndTime, myFile, guiSettingsFiles); myEventQue.add(e); myEventThrow.signal(); } diff -Nru sumo-0.15.0~dfsg/src/gui/GUILoadThread.h sumo-0.16.0~dfsg/src/gui/GUILoadThread.h --- sumo-0.15.0~dfsg/src/gui/GUILoadThread.h 2012-01-15 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUILoadThread.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILoadThread.h 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUILoadThread.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Class describing the thread that performs the loading of a simulation /****************************************************************************/ @@ -82,7 +82,8 @@ * This method is called both on success and failure. * All message callbacks to this instance are removed and the parent * application is informed about the loading */ - void submitEndAndCleanup(GUINet* net, SUMOTime simStartTime, SUMOTime simEndTime); + void submitEndAndCleanup(GUINet* net, SUMOTime simStartTime, SUMOTime simEndTime, + const std::vector& guiSettingsFiles = std::vector()); protected: /// the parent window to inform about the loading diff -Nru sumo-0.15.0~dfsg/src/gui/GUIRunThread.h sumo-0.16.0~dfsg/src/gui/GUIRunThread.h --- sumo-0.15.0~dfsg/src/gui/GUIRunThread.h 2012-01-15 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUIRunThread.h 2012-09-25 22:01:40.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIRunThread.h 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUIRunThread.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The thread that runs the simulation /****************************************************************************/ @@ -108,7 +108,7 @@ void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg); protected: - void makeStep() ; + void makeStep(); protected: /// the loaded simulation network diff -Nru sumo-0.15.0~dfsg/src/gui/GUISUMOViewParent.cpp sumo-0.16.0~dfsg/src/gui/GUISUMOViewParent.cpp --- sumo-0.15.0~dfsg/src/gui/GUISUMOViewParent.cpp 2012-03-03 00:03:26.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUISUMOViewParent.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Laura Bieker /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOViewParent.cpp 11993 2012-03-02 06:40:36Z behrisch $ +/// @version $Id: GUISUMOViewParent.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A single child window which contains a view of the simulation area /****************************************************************************/ @@ -79,7 +79,8 @@ FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GUISUMOViewParent::onCmdLocate), - FXMAPFUNC(SEL_COMMAND, MID_LOCATESHAPE, GUISUMOViewParent::onCmdLocate), + FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GUISUMOViewParent::onCmdLocate), + FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_SIMSTEP, GUISUMOViewParent::onSimStep), }; @@ -103,15 +104,15 @@ GUISUMOAbstractView* GUISUMOViewParent::init(FXGLCanvas* share, GUINet& net, GUISUMOViewParent::ViewType type) { - switch(type) { - default: - case VIEW_2D_OPENGL: - myView = new GUIViewTraffic(myContentFrame, *myParent, this, net, myParent->getGLVisual(), share); - break; + switch (type) { + default: + case VIEW_2D_OPENGL: + myView = new GUIViewTraffic(myContentFrame, *myParent, this, net, myParent->getGLVisual(), share); + break; #ifdef HAVE_OSG - case VIEW_3D_OSG: - myView = new GUIOSGView(myContentFrame, *myParent, this, net, myParent->getGLVisual(), share); - break; + case VIEW_3D_OSG: + myView = new GUIOSGView(myContentFrame, *myParent, this, net, myParent->getGLVisual(), share); + break; #endif } myView->buildViewToolBars(*this); @@ -150,7 +151,7 @@ std::string file = opendialog.getFilename().text(); std::string error = myView->makeSnapshot(file); if (error != "") { - FXMessageBox::error(this, MBOX_OK, "Saving failed.", error.c_str()); + FXMessageBox::error(this, MBOX_OK, "Saving failed.", "%s", error.c_str()); } return 1; } @@ -193,11 +194,17 @@ icon = ICON_LOCATEADD; title = "Additional Objects Chooser"; break; - case MID_LOCATESHAPE: - type = GLO_SHAPE; - ids = static_cast(GUINet::getInstance()->getShapeContainer()).getShapeIDs(); + case MID_LOCATEPOI: + type = GLO_POI; + ids = static_cast(GUINet::getInstance()->getShapeContainer()).getPOIIds(); icon = ICON_LOCATESHAPE; - title = "Shape Chooser"; + title = "POI Chooser"; + break; + case MID_LOCATEPOLY: + type = GLO_POLYGON; + ids = static_cast(GUINet::getInstance()->getShapeContainer()).getPolygonIDs(); + icon = ICON_LOCATESHAPE; + title = "Polygon Chooser"; break; default: throw ProcessError("Unknown Message ID in onCmdLocate"); @@ -228,7 +235,10 @@ return true; } else if (type == GLO_EDGE) { GUIEdge* edge = dynamic_cast(o); - assert(edge); + if (edge == 0) { + // hmph, just some security stuff + return false; + } size_t noLanes = edge->getLanes().size(); for (size_t j = 0; j < noLanes; ++j) { const GUILaneWrapper& l = edge->getLaneGeometry(j); diff -Nru sumo-0.15.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.cpp sumo-0.16.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.cpp --- sumo-0.15.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct/Nov 2003 -/// @version $Id: GUITLLogicPhasesTrackerWindow.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITLLogicPhasesTrackerWindow.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A window displaying the phase diagram of a tl-logic /****************************************************************************/ @@ -30,7 +30,6 @@ #include #endif -#include #include #include #include @@ -43,12 +42,7 @@ #include #include #include - -#ifdef _WIN32 -#include -#endif - -#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -159,7 +153,7 @@ GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow( GUIMainWindow& app, MSTrafficLightLogic& logic, GUITrafficLightLogicWrapper& wrapper, - ValueSource > *src) + ValueSource >* src) : FXMainWindow(app.getApp(), "TLS-Tracker", NULL, NULL, DECOR_ALL, 20, 20, 300, 200), myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(true) { @@ -344,7 +338,7 @@ // disable value addition while drawing myLock.lock(); // determine the initial offset - SUMOReal x = ((SUMOReal) 31. / width) ; + SUMOReal x = ((SUMOReal) 31. / width); SUMOReal ta = (SUMOReal) leftOffset / width; ta *= (SUMOReal)(((width - 31.0) / ((SUMOReal)(myLastTime - myBeginTime)))); x += ta; diff -Nru sumo-0.15.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.h sumo-0.16.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.h --- sumo-0.15.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUITLLogicPhasesTrackerWindow.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct/Nov 2003 -/// @version $Id: GUITLLogicPhasesTrackerWindow.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITLLogicPhasesTrackerWindow.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A window displaying the phase diagram of a tl-logic /****************************************************************************/ @@ -76,7 +76,7 @@ */ GUITLLogicPhasesTrackerWindow(GUIMainWindow& app, MSTrafficLightLogic& logic, GUITrafficLightLogicWrapper& wrapper, - ValueSource > *src) ; + ValueSource >* src); /** @brief Constructor to show the complete phase diagram @@ -88,11 +88,11 @@ GUITLLogicPhasesTrackerWindow( GUIMainWindow& app, MSTrafficLightLogic& logic, GUITrafficLightLogicWrapper& wrapper, - const MSSimpleTrafficLightLogic::Phases& phases) ; + const MSSimpleTrafficLightLogic::Phases& phases); /// @brief Destructor - ~GUITLLogicPhasesTrackerWindow() ; + ~GUITLLogicPhasesTrackerWindow(); /// @brief Creates the window (FOX-Toolkit) @@ -102,13 +102,13 @@ /** @brief Adds a further phase definition * @param[in] def The definition to add */ - void addValue(std::pair def) ; + void addValue(std::pair def); /** @brief Sets the time the display shall be shown as beginning at * @param[in] time The time to start to show the phases from */ - void setBeginTime(SUMOTime time) ; + void setBeginTime(SUMOTime time); /// @name FOX-callbacks @@ -148,10 +148,10 @@ * @param[in] parent This panel's logial parent */ GUITLLogicPhasesTrackerPanel(FXComposite* c, - GUIMainWindow& app, GUITLLogicPhasesTrackerWindow& parent) ; + GUIMainWindow& app, GUITLLogicPhasesTrackerWindow& parent); /// @brief Destructor - ~GUITLLogicPhasesTrackerPanel() ; + ~GUITLLogicPhasesTrackerPanel(); /// needed to update friend class GUITLLogicPhasesTrackerWindow; @@ -185,7 +185,7 @@ /** @brief Draws all values * @param[in] The target panel */ - void drawValues(GUITLLogicPhasesTrackerPanel& caller) ; + void drawValues(GUITLLogicPhasesTrackerPanel& caller); private: @@ -228,7 +228,7 @@ SUMOTime myLastTime; /// @brief The connector for retrieval of further phases - GLObjectValuePassConnector > *myConnector; + GLObjectValuePassConnector >* myConnector; /// @brief Information whether the tracking mode is on bool myAmInTrackingMode; diff -Nru sumo-0.15.0~dfsg/src/gui/GUIViewTraffic.cpp sumo-0.16.0~dfsg/src/gui/GUIViewTraffic.cpp --- sumo-0.15.0~dfsg/src/gui/GUIViewTraffic.cpp 2012-02-14 00:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/GUIViewTraffic.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUIViewTraffic.cpp 11882 2012-02-13 09:31:35Z namdre $ +/// @version $Id: GUIViewTraffic.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A view on the simulation; this view is a microscopic one /****************************************************************************/ @@ -63,13 +63,7 @@ #include #include #include - -#ifdef _WIN32 -#include -#endif - -#include -#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -97,7 +91,7 @@ GUIViewTraffic::buildViewToolBars(GUIGlChildWindow& v) { // build coloring tools { - const std::vector &names = gSchemeStorage.getNames(); + const std::vector& names = gSchemeStorage.getNames(); for (std::vector::const_iterator i = names.begin(); i != names.end(); ++i) { v.getColoringSchemesCombo().appendItem((*i).c_str()); if ((*i) == myVisualizationSettings->name) { @@ -118,11 +112,11 @@ ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); if (!MSGlobals::gUseMesoSim) { // there are no gui-vehicles in mesosim - // for vehicles + // for vehicles new FXButton(v.getLocatorPopup(), - "\tLocate Vehicle\tLocate a vehicle within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, - ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); + "\tLocate Vehicle\tLocate a vehicle within the network.", + GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, + ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } // for tls new FXButton(v.getLocatorPopup(), @@ -134,10 +128,15 @@ "\tLocate Additional\tLocate an additional structure within the network.", GUIIconSubSys::getIcon(ICON_LOCATEADD), &v, MID_LOCATEADD, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); - // for shapes + // for pois + new FXButton(v.getLocatorPopup(), + "\tLocate POI\tLocate a POI within the network.", + GUIIconSubSys::getIcon(ICON_LOCATESHAPE), &v, MID_LOCATEPOI, + ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); + // for polygons new FXButton(v.getLocatorPopup(), - "\tLocate Shape\tLocate a shape within the network.", - GUIIconSubSys::getIcon(ICON_LOCATESHAPE), &v, MID_LOCATESHAPE, + "\tLocate Polygon\tLocate a Polygon within the network.", + GUIIconSubSys::getIcon(ICON_LOCATESHAPE), &v, MID_LOCATEPOLY, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } @@ -246,7 +245,7 @@ void GUIViewTraffic::onGamingClick(Position pos) { MSTLLogicControl& tlsControl = MSNet::getInstance()->getTLSControl(); - const std::vector &logics = tlsControl.getAllLogics(); + const std::vector& logics = tlsControl.getAllLogics(); MSTrafficLightLogic* minTll = 0; SUMOReal minDist = std::numeric_limits::infinity(); for (std::vector::const_iterator i = logics.begin(); i != logics.end(); ++i) { diff -Nru sumo-0.15.0~dfsg/src/gui/Makefile.in sumo-0.16.0~dfsg/src/gui/Makefile.in --- sumo-0.15.0~dfsg/src/gui/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -143,6 +143,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -173,6 +174,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -207,6 +209,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -240,7 +243,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/gui/TraCIServerAPI_GUI.cpp sumo-0.16.0~dfsg/src/gui/TraCIServerAPI_GUI.cpp --- sumo-0.15.0~dfsg/src/gui/TraCIServerAPI_GUI.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/TraCIServerAPI_GUI.cpp 2012-09-25 22:01:40.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_GUI.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TraCIServerAPI_GUI.cpp 12721 2012-09-17 07:01:56Z dkrajzew $ /// // APIs for getting/setting GUI values via TraCI /****************************************************************************/ @@ -60,7 +60,6 @@ bool TraCIServerAPI_GUI::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) throw(TraCIException, std::invalid_argument) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -116,7 +115,7 @@ break; } } - server.writeStatusCmd(CMD_GET_GUI_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_GUI_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -238,7 +237,7 @@ } -GUISUMOAbstractView* const +GUISUMOAbstractView* TraCIServerAPI_GUI::getNamedView(const std::string& id) { GUIMainWindow* mw = static_cast(getMainWindow()); if (mw == 0) { diff -Nru sumo-0.15.0~dfsg/src/gui/TraCIServerAPI_GUI.h sumo-0.16.0~dfsg/src/gui/TraCIServerAPI_GUI.h --- sumo-0.15.0~dfsg/src/gui/TraCIServerAPI_GUI.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/TraCIServerAPI_GUI.h 2012-09-25 22:01:40.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_GUI.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TraCIServerAPI_GUI.h 12643 2012-09-01 21:00:18Z behrisch $ /// // APIs for getting/setting GUI values via TraCI /****************************************************************************/ @@ -78,14 +78,14 @@ /** @brief Returns the main window * @return The main window (should exist) */ - static GUIMainWindow* getMainWindow() ; + static GUIMainWindow* getMainWindow(); /** @brief Returns the named view * @param[in] viewName The name of the view * @return The named view if existing, 0 otherwise */ - static GUISUMOAbstractView* const getNamedView(const std::string& id) ; + static GUISUMOAbstractView* getNamedView(const std::string& id); private: /// @brief invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.h sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.h --- sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.h 2012-09-25 22:01:40.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GUIDialog_AboutSUMO.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_AboutSUMO.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The application's "About" - dialog /****************************************************************************/ @@ -50,11 +50,11 @@ * @param[in] x x-position of the window to use * @param[in] y y-position of the window to use */ - GUIDialog_AboutSUMO(FXWindow* parent, const char* name, int x, int y) ; + GUIDialog_AboutSUMO(FXWindow* parent, const char* name, int x, int y); /// @brief Destructor - ~GUIDialog_AboutSUMO() ; + ~GUIDialog_AboutSUMO(); /** @brief Creates the widget (and the icons) diff -Nru sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_AppSettings.h sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_AppSettings.h --- sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_AppSettings.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_AppSettings.h 2012-09-25 22:01:40.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 08.03.2004 -/// @version $Id: GUIDialog_AppSettings.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_AppSettings.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The application-settings dialog /****************************************************************************/ @@ -50,10 +50,10 @@ * * @param[in] parent The parent window */ - GUIDialog_AppSettings(FXMainWindow* parent) ; + GUIDialog_AppSettings(FXMainWindow* parent); /// @brief Destructor - ~GUIDialog_AppSettings() ; + ~GUIDialog_AppSettings(); diff -Nru sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.cpp sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.cpp --- sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2012-01-15 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 17 Jun 2004 -/// @version $Id: GUIDialog_Breakpoints.cpp 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUIDialog_Breakpoints.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Editor for simulation breakpoints /****************************************************************************/ @@ -154,7 +154,7 @@ long GUIDialog_Breakpoints::onCmdLoad(FXObject*, FXSelector, void*) { - FXFileDialog opendialog(this, "Save Breakpoints"); + FXFileDialog opendialog(this, "Load Breakpoints"); opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("*.txt"); @@ -168,11 +168,16 @@ while (strm.good()) { std::string val; strm >> val; + if (val.length() == 0) { + continue; + } try { SUMOTime value = string2time(val); GUIGlobals::gBreakpoints.push_back(value); } catch (NumberFormatException&) { WRITE_ERROR(" A breakpoint-value must be an int, is:" + val); + } catch (ProcessError&) { + WRITE_ERROR(" Could not decode breakpoint '" + val + "'"); } catch (EmptyData&) {} } rebuildList(); @@ -193,7 +198,7 @@ dev << content; dev.close(); } catch (IOError& e) { - FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); + FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); } return 1; } @@ -248,7 +253,7 @@ GUIGlobals::gBreakpoints[row] = string2time(value); } catch (NumberFormatException&) { std::string msg = "The value must be an int, is:" + value; - FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); } break; default: diff -Nru sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.h sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.h --- sumo-0.15.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/dialogs/GUIDialog_Breakpoints.h 2012-09-25 22:01:40.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Thu, 17 Jun 2004 -/// @version $Id: GUIDialog_Breakpoints.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_Breakpoints.h 12725 2012-09-17 10:37:29Z dkrajzew $ /// // Editor for simulation breakpoints /****************************************************************************/ @@ -56,14 +56,16 @@ class GUIDialog_Breakpoints : public FXMainWindow { // FOX-declarations FXDECLARE(GUIDialog_Breakpoints) + public: /** @brief Constructor * @param[in] parent The parent window */ - GUIDialog_Breakpoints(GUIMainWindow* parent) ; + GUIDialog_Breakpoints(GUIMainWindow* parent); + /// @brief Destructor - ~GUIDialog_Breakpoints() ; + ~GUIDialog_Breakpoints(); @@ -89,12 +91,12 @@ private: /// @brief Rebuilds the entire list - void rebuildList() ; + void rebuildList(); /** @brief Builds a text representation of the items in the list * @return Breakpoints encoded as a string */ - std::string encode2TXT() ; + std::string encode2TXT(); private: diff -Nru sumo-0.15.0~dfsg/src/gui/dialogs/Makefile.in sumo-0.16.0~dfsg/src/gui/dialogs/Makefile.in --- sumo-0.15.0~dfsg/src/gui/dialogs/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/gui/dialogs/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/guinetload/GUIDetectorBuilder.cpp sumo-0.16.0~dfsg/src/guinetload/GUIDetectorBuilder.cpp --- sumo-0.15.0~dfsg/src/guinetload/GUIDetectorBuilder.cpp 2012-02-07 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/GUIDetectorBuilder.cpp 2012-09-25 22:01:45.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 22 Jul 2003 -/// @version $Id: GUIDetectorBuilder.cpp 11836 2012-02-06 15:48:56Z behrisch $ +/// @version $Id: GUIDetectorBuilder.cpp 12167 2012-03-23 08:37:12Z behrisch $ /// // Builds detectors for guisim /****************************************************************************/ @@ -42,7 +42,7 @@ #include #include "GUIDetectorBuilder.h" -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #endif @@ -76,7 +76,7 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL MEInductLoop* GUIDetectorBuilder::createMEInductLoop(const std::string& id, MESegment* s, SUMOReal pos) { diff -Nru sumo-0.15.0~dfsg/src/guinetload/GUIDetectorBuilder.h sumo-0.16.0~dfsg/src/guinetload/GUIDetectorBuilder.h --- sumo-0.15.0~dfsg/src/guinetload/GUIDetectorBuilder.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/GUIDetectorBuilder.h 2012-09-25 22:01:45.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 22 Jul 2003 -/// @version $Id: GUIDetectorBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDetectorBuilder.h 12588 2012-08-24 07:36:30Z dkrajzew $ /// // Builds detectors for guisim /****************************************************************************/ @@ -59,11 +59,11 @@ * * @param[in] net The network to which's detector control built detector shall be added */ - GUIDetectorBuilder(MSNet& net) ; + GUIDetectorBuilder(MSNet& net); /// @brief Destructor - ~GUIDetectorBuilder() ; + ~GUIDetectorBuilder(); /// @name Detector creating methods @@ -81,7 +81,7 @@ * @param[in] splitByType Whether additional information split by vehicle classes shall be generated */ virtual MSDetectorFileOutput* createInductLoop(const std::string& id, - MSLane* lane, SUMOReal pos, bool splitByType) ; + MSLane* lane, SUMOReal pos, bool splitByType); /** @brief Creates an instance of an e1 detector using the given values @@ -94,10 +94,10 @@ * @param[in] od The output device the loop shall use */ virtual MSDetectorFileOutput* createInstantInductLoop(const std::string& id, - MSLane* lane, SUMOReal pos, OutputDevice& od) ; + MSLane* lane, SUMOReal pos, OutputDevice& od); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /** @brief Creates an instance of a mesoscopic e1 detector using the given values * * Simply calls the MEInductLoop constructor @@ -108,11 +108,11 @@ * @todo Position is not used, herein!? */ virtual MEInductLoop* createMEInductLoop(const std::string& id, - MESegment* s, SUMOReal pos) ; + MESegment* s, SUMOReal pos); #endif - /** @brief Creates an instance of an e2-detector using the given values + /** @brief Creates an instance of an e2-detector (areal detector) using the given values * * Simply calls the GUI_E2_ZS_Collector constructor * @@ -128,7 +128,7 @@ DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /** @brief Creates an instance of an e2ol-detector using the given values @@ -148,7 +148,7 @@ const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /** @brief Creates an instance of an e3 detector using the given values @@ -165,7 +165,7 @@ const CrossSectionVector& entries, const CrossSectionVector& exits, SUMOReal haltingSpeedThreshold, - SUMOTime haltingTimeThreshold) ; + SUMOTime haltingTimeThreshold); /// @} diff -Nru sumo-0.15.0~dfsg/src/guinetload/GUIEdgeControlBuilder.cpp sumo-0.16.0~dfsg/src/guinetload/GUIEdgeControlBuilder.cpp --- sumo-0.15.0~dfsg/src/guinetload/GUIEdgeControlBuilder.cpp 2012-03-08 00:03:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/GUIEdgeControlBuilder.cpp 2012-11-15 00:02:17.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEdgeControlBuilder.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: GUIEdgeControlBuilder.cpp 12980 2012-11-14 22:47:35Z behrisch $ /// // Derivation of NLEdgeControlBuilder which build gui-edges /****************************************************************************/ @@ -73,7 +73,7 @@ SUMOReal width, SVCPermissions permissions) { MSLane* lane = 0; - switch (myFunction) { + switch (myActiveEdge->getPurpose()) { case MSEdge::EDGEFUNCTION_INTERNAL: lane = new GUIInternalLane(id, maxSpeed, length, myActiveEdge, myCurrentNumericalLaneID++, shape, width, permissions); @@ -84,7 +84,7 @@ myCurrentNumericalLaneID++, shape, width, permissions); break; default: - throw InvalidArgument("A lane with an unknown type occured (" + toString(myFunction) + ")"); + throw InvalidArgument("A lane with an unknown type occured (" + toString(myActiveEdge->getPurpose()) + ")"); } myLaneStorage->push_back(lane); return lane; @@ -93,8 +93,11 @@ MSEdge* -GUIEdgeControlBuilder::buildEdge(const std::string& id, const std::string& streetName) { - return new GUIEdge(id, myCurrentNumericalEdgeID++, streetName); +GUIEdgeControlBuilder::buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName) { + if (function == MSEdge::EDGEFUNCTION_INTERNAL) { + return new GUIEdge(id, -1, function, streetName); + } + return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName); } /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guinetload/GUIEdgeControlBuilder.h sumo-0.16.0~dfsg/src/guinetload/GUIEdgeControlBuilder.h --- sumo-0.15.0~dfsg/src/guinetload/GUIEdgeControlBuilder.h 2012-03-08 00:03:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/GUIEdgeControlBuilder.h 2012-11-15 00:02:17.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEdgeControlBuilder.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: GUIEdgeControlBuilder.h 12980 2012-11-14 22:47:35Z behrisch $ /// // Derivation of NLEdgeControlBuilder which builds gui-edges /****************************************************************************/ @@ -63,11 +63,11 @@ * * @param[in] glObjectIDStorage Storage of gl-ids used to assign new ids to built edges */ - GUIEdgeControlBuilder() ; + GUIEdgeControlBuilder(); /// @brief Destructor - ~GUIEdgeControlBuilder() ; + ~GUIEdgeControlBuilder(); /** @brief Builds and adds a lane @@ -76,7 +76,7 @@ * @param[in] length The lane's length * @param[in] shape The shape of the lane * @param[in] width The width of the lane - * @param[in] permissions encoding of vehicle classes that may drive on this lane + * @param[in] permissions Encoding of vehicle classes that may drive on this lane * @see SUMOVehicleClass * @see MSLane * @see MSInternalLane @@ -98,7 +98,7 @@ * * @param[in] id The id of the edge to build */ - MSEdge* buildEdge(const std::string& id, const std::string& streetName) ; + MSEdge* buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName); private: diff -Nru sumo-0.15.0~dfsg/src/guinetload/GUITriggerBuilder.cpp sumo-0.16.0~dfsg/src/guinetload/GUITriggerBuilder.cpp --- sumo-0.15.0~dfsg/src/guinetload/GUITriggerBuilder.cpp 2012-01-25 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/GUITriggerBuilder.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUITriggerBuilder.cpp 11784 2012-01-24 22:35:56Z behrisch $ +/// @version $Id: GUITriggerBuilder.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Builds trigger objects for guisim /****************************************************************************/ @@ -54,7 +54,7 @@ MSLaneSpeedTrigger* GUITriggerBuilder::buildLaneSpeedTrigger(MSNet& net, - const std::string& id, const std::vector &destLanes, + const std::string& id, const std::vector& destLanes, const std::string& file) { GUILaneSpeedTrigger* lst = new GUILaneSpeedTrigger(id, destLanes, file); static_cast(net).getVisualisationSpeedUp().addAdditionalGLObject(lst); @@ -64,17 +64,17 @@ MSTriggeredRerouter* GUITriggerBuilder::buildRerouter(MSNet& net, const std::string& id, - std::vector &edges, + std::vector& edges, SUMOReal prob, const std::string& file, bool off) { - GUITriggeredRerouter* rr = new GUITriggeredRerouter(id, edges, prob, file, off); - static_cast(net).getVisualisationSpeedUp().addAdditionalGLObject(rr); + GUITriggeredRerouter* rr = new GUITriggeredRerouter(id, edges, prob, file, off, + dynamic_cast(net).getVisualisationSpeedUp()); return rr; } void GUITriggerBuilder::buildBusStop(MSNet& net, const std::string& id, - const std::vector &lines, + const std::vector& lines, MSLane* lane, SUMOReal frompos, SUMOReal topos) throw(InvalidArgument) { GUIBusStop* stop = new GUIBusStop(id, lines, *lane, frompos, topos); diff -Nru sumo-0.15.0~dfsg/src/guinetload/GUITriggerBuilder.h sumo-0.16.0~dfsg/src/guinetload/GUITriggerBuilder.h --- sumo-0.15.0~dfsg/src/guinetload/GUITriggerBuilder.h 2012-01-25 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/GUITriggerBuilder.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUITriggerBuilder.h 11784 2012-01-24 22:35:56Z behrisch $ +/// @version $Id: GUITriggerBuilder.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Builds trigger objects for guisim /****************************************************************************/ @@ -55,11 +55,11 @@ class GUITriggerBuilder : public NLTriggerBuilder { public: /// @brief Constructor - GUITriggerBuilder() ; + GUITriggerBuilder(); /// @brief Destructor - ~GUITriggerBuilder() ; + ~GUITriggerBuilder(); protected: @@ -81,8 +81,8 @@ * @exception ProcessError If the XML definition file is errornous */ virtual MSLaneSpeedTrigger* buildLaneSpeedTrigger(MSNet& net, - const std::string& id, const std::vector &destLanes, - const std::string& file) ; + const std::string& id, const std::vector& destLanes, + const std::string& file); /** @brief builds an rerouter @@ -96,8 +96,8 @@ * @param[in] file The file to read the reroute definitions from */ virtual MSTriggeredRerouter* buildRerouter(MSNet& net, - const std::string& id, std::vector &edges, - SUMOReal prob, const std::string& file, bool off) ; + const std::string& id, std::vector& edges, + SUMOReal prob, const std::string& file, bool off); /** @brief Builds a bus stop @@ -113,7 +113,7 @@ * @exception InvalidArgument If the bus stop can not be added to the net (is duplicate) */ virtual void buildBusStop(MSNet& net, const std::string& id, - const std::vector &lines, MSLane* lane, + const std::vector& lines, MSLane* lane, SUMOReal frompos, SUMOReal topos) throw(InvalidArgument); /// @} diff -Nru sumo-0.15.0~dfsg/src/guinetload/Makefile.in sumo-0.16.0~dfsg/src/guinetload/Makefile.in --- sumo-0.15.0~dfsg/src/guinetload/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guinetload/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -101,6 +101,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -131,6 +132,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -165,6 +167,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -198,7 +201,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIBusStop.cpp sumo-0.16.0~dfsg/src/guisim/GUIBusStop.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIBusStop.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIBusStop.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 07.12.2005 -/// @version $Id: GUIBusStop.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIBusStop.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ @@ -30,12 +30,6 @@ #include #endif -#ifdef _WIN32 -#include -#endif - -#include - #include #include #include @@ -46,8 +40,9 @@ #include #include #include -#include -#include +#include "GUINet.h" +#include "GUIEdge.h" +#include "GUIPerson.h" #include "GUIBusStop.h" #include #include @@ -59,8 +54,8 @@ #include #include #include -#include #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -70,10 +65,10 @@ // =========================================================================== // method definitions // =========================================================================== -GUIBusStop::GUIBusStop(const std::string& id, const std::vector &lines, MSLane& lane, +GUIBusStop::GUIBusStop(const std::string& id, const std::vector& lines, MSLane& lane, SUMOReal frompos, SUMOReal topos) : MSBusStop(id, lines, lane, frompos, topos), - GUIGlObject_AbstractAdd("bus_stop", GLO_TRIGGER, id) { + GUIGlObject_AbstractAdd("busStop", GLO_TRIGGER, id) { myFGShape = lane.getShape(); myFGShape.move2side((SUMOReal) 1.65); myFGShape = myFGShape.getSubpart(frompos, topos); @@ -108,15 +103,24 @@ buildCenterPopupEntry(ret); buildNameCopyPopupEntry(ret); buildSelectionPopupEntry(ret); + buildShowParamsPopupEntry(ret); buildPositionCopyEntry(ret, false); return ret; } GUIParameterTableWindow* -GUIBusStop::getParameterWindow(GUIMainWindow&, +GUIBusStop::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { - return 0; + GUIParameterTableWindow* ret = + new GUIParameterTableWindow(app, *this, 4); + // add items + ret->mkItem("begin position [m]", false, myBegPos); + ret->mkItem("end position [m]", false, myEndPos); + ret->mkItem("person number [#]", true, new FunctionBinding(this, &MSBusStop::getPersonNumber)); + // close building + ret->closeBuilding(); + return ret; } @@ -132,7 +136,7 @@ GLHelper::setColor(green); GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, 1.0); // draw details unless zoomed out to far - if (s.scale* s.addExaggeration >= 10) { + if (s.scale * s.addExaggeration >= 10) { // draw the lines for (i = 0; i != myLines.size(); ++i) { glPushMatrix(); @@ -158,13 +162,17 @@ glTranslated(0, 0, .1); GLHelper::setColor(yellow); GLHelper::drawFilledCircle((SUMOReal) 0.9, noPoints); - if (s.scale* s.addExaggeration >= 4.5) { + if (s.scale * s.addExaggeration >= 4.5) { GLHelper::drawText("H", Position(), .1, 1.6 * s.addExaggeration, green, myFGSignRot); } } glPopMatrix(); - drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); glPopName(); + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + for (std::vector::const_iterator i = myWaitingPersons.begin(); i != myWaitingPersons.end(); ++i) { + glTranslated(0, 1, 0); // make multiple persons viewable + static_cast(*i)->drawGL(s); + } } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIBusStop.h sumo-0.16.0~dfsg/src/guisim/GUIBusStop.h --- sumo-0.15.0~dfsg/src/guisim/GUIBusStop.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIBusStop.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 07.12.2005 -/// @version $Id: GUIBusStop.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: GUIBusStop.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ @@ -79,12 +79,12 @@ * @param[in] endPos End position of the bus stop on the lane */ GUIBusStop(const std::string& id, - const std::vector &lines, MSLane& lane, - SUMOReal frompos, SUMOReal topos) ; + const std::vector& lines, MSLane& lane, + SUMOReal frompos, SUMOReal topos); /// @brief Destructor - ~GUIBusStop() ; + ~GUIBusStop(); @@ -99,7 +99,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -112,7 +112,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -120,14 +120,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIDetectorWrapper.h sumo-0.16.0~dfsg/src/guisim/GUIDetectorWrapper.h --- sumo-0.15.0~dfsg/src/guisim/GUIDetectorWrapper.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIDetectorWrapper.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDetectorWrapper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDetectorWrapper.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The base class for detector wrapper /****************************************************************************/ @@ -54,7 +54,7 @@ GUIDetectorWrapper(const std::string& prefix, const std::string& id); /// Destructor - ~GUIDetectorWrapper() ; + ~GUIDetectorWrapper(); @@ -69,7 +69,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /// @} diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIE3Collector.cpp sumo-0.16.0~dfsg/src/guisim/GUIE3Collector.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIE3Collector.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIE3Collector.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jan 2004 -/// @version $Id: GUIE3Collector.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIE3Collector.cpp 12284 2012-04-29 19:53:27Z behrisch $ /// // The gui-version of a MSE3Collector /****************************************************************************/ @@ -37,12 +37,7 @@ #include #include #include - -#ifdef _WIN32 -#include -#endif - -#include +#include #ifdef CHECK_MEMORY_LEAKS #include diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIE3Collector.h sumo-0.16.0~dfsg/src/guisim/GUIE3Collector.h --- sumo-0.15.0~dfsg/src/guisim/GUIE3Collector.h 2012-02-07 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIE3Collector.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jan 2004 -/// @version $Id: GUIE3Collector.h 11836 2012-02-06 15:48:56Z behrisch $ +/// @version $Id: GUIE3Collector.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The gui-version of a MSE3Collector /****************************************************************************/ @@ -56,10 +56,10 @@ GUIE3Collector(const std::string& id, const CrossSectionVector& entries, const CrossSectionVector& exits, SUMOReal haltingSpeedThreshold, - SUMOTime haltingTimeThreshold) ; + SUMOTime haltingTimeThreshold); /// @brief Destructor - ~GUIE3Collector() ; + ~GUIE3Collector(); /** @brief Returns the list of entry points @@ -89,10 +89,10 @@ class MyWrapper : public GUIDetectorWrapper { public: /// @brief Constructor - MyWrapper(GUIE3Collector& detector) ; + MyWrapper(GUIE3Collector& detector); /// @brief Destrutor - ~MyWrapper() ; + ~MyWrapper(); /// @name inherited from GUIGlObject @@ -106,7 +106,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -114,14 +114,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIEdge.cpp sumo-0.16.0~dfsg/src/guisim/GUIEdge.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIEdge.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GUIEdge.cpp 12062 2012-03-12 12:43:58Z namdre $ +/// @version $Id: GUIEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A road/street connecting two junctions (gui-version) /****************************************************************************/ @@ -35,27 +35,33 @@ #include #include #include +#include #include +#include +#include #include -#include "GUIEdge.h" -#include "GUINet.h" -#include "GUILane.h" +#include #include +#include +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include +#include "GUIEdge.h" +#include "GUINet.h" +#include "GUILane.h" +#include "GUIPerson.h" -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL +#include #include #include #include -#include #endif #ifdef CHECK_MEMORY_LEAKS @@ -66,8 +72,9 @@ // =========================================================================== // included modules // =========================================================================== -GUIEdge::GUIEdge(const std::string& id, unsigned int numericalID, const std::string& streetName) - : MSEdge(id, numericalID, streetName), +GUIEdge::GUIEdge(const std::string& id, int numericalID, + const EdgeBasicFunction function, const std::string& streetName) + : MSEdge(id, numericalID, function, streetName), GUIGlObject(GLO_EDGE, id) {} @@ -75,6 +82,10 @@ for (LaneWrapperVector::iterator i = myLaneGeoms.begin(); i != myLaneGeoms.end(); ++i) { delete(*i); } + // just to quit cleanly on a failure + if (myLock.locked()) { + myLock.unlock(); + } } @@ -145,7 +156,7 @@ void -GUIEdge::fill(std::vector &netsWrappers) { +GUIEdge::fill(std::vector& netsWrappers) { size_t size = MSEdge::dictSize(); netsWrappers.reserve(size); for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) { @@ -167,6 +178,8 @@ if (MSGlobals::gUseMesoSim) { buildShowParamsPopupEntry(ret); } + const SUMOReal pos = getLanes()[0]->getShape().nearest_position_on_line_to_point2D(parent.getPositionInformation()); + new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0); buildPositionCopyEntry(ret, false); return ret; } @@ -174,11 +187,11 @@ GUIParameterTableWindow* GUIEdge::getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView&) { + GUISUMOAbstractView& parent) { GUIParameterTableWindow* ret = 0; -#ifdef HAVE_MESOSIM - ret = new GUIParameterTableWindow(app, *this, 7); - // add items +#ifdef HAVE_INTERNAL + ret = new GUIParameterTableWindow(app, *this, 16); + // add edge items ret->mkItem("length [m]", false, (*myLanes)[0]->getLength()); ret->mkItem("allowed speed [m/s]", false, getAllowedSpeed()); ret->mkItem("occupancy [%]", true, @@ -190,10 +203,24 @@ ret->mkItem("#vehicles", true, new CastingFunctionBinding(this, &GUIEdge::getVehicleNo)); ret->mkItem("vehicle ids", false, getVehicleIDs()); + // add segment items + MESegment* segment = getSegmentAtPosition(parent.getPositionInformation()); + ret->mkItem("segment index", false, segment->getIndex()); + ret->mkItem("segment length [m]", false, segment->getLength()); + ret->mkItem("segment allowed speed [m/s]", false, segment->getMaxSpeed()); + ret->mkItem("segment jam threshold [%]", false, segment->getRelativeJamThreshold()); + ret->mkItem("segment occupancy [%]", true, new FunctionBinding(segment, &MESegment::getRelativeOccupancy)); + 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 leader leave time", true, new FunctionBinding(segment, &MESegment::getEventTimeSeconds)); + // close building ret->closeBuilding(); +#else + UNUSED_PARAMETER(app); + UNUSED_PARAMETER(parent); #endif - UNUSED_PARAMETER(&app); return ret; } @@ -216,66 +243,85 @@ } // draw the lanes for (LaneWrapperVector::const_iterator i = myLaneGeoms.begin(); i != myLaneGeoms.end(); ++i) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { setColor(s); } #endif (*i)->drawGL(s); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { - size_t idx = 0; - for (LaneWrapperVector::const_iterator l = myLaneGeoms.begin(); l != myLaneGeoms.end(); ++l, ++idx) { - const PositionVector& shape = (*l)->getShape(); - const std::vector& shapeRotations = (*l)->getShapeRotations(); - const std::vector& shapeLengths = (*l)->getShapeLengths(); - const Position& laneBeg = shape[0]; - - glColor3d(1, 1, 0); - glPushMatrix(); - glTranslated(laneBeg.x(), laneBeg.y(), 0); - glRotated(shapeRotations[0], 0, 0, 1); - // go through the vehicles - int shapePos = 0; - SUMOReal positionOffset = 0; - SUMOReal position = 0; - for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) { - const std::vector numCars = segment->getQueSizes(); - const SUMOReal length = segment->getLength(); - if (idx < numCars.size()) { - const SUMOReal avgCarSize = segment->getOccupancy() / segment->getCarNumber(); - for (size_t i = 0; i < numCars[idx]; i++) { - SUMOReal vehiclePosition = position + length - i * avgCarSize; - SUMOReal xOff = 0.f; - while (vehiclePosition < position) { - vehiclePosition += length; - xOff += 0.5f; - } - while (shapePos < (int)shapeRotations.size() - 1 && vehiclePosition > positionOffset + shapeLengths[shapePos]) { - glPopMatrix(); - positionOffset += shapeLengths[shapePos]; - shapePos++; + const GUIVisualizationTextSettings& nameSettings = s.vehicleName; + GUIMEVehicleControl* vehicleControl = GUINet::getGUIInstance()->getGUIMEVehicleControl(); + if (vehicleControl != 0) { + // draw the meso vehicles + vehicleControl->secureVehicles(); + size_t laneIndex = 0; + MESegment::Queue queue; + for (LaneWrapperVector::const_iterator l = myLaneGeoms.begin(); l != myLaneGeoms.end(); ++l, ++laneIndex) { + const PositionVector& shape = (*l)->getShape(); + const std::vector& shapeRotations = (*l)->getShapeRotations(); + const std::vector& shapeLengths = (*l)->getShapeLengths(); + const Position& laneBeg = shape[0]; + glPushMatrix(); + glTranslated(laneBeg.x(), laneBeg.y(), 0); + glRotated(shapeRotations[0], 0, 0, 1); + // go through the vehicles + int shapeIndex = 0; + SUMOReal shapeOffset = 0; // ofset at start of current shape + SUMOReal segmentOffset = 0; // offset at start of current segment + for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); + segment != 0; segment = segment->getNextSegment()) { + const SUMOReal length = segment->getLength(); + if (laneIndex < segment->numQueues()) { + // make a copy so we don't have to worry about synchronization + queue = segment->getQueue(laneIndex); + const SUMOReal avgCarSize = segment->getOccupancy() / segment->getCarNumber(); + const size_t queueSize = queue.size(); + for (size_t i = 0; i < queueSize; i++) { + MSBaseVehicle* veh = queue[queueSize - i - 1]; + setVehicleColor(s, veh); + SUMOReal vehiclePosition = segmentOffset + length - i * avgCarSize; + SUMOReal xOff = 0.f; + while (vehiclePosition < segmentOffset) { + // if there is only a single queue for a + // multi-lane edge shift vehicles and start + // drawing again from the end of the segment + vehiclePosition += length; + xOff += 0.5f; + } + while (shapeIndex < (int)shapeRotations.size() - 1 && vehiclePosition > shapeOffset + shapeLengths[shapeIndex]) { + glPopMatrix(); + shapeOffset += shapeLengths[shapeIndex]; + shapeIndex++; + glPushMatrix(); + glTranslated(shape[shapeIndex].x(), shape[shapeIndex].y(), 0); + glRotated(shapeRotations[shapeIndex], 0, 0, 1); + } + glPushMatrix(); + glTranslated(xOff, -(vehiclePosition - shapeOffset), GLO_VEHICLE); glPushMatrix(); - glTranslated(shape[shapePos].x(), shape[shapePos].y(), 0); - glRotated(shapeRotations[shapePos], 0, 0, 1); + glScaled(1, avgCarSize, 1); + glBegin(GL_TRIANGLES); + glVertex2d(0, 0); + glVertex2d(0 - 1.25, 1); + glVertex2d(0 + 1.25, 1); + glEnd(); + glPopMatrix(); + glPopMatrix(); + if (nameSettings.show) { + GLHelper::drawText(veh->getID(), + Position(xOff, -(vehiclePosition - shapeOffset)), + GLO_MAX, nameSettings.size / s.scale, nameSettings.color, 0); + } } - glPushMatrix(); - glTranslated(xOff, -(vehiclePosition - positionOffset), GLO_VEHICLE); - glPushMatrix(); - glScaled(1, avgCarSize, 1); - glBegin(GL_TRIANGLES); - glVertex2d(0, 0); - glVertex2d(0 - 1.25, 1); - glVertex2d(0 + 1.25, 1); - glEnd(); - glPopMatrix(); - glPopMatrix(); } + segmentOffset += length; } - position += length; + glPopMatrix(); } - glPopMatrix(); + vehicleControl->releaseVehicles(); } glPopName(); } @@ -305,9 +351,16 @@ s.streetName.size / s.scale, s.streetName.color, angle); } } + myLock.lock(); + for (std::set::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) { + GUIPerson* person = dynamic_cast(*i); + assert(person != 0); + person->drawGL(s); + } + myLock.unlock(); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL unsigned int GUIEdge::getVehicleNo() const { size_t vehNo = 0; @@ -339,14 +392,7 @@ for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) { flow += (SUMOReal) segment->getCarNumber() * segment->getMeanSpeed(); } - return flow * (SUMOReal) 1000. / (*myLanes)[0]->getLength() / (SUMOReal) 3.6; -} - - -SUMOReal -GUIEdge::getFlowAlternative() const { - // @note: only the first segment is considered because that is sufficient in equilibrium - return MSGlobals::gMesoNet->getSegmentForEdge(*this)->getFlow() / myLanes->size(); + return 3600 * flow / (*myLanes)[0]->getLength(); } @@ -370,7 +416,7 @@ no += vehNo; } if (no == 0) { - return getMaxSpeed(); + return getSpeedLimit(); } return v / no; } @@ -378,7 +424,7 @@ SUMOReal GUIEdge::getAllowedSpeed() const { - return (*myLanes)[0]->getMaxSpeed(); + return (*myLanes)[0]->getSpeedLimit(); } @@ -415,6 +461,33 @@ return 0; } + +MESegment* +GUIEdge::getSegmentAtPosition(const Position& pos) { + const PositionVector& shape = getLanes()[0]->getShape(); + const SUMOReal lanePos = shape.nearest_position_on_line_to_point2D(pos); + return MSGlobals::gMesoNet->getSegmentForEdge(*this, lanePos); +} + + +void +GUIEdge::setVehicleColor(const GUIVisualizationSettings& s, MSBaseVehicle* veh) const { + const GUIColorer& c = s.vehicleColorer; + switch (c.getActive()) { + case 1: + GLHelper::setColor(veh->getParameter().color); + break; + case 2: + GLHelper::setColor(veh->getVehicleType().getColor()); + break; + case 3: + GLHelper::setColor(veh->getRoute().getColor()); + break; + default: + GLHelper::setColor(c.getScheme().getColor(0)); + } +} + #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIEdge.h sumo-0.16.0~dfsg/src/guisim/GUIEdge.h --- sumo-0.15.0~dfsg/src/guisim/GUIEdge.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIEdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEdge.h 12062 2012-03-12 12:43:58Z namdre $ +/// @version $Id: GUIEdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A road/street connecting two junctions (gui-version) /****************************************************************************/ @@ -37,8 +37,16 @@ #include #include #include +#include #include "GUILaneWrapper.h" +// =========================================================================== +// class declarations +// =========================================================================== +#ifdef HAVE_INTERNAL +class MESegment; +#endif +class MSBaseVehicle; // =========================================================================== // class definitions @@ -56,16 +64,17 @@ * @param[in] numericalID The numerical id (index) of the edge * @see MSEdge */ - GUIEdge(const std::string& id, unsigned int numericalID, const std::string& streetName) ; + GUIEdge(const std::string& id, int numericalID, + const EdgeBasicFunction function, const std::string& streetName); /// @brief Destructor. - ~GUIEdge() ; + ~GUIEdge(); /** @brief Builds lane wrappers for this edge's lanes */ - void initGeometry() ; + void initGeometry(); /* @brief Returns the gl-ids of all known edges @@ -92,7 +101,7 @@ static std::pair getLaneOffsets(SUMOReal x1, SUMOReal y1, SUMOReal x2, SUMOReal y2, SUMOReal prev, SUMOReal wanted); - static void fill(std::vector &netsWrappers); + static void fill(std::vector& netsWrappers); @@ -107,7 +116,7 @@ * @see GUIGlObject::getPopUpMenu */ virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -118,7 +127,7 @@ * @see GUIGlObject::getParameterWindow */ virtual GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -126,18 +135,29 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} -#ifdef HAVE_MESOSIM + void addPerson(MSPerson* p) { + AbstractMutex::ScopedLocker locker(myLock); + MSEdge::addPerson(p); + } + + void removePerson(MSPerson* p) { + AbstractMutex::ScopedLocker locker(myLock); + MSEdge::removePerson(p); + } + + +#ifdef HAVE_INTERNAL unsigned int getVehicleNo() const; std::string getVehicleIDs() const; SUMOReal getOccupancy() const; @@ -145,8 +165,6 @@ SUMOReal getAllowedSpeed() const; /// @brief return flow based on meanSpead @note: may produced incorrect results when jammed SUMOReal getFlow() const; - /// @brief return flow based on headWay - SUMOReal getFlowAlternative() const; /// @brief return meanSpead divided by allowedSpeed SUMOReal getRelativeSpeed() const; @@ -156,6 +174,12 @@ /// @brief gets the color value according to the current scheme index SUMOReal getColorValue(size_t activeScheme) const; + /// @brief returns the segment closest to the given position + MESegment* getSegmentAtPosition(const Position& pos); + + /// @brief sets the vehicle color according to the currente settings + void setVehicleColor(const GUIVisualizationSettings& s, MSBaseVehicle* veh) const; + #endif private: @@ -194,6 +218,9 @@ /// @brief invalidated assignment operator GUIEdge& operator=(const GUIEdge& s); +private: + /// The mutex used to avoid concurrent updates of myPersons + mutable MFXMutex myLock; }; diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIEventControl.cpp sumo-0.16.0~dfsg/src/guisim/GUIEventControl.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIEventControl.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIEventControl.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 04 Feb 2008 -/// @version $Id: GUIEventControl.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIEventControl.cpp 12652 2012-09-03 11:11:04Z dkrajzew $ /// // Stores time-dependant events and executes them at the proper time (guisim) /****************************************************************************/ @@ -52,23 +52,15 @@ GUIEventControl::addEvent(Command* operation, SUMOTime execTimeStep, AdaptType type) { - myLock.lock(); - SUMOTime ret = MSEventControl::addEvent(operation, execTimeStep, type); - myLock.unlock(); - return ret; + AbstractMutex::ScopedLocker locker(myLock); + return MSEventControl::addEvent(operation, execTimeStep, type); } void GUIEventControl::execute(SUMOTime execTime) { - myLock.lock(); - try { - MSEventControl::execute(execTime); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } - myLock.unlock(); + AbstractMutex::ScopedLocker locker(myLock); + MSEventControl::execute(execTime); } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIEventControl.h sumo-0.16.0~dfsg/src/guisim/GUIEventControl.h --- sumo-0.15.0~dfsg/src/guisim/GUIEventControl.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIEventControl.h 2012-09-25 22:01:46.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 04 Feb 2008 -/// @version $Id: GUIEventControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIEventControl.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Stores time-dependant events and executes them at the proper time (guisim) /****************************************************************************/ @@ -53,11 +53,11 @@ class GUIEventControl : public MSEventControl { public: /// @brief Default constructor. - GUIEventControl() ; + GUIEventControl(); /// @brief Destructor. - ~GUIEventControl() ; + ~GUIEventControl(); /** @brief Adds an Event. @@ -71,7 +71,7 @@ * @see MSEventControl::addEvent */ SUMOTime addEvent(Command* operation, SUMOTime execTimeStep, - AdaptType type) ; + AdaptType type); /** @brief Executes time-dependant commands @@ -83,7 +83,7 @@ * @exception ProcessError From an executed Command * @see MSEventControl::execute */ - void execute(SUMOTime time) ; + void execute(SUMOTime time); private: diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIInductLoop.cpp sumo-0.16.0~dfsg/src/guisim/GUIInductLoop.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIInductLoop.cpp 2012-02-07 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIInductLoop.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Aug 2003 -/// @version $Id: GUIInductLoop.cpp 11836 2012-02-06 15:48:56Z behrisch $ +/// @version $Id: GUIInductLoop.cpp 12652 2012-09-03 11:11:04Z dkrajzew $ /// // The gui-version of the MSInductLoop, together with the according /****************************************************************************/ @@ -42,12 +42,7 @@ #include #include #include "GUIEdge.h" - -#ifdef _WIN32 -#include -#endif - -#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -76,40 +71,34 @@ void GUIInductLoop::reset() { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); MSInductLoop::reset(); - myLock.unlock(); } void GUIInductLoop::enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); MSInductLoop::enterDetectorByMove(veh, entryTimestep); - myLock.unlock(); } void GUIInductLoop::leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); MSInductLoop::leaveDetectorByMove(veh, leaveTimestep); - myLock.unlock(); } void GUIInductLoop::leaveDetectorByLaneChange(SUMOVehicle& veh) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); MSInductLoop::leaveDetectorByLaneChange(veh); - myLock.unlock(); } std::vector GUIInductLoop::collectVehiclesOnDet(SUMOTime t) const { - myLock.lock(); - std::vector ret = MSInductLoop::collectVehiclesOnDet(t); - myLock.unlock(); - return ret; + AbstractMutex::ScopedLocker locker(myLock); + return MSInductLoop::collectVehiclesOnDet(t); } @@ -123,7 +112,6 @@ const PositionVector& v = wrapper.getShape(); myFGPosition = v.positionAtLengthPosition(pos); Line l(v.getBegin(), v.getEnd()); - SUMOReal sgPos = pos / v.length() * l.length(); myBoundary.add(myFGPosition.x() + (SUMOReal) 5.5, myFGPosition.y() + (SUMOReal) 5.5); myBoundary.add(myFGPosition.x() - (SUMOReal) 5.5, myFGPosition.y() - (SUMOReal) 5.5); myFGRotation = -v.rotationDegreeAtLengthPosition(pos); diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIInductLoop.h sumo-0.16.0~dfsg/src/guisim/GUIInductLoop.h --- sumo-0.15.0~dfsg/src/guisim/GUIInductLoop.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIInductLoop.h 2012-09-25 22:01:46.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Aug 2003 -/// @version $Id: GUIInductLoop.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIInductLoop.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The gui-version of the MSInductLoop, together with the according /****************************************************************************/ @@ -67,11 +67,11 @@ * @param[in] position Position of the detector within the lane * @param[in] splitByType Whether additional information split by vehicle classes shall be generated */ - GUIInductLoop(const std::string& id, MSLane* const lane, SUMOReal position, bool splitByType) ; + GUIInductLoop(const std::string& id, MSLane* const lane, SUMOReal position, bool splitByType); /// @brief Destructor - ~GUIInductLoop() ; + ~GUIInductLoop(); /** @brief Resets all generated values to allow computation of next interval @@ -79,7 +79,7 @@ * Locks the internal mutex before calling MSInductLoop::reset() * @see MSInductLoop::reset() */ - void reset() ; + void reset(); /** @brief Returns this detector's visualisation-wrapper @@ -96,7 +96,7 @@ * @return The list of vehicles * @see MSInductLoop::collectVehiclesOnDet() */ - std::vector collectVehiclesOnDet(SUMOTime t) const ; + std::vector collectVehiclesOnDet(SUMOTime t) const; protected: @@ -111,7 +111,7 @@ * @param entryTimestep Timestep (not necessary integer) of entrance. * @see MSInductLoop::enterDetectorByMove() */ - void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep) ; + void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep); /** @brief Processes a vehicle that leaves the detector @@ -122,7 +122,7 @@ * @param leaveTimestep Timestep (not necessary integer) of leaving. * @see MSInductLoop::leaveDetectorByMove() */ - void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep) ; + void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep); /** @brief Removes a vehicle from the detector's map myVehiclesOnDet. @@ -131,7 +131,7 @@ * @see MSInductLoop::leaveDetectorByLaneChange() * @param veh The leaving vehicle. */ - void leaveDetectorByLaneChange(SUMOVehicle& veh) ; + void leaveDetectorByLaneChange(SUMOVehicle& veh); /// @} @@ -147,10 +147,10 @@ /// @brief Constructor MyWrapper(GUIInductLoop& detector, GUILaneWrapper& wrapper, - SUMOReal pos) ; + SUMOReal pos); /// @brief Destructor - ~MyWrapper() ; + ~MyWrapper(); /// @name inherited from GUIGlObject @@ -164,7 +164,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -172,14 +172,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIInstantInductLoop.cpp sumo-0.16.0~dfsg/src/guisim/GUIInstantInductLoop.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIInstantInductLoop.cpp 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIInstantInductLoop.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -2,7 +2,7 @@ /// @file GUIInstantInductLoop.cpp /// @author Daniel Krajzewicz /// @date Aug 2003 -/// @version $Id: GUIInstantInductLoop.cpp 12025 2012-03-07 09:20:15Z behrisch $ +/// @version $Id: GUIInstantInductLoop.cpp 12284 2012-04-29 19:53:27Z behrisch $ /// // The gui-version of the MSInstantInductLoop /****************************************************************************/ @@ -40,12 +40,7 @@ #include #include #include "GUIEdge.h" - -#ifdef _WIN32 -#include -#endif - -#include +#include #ifdef CHECK_MEMORY_LEAKS #include diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIInstantInductLoop.h sumo-0.16.0~dfsg/src/guisim/GUIInstantInductLoop.h --- sumo-0.15.0~dfsg/src/guisim/GUIInstantInductLoop.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIInstantInductLoop.h 2012-09-25 22:01:46.000000000 +0000 @@ -2,7 +2,7 @@ /// @file GUIInstantInductLoop.h /// @author Daniel Krajzewicz /// @date Aug 2003 -/// @version $Id: GUIInstantInductLoop.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIInstantInductLoop.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The gui-version of the MSInstantInductLoop /****************************************************************************/ @@ -59,11 +59,11 @@ * @param[in] position Position of the detector within the lane. */ GUIInstantInductLoop(const std::string& id, OutputDevice& od, - MSLane* const lane, SUMOReal positionInMeters) ; + MSLane* const lane, SUMOReal positionInMeters); /// @brief Destructor - ~GUIInstantInductLoop() ; + ~GUIInstantInductLoop(); @@ -83,10 +83,10 @@ /// @brief Constructor MyWrapper(GUIInstantInductLoop& detector, GUILaneWrapper& wrapper, - SUMOReal pos) ; + SUMOReal pos); /// @brief Destructor - ~MyWrapper() ; + ~MyWrapper(); /// @name inherited from GUIGlObject @@ -100,7 +100,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -108,14 +108,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIInternalLane.cpp sumo-0.16.0~dfsg/src/guisim/GUIInternalLane.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIInternalLane.cpp 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIInternalLane.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 04.09.2003 -/// @version $Id: GUIInternalLane.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: GUIInternalLane.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Lane within junctions, derived from the normal lane /****************************************************************************/ @@ -72,14 +72,8 @@ GUIInternalLane::incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator& at, MSMoveReminder::Notification notification) { - myLock.lock(); - try { - MSInternalLane::incorporateVehicle(veh, pos, speed, at, notification); - myLock.unlock(); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + MSInternalLane::incorporateVehicle(veh, pos, speed, at, notification); } @@ -99,70 +93,36 @@ bool GUIInternalLane::moveCritical(SUMOTime t) { - myLock.lock(); - try { - bool ret = MSInternalLane::moveCritical(t); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + return MSInternalLane::moveCritical(t); } bool -GUIInternalLane::setCritical(SUMOTime t, std::vector &into) { - myLock.lock(); - try { - bool ret = MSInternalLane::setCritical(t, into); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } +GUIInternalLane::setCritical(SUMOTime t, std::vector& into) { + AbstractMutex::ScopedLocker locker(myLock); + return MSInternalLane::setCritical(t, into); } MSVehicle* GUIInternalLane::removeVehicle(MSVehicle* remVehicle) { - myLock.lock(); - try { - MSVehicle* ret = MSLane::removeVehicle(remVehicle); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + return MSLane::removeVehicle(remVehicle); } void GUIInternalLane::swapAfterLaneChange(SUMOTime t) { - myLock.lock(); - try { - MSLane::swapAfterLaneChange(t); - myLock.unlock(); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + MSLane::swapAfterLaneChange(t); } bool GUIInternalLane::integrateNewVehicle(SUMOTime t) { - myLock.lock(); - try { - bool ret = MSLane::integrateNewVehicle(t); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + return MSLane::integrateNewVehicle(t); } @@ -174,14 +134,8 @@ void GUIInternalLane::detectCollisions(SUMOTime timestep) { - myLock.lock(); - try { - MSLane::detectCollisions(timestep); - myLock.unlock(); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + MSLane::detectCollisions(timestep); } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIInternalLane.h sumo-0.16.0~dfsg/src/guisim/GUIInternalLane.h --- sumo-0.15.0~dfsg/src/guisim/GUIInternalLane.h 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIInternalLane.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 04.09.2003 -/// @version $Id: GUIInternalLane.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: GUIInternalLane.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a lane over a junction /****************************************************************************/ @@ -80,7 +80,7 @@ /// @brief Destructor - ~GUIInternalLane() ; + ~GUIInternalLane(); @@ -96,7 +96,7 @@ * @return The vehicles on this lane * @see MSLane::getVehiclesSecure */ - const VehCont& getVehiclesSecure() const ; + const VehCont& getVehiclesSecure() const; /** @brief Allows to use the container for microsimulation again @@ -104,7 +104,7 @@ * Unlocks "myLock" preventing usage by microsimulation. * @see MSLane::releaseVehicles */ - void releaseVehicles() const ; + void releaseVehicles() const; /// @} @@ -118,7 +118,7 @@ /** the same as in MSLane, but locks the access for the visualisation first; the access will be granted at the end of this method */ - bool setCritical(SUMOTime t, std::vector &into); + bool setCritical(SUMOTime t, std::vector& into); /** the same as in MSLane, but locks the access for the visualisation first; the access will be granted at the end of this method */ @@ -147,7 +147,7 @@ */ virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator& at, - MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ; + MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); private: diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIJunctionWrapper.cpp sumo-0.16.0~dfsg/src/guisim/GUIJunctionWrapper.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIJunctionWrapper.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIJunctionWrapper.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Laura Bieker /// @author Andreas Gaubatz /// @date Mon, 1 Jul 2003 -/// @version $Id: GUIJunctionWrapper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIJunctionWrapper.cpp 12284 2012-04-29 19:53:27Z behrisch $ /// // } /****************************************************************************/ @@ -32,12 +32,6 @@ #include #endif -#ifdef WIN32 -#include -#endif - -#include - #include #include #include @@ -55,6 +49,7 @@ #include #include #include +#include #ifdef CHECK_MEMORY_LEAKS #include diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIJunctionWrapper.h sumo-0.16.0~dfsg/src/guisim/GUIJunctionWrapper.h --- sumo-0.15.0~dfsg/src/guisim/GUIJunctionWrapper.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIJunctionWrapper.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 1 Jul 2003 -/// @version $Id: GUIJunctionWrapper.h 11751 2012-01-20 10:05:00Z dkrajzew $ +/// @version $Id: GUIJunctionWrapper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Holds geometrical values for a junction /****************************************************************************/ @@ -66,11 +66,11 @@ * @param[in, changed] idStorage The storage to retrieve the gl-id from * @param[in] junction The represented junction */ - GUIJunctionWrapper(MSJunction& junction) ; + GUIJunctionWrapper(MSJunction& junction); /// @brief Destructor - virtual ~GUIJunctionWrapper() ; + virtual ~GUIJunctionWrapper(); @@ -85,7 +85,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -96,7 +96,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -104,14 +104,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} /** @brief Returns the boundary of the junction @@ -129,7 +129,7 @@ /** @brief Returns the represented junction * @return The junction itself */ - const MSJunction &getJunction() const { + const MSJunction& getJunction() const { return myJunction; } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUILane.cpp sumo-0.16.0~dfsg/src/guisim/GUILane.cpp --- sumo-0.15.0~dfsg/src/guisim/GUILane.cpp 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUILane.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILane.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: GUILane.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a lane in the micro simulation (gui-version) /****************************************************************************/ @@ -54,7 +54,7 @@ GUILane::GUILane(const std::string& id, SUMOReal maxSpeed, SUMOReal length, MSEdge* const edge, unsigned int numericalID, const PositionVector& shape, SUMOReal width, - SVCPermissions permissions) : + SVCPermissions permissions) : MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions) {} @@ -71,14 +71,8 @@ GUILane::incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator& at, MSMoveReminder::Notification notification) { - myLock.lock(); - try { - MSLane::incorporateVehicle(veh, pos, speed, at, notification); - myLock.unlock(); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + MSLane::incorporateVehicle(veh, pos, speed, at, notification); } @@ -98,70 +92,36 @@ bool GUILane::moveCritical(SUMOTime t) { - myLock.lock(); - try { - bool ret = MSLane::moveCritical(t); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + return MSLane::moveCritical(t); } bool -GUILane::setCritical(SUMOTime t, std::vector &into) { - myLock.lock(); - try { - bool ret = MSLane::setCritical(t, into); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } +GUILane::setCritical(SUMOTime t, std::vector& into) { + AbstractMutex::ScopedLocker locker(myLock); + return MSLane::setCritical(t, into); } MSVehicle* GUILane::removeVehicle(MSVehicle* remVehicle) { - myLock.lock(); - try { - MSVehicle* ret = MSLane::removeVehicle(remVehicle); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + return MSLane::removeVehicle(remVehicle); } void GUILane::swapAfterLaneChange(SUMOTime t) { - myLock.lock(); - try { - MSLane::swapAfterLaneChange(t); - myLock.unlock(); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + MSLane::swapAfterLaneChange(t); } bool GUILane::integrateNewVehicle(SUMOTime t) { - myLock.lock(); - try { - bool ret = MSLane::integrateNewVehicle(t); - myLock.unlock(); - return ret; - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + return MSLane::integrateNewVehicle(t); } @@ -173,14 +133,8 @@ void GUILane::detectCollisions(SUMOTime timestep) { - myLock.lock(); - try { - MSLane::detectCollisions(timestep); - myLock.unlock(); - } catch (ProcessError&) { - myLock.unlock(); - throw; - } + AbstractMutex::ScopedLocker locker(myLock); + MSLane::detectCollisions(timestep); } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUILane.h sumo-0.16.0~dfsg/src/guisim/GUILane.h --- sumo-0.15.0~dfsg/src/guisim/GUILane.h 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUILane.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILane.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: GUILane.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a lane in the micro simulation (gui-version) /****************************************************************************/ @@ -83,7 +83,7 @@ /// @brief Destructor - ~GUILane() ; + ~GUILane(); @@ -99,7 +99,7 @@ * @return The vehicles on this lane * @see MSLane::getVehiclesSecure */ - const VehCont& getVehiclesSecure() const ; + const VehCont& getVehiclesSecure() const; /** @brief Allows to use the container for microsimulation again @@ -107,7 +107,7 @@ * Unlocks "myLock" preventing usage by microsimulation. * @see MSLane::releaseVehicles */ - void releaseVehicles() const ; + void releaseVehicles() const; /// @} @@ -121,7 +121,7 @@ /** the same as in MSLane, but locks the access for the visualisation first; the access will be granted at the end of this method */ - bool setCritical(SUMOTime t, std::vector &into); + bool setCritical(SUMOTime t, std::vector& into); /** the same as in MSLane, but locks the access for the visualisation first; the access will be granted at the end of this method */ @@ -153,7 +153,7 @@ */ virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator& at, - MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ; + MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); private: diff -Nru sumo-0.15.0~dfsg/src/guisim/GUILaneSpeedTrigger.cpp sumo-0.16.0~dfsg/src/guisim/GUILaneSpeedTrigger.cpp --- sumo-0.15.0~dfsg/src/guisim/GUILaneSpeedTrigger.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUILaneSpeedTrigger.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUILaneSpeedTrigger.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUILaneSpeedTrigger.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Changes the speed allowed on a set of lanes (gui version) /****************************************************************************/ @@ -28,12 +28,6 @@ #include #endif -#ifdef _WIN32 -#include -#endif - -#include - #include #include #include @@ -58,8 +52,8 @@ #include #include #include -#include #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -283,11 +277,11 @@ * GUILaneSpeedTrigger - methods * ----------------------------------------------------------------------- */ GUILaneSpeedTrigger::GUILaneSpeedTrigger( - const std::string& id, const std::vector &destLanes, - const std::string& aXMLFilename) - : MSLaneSpeedTrigger(id, destLanes, aXMLFilename), - GUIGlObject_AbstractAdd("speedtrigger", GLO_TRIGGER, id), - myShowAsKMH(true), myLastValue(-1) { + const std::string& id, const std::vector& destLanes, + const std::string& aXMLFilename) : + MSLaneSpeedTrigger(id, destLanes, aXMLFilename), + GUIGlObject_AbstractAdd("speedtrigger", GLO_TRIGGER, id), + myShowAsKMH(true), myLastValue(-1) { myFGPositions.reserve(destLanes.size()); myFGRotations.reserve(destLanes.size()); std::vector::const_iterator i; @@ -295,10 +289,7 @@ const PositionVector& v = (*i)->getShape(); myFGPositions.push_back(v.positionAtLengthPosition(0)); myBoundary.add(v.positionAtLengthPosition(0)); - Line l(v.getBegin(), v.getEnd()); myFGRotations.push_back(-v.rotationDegreeAtLengthPosition(0)); - myDefaultSpeed = (*i)->getMaxSpeed(); - mySpeedOverrideValue = (*i)->getMaxSpeed(); } } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUILaneSpeedTrigger.h sumo-0.16.0~dfsg/src/guisim/GUILaneSpeedTrigger.h --- sumo-0.15.0~dfsg/src/guisim/GUILaneSpeedTrigger.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUILaneSpeedTrigger.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUILaneSpeedTrigger.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUILaneSpeedTrigger.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Changes the speed allowed on a set of lanes (gui version) /****************************************************************************/ @@ -61,12 +61,12 @@ * @param[in] file Name of the file to read the speeds to set from */ GUILaneSpeedTrigger(const std::string& id, - const std::vector &destLanes, - const std::string& file) ; + const std::vector& destLanes, + const std::string& file); /** destructor */ - ~GUILaneSpeedTrigger() ; + ~GUILaneSpeedTrigger(); @@ -81,7 +81,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -92,7 +92,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -100,14 +100,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} @@ -123,7 +123,7 @@ GUILaneSpeedTriggerPopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o); - ~GUILaneSpeedTriggerPopupMenu() ; + ~GUILaneSpeedTriggerPopupMenu(); /** @brief Called if the object's manipulator shall be shown */ long onCmdOpenManip(FXObject*, FXSelector, void*); diff -Nru sumo-0.15.0~dfsg/src/guisim/GUILaneWrapper.cpp sumo-0.16.0~dfsg/src/guisim/GUILaneWrapper.cpp --- sumo-0.15.0~dfsg/src/guisim/GUILaneWrapper.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUILaneWrapper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 Nov 2002 -/// @version $Id: GUILaneWrapper.cpp 12071 2012-03-12 15:44:08Z namdre $ +/// @version $Id: GUILaneWrapper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A MSLane extended for visualisation purposes. /****************************************************************************/ @@ -30,23 +30,19 @@ #include #endif -#ifdef WIN32 -#include -#endif - -#include - #include #include #include #include #include #include +#include #include #include #include #include #include "GUILaneWrapper.h" +#include "GUIEdge.h" #include #include #include @@ -57,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -64,7 +61,7 @@ #include #include #include - +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -127,7 +124,7 @@ SUMOReal rot = (SUMOReal) atan2((s.x() - f.x()), (f.y() - s.y())) * (SUMOReal) 180.0 / (SUMOReal) PI; glTranslated(end.x(), end.y(), 0); glRotated(rot, 0, 0, 1); - for (int i = noLinks; --i >= 0; ) { + for (int i = noLinks; --i >= 0;) { SUMOReal x2 = x1 - (SUMOReal)(w / 2.); GLHelper::drawText(toString(getLane().getLinkCont()[i]->getRespondIndex()), Position(x2, 0), 0, .6, RGBColor(.5, .5, 1), 180); @@ -154,7 +151,7 @@ SUMOReal rot = (SUMOReal) atan2((s.x() - f.x()), (f.y() - s.y())) * (SUMOReal) 180.0 / (SUMOReal) PI; glTranslated(end.x(), end.y(), 0); glRotated(rot, 0, 0, 1); - for (int i = noLinks; --i >= 0; ) { + for (int i = noLinks; --i >= 0;) { SUMOReal x2 = x1 - (SUMOReal)(w / 2.); int linkNo = net.getLinkTLIndex(getLane().getLinkCont()[i]); if (linkNo < 0) { @@ -318,6 +315,8 @@ GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05); GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25); break; + default: + break; } } glPopMatrix(); @@ -382,6 +381,7 @@ glPushMatrix(); const bool isInternal = getLane().getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL; bool mustDrawMarkings = false; + const bool drawDetails = s.scale * s.laneWidthExaggeration > 5; if (isInternal) { // draw internal lanes on top of junctions glTranslated(0, 0, GLO_JUNCTION + 0.1); @@ -395,25 +395,34 @@ } // draw lane // check whether it is not too small - if (s.scale < 1.) { + if (s.scale * s.laneWidthExaggeration < 1.) { GLHelper::drawLine(myShape); if (!MSGlobals::gUseMesoSim) { glPopName(); } glPopMatrix(); - } else { - if (!isInternal) { - GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myHalfLaneWidth); - mustDrawMarkings = true; - } else { - GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myQuarterLaneWidth); + } else if (isRailway(getLane().getPermissions())) { + // draw as railway + const SUMOReal halfRailWidth = 0.725; + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfRailWidth * s.laneWidthExaggeration); + glColor3d(1, 1, 1); + glTranslated(0, 0, .1); + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, (halfRailWidth - 0.2) * s.laneWidthExaggeration); + drawCrossties(s); + if (!MSGlobals::gUseMesoSim) { + glPopName(); } + glPopMatrix(); + } else { + const SUMOReal laneWidth = isInternal ? myQuarterLaneWidth : myHalfLaneWidth; + mustDrawMarkings = !isInternal; + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, laneWidth * s.laneWidthExaggeration); if (!MSGlobals::gUseMesoSim) { glPopName(); } glPopMatrix(); // draw ROWs (not for inner lanes) - if (!isInternal) { + if (!isInternal && drawDetails) { glPushMatrix(); glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape GUINet* net = (GUINet*) MSNet::getInstance(); @@ -437,7 +446,7 @@ glPopMatrix(); } } - if (mustDrawMarkings) { // needs matrix reset + if (mustDrawMarkings && drawDetails) { // needs matrix reset drawMarkings(s); } // draw vehicles @@ -445,7 +454,7 @@ // retrieve vehicles from lane; disallow simulation const MSLane::VehCont& vehicles = myLane.getVehiclesSecure(); for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) { - static_cast(*v)->drawGL(s); + static_cast(*v)->drawGL(s); } // allow lane simulation myLane.releaseVehicles(); @@ -458,7 +467,7 @@ glPushMatrix(); glPushName(0); glTranslated(0, 0, GLO_EDGE); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (!MSGlobals::gUseMesoSim) #endif setColor(s); @@ -492,6 +501,34 @@ } +void +GUILaneWrapper::drawCrossties(const GUIVisualizationSettings& s) const { + glPushMatrix(); + glPushName(0); + if (!MSGlobals::gUseMesoSim) { + setColor(s); + } + // draw on top of of the white area between the rails + glTranslated(0, 0, 0.1); + int e = (int) getShape().size() - 1; + for (int i = 0; i < e; i++) { + glPushMatrix(); + glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1); + glRotated(myShapeRotations[i], 0, 0, 1); + for (SUMOReal t = 0; t < myShapeLengths[i]; t += 1) { + glBegin(GL_QUADS); + glVertex2d(-1, -t); + glVertex2d(-1, -t - 0.3); + glVertex2d(1.0, -t - 0.3); + glVertex2d(1.0, -t); + glEnd(); + } + glPopMatrix(); + } + glPopMatrix(); + glPopName(); +} + GUIGLObjectPopupMenu* GUILaneWrapper::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { @@ -503,7 +540,8 @@ buildSelectionPopupEntry(ret); // buildShowParamsPopupEntry(ret, false); - const SUMOReal pos = myShape.nearest_position_on_line_to_point2D(parent.getPositionInformation()); + const SUMOReal pos = myLane.interpolateGeometryPosToLanePos( + myShape.nearest_position_on_line_to_point2D(parent.getPositionInformation())); new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0); new FXMenuSeparator(ret); buildPositionCopyEntry(ret, false); @@ -515,10 +553,13 @@ GUILaneWrapper::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { GUIParameterTableWindow* ret = - new GUIParameterTableWindow(app, *this, 2); + new GUIParameterTableWindow(app, *this, 4); // add items - ret->mkItem("maxspeed [m/s]", false, myLane.getMaxSpeed()); + ret->mkItem("maxspeed [m/s]", false, myLane.getSpeedLimit()); ret->mkItem("length [m]", false, myLane.getLength()); + ret->mkItem("permissions", false, getAllowedVehicleClassNames(myLane.getPermissions())); + ret->mkItem("street name", false, myLane.getEdge().getStreetName()); + ret->mkItem("stored traveltime [s]", true, new FunctionBinding(this, &GUILaneWrapper::getStoredEdgeTravelTime)); // close building ret->closeBuilding(); return ret; @@ -619,10 +660,24 @@ SUMOReal +GUILaneWrapper::getStoredEdgeTravelTime() const { + MSEdgeWeightsStorage& ews = MSNet::getInstance()->getWeightsStorage(); + MSEdge& e = getLane().getEdge(); + if (!ews.knowsTravelTime(&e)) { + return -1; + } else { + SUMOReal value(0); + ews.retrieveExistingTravelTime(&e, 0, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value); + return value; + } +} + +SUMOReal GUILaneWrapper::getColorValue(size_t activeScheme) const { switch (activeScheme) { case 1: - return gSelected.isSelected(getType(), getGlID()); + return (gSelected.isSelected(getType(), getGlID()) || + gSelected.isSelected(GLO_EDGE, dynamic_cast(&(getLane().getEdge()))->getGlID())); case 2: { if (getLane().allowsVehicleClass(SVC_PASSENGER)) { return 0; @@ -631,7 +686,7 @@ } } case 3: - return getLane().getMaxSpeed(); + return getLane().getSpeedLimit(); case 4: return getLane().getOccupancy(); case 5: @@ -653,15 +708,7 @@ case 13: return getLane().getHarmonoise_NoiseEmissions(); case 14: { - MSEdgeWeightsStorage& ews = MSNet::getInstance()->getWeightsStorage(); - MSEdge& e = getLane().getEdge(); - if (!ews.knowsTravelTime(&e)) { - return -1; - } else { - SUMOReal value(0); - ews.retrieveExistingTravelTime(&e, 0, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value); - return value; - } + return getStoredEdgeTravelTime(); } case 15: { MSEdgeWeightsStorage& ews = MSNet::getInstance()->getWeightsStorage(); @@ -671,7 +718,7 @@ } else { SUMOReal value(0); ews.retrieveExistingTravelTime(&e, 0, 0, value); - return (getLane().getLength() / getLane().getMaxSpeed()) / (getLane().getMaxSpeed() / value); + return 100 * getLane().getLength() / value / getLane().getSpeedLimit(); } } } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUILaneWrapper.h sumo-0.16.0~dfsg/src/guisim/GUILaneWrapper.h --- sumo-0.15.0~dfsg/src/guisim/GUILaneWrapper.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUILaneWrapper.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 Nov 2002 -/// @version $Id: GUILaneWrapper.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: GUILaneWrapper.h 12749 2012-09-25 11:02:53Z namdre $ /// // A MSLane extended for visualisation purposes. /****************************************************************************/ @@ -67,11 +67,11 @@ * @param[in] lane The lane to be represented * @param[in] shape The shape of the lane (!!! this is a member of the lane - no need to give it additionally) */ - GUILaneWrapper(MSLane& lane, const PositionVector& shape, unsigned int index) ; + GUILaneWrapper(MSLane& lane, const PositionVector& shape, unsigned int index); /// @brief Destructor - virtual ~GUILaneWrapper() ; + virtual ~GUILaneWrapper(); @@ -86,7 +86,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -97,7 +97,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -105,14 +105,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} @@ -139,6 +139,8 @@ /// @brief draw lane borders and white markings void drawMarkings(const GUIVisualizationSettings& s) const; + /// @brief draw crossties for railroads + void drawCrossties(const GUIVisualizationSettings& s) const; /// Returns the number of links unsigned int getLinkNumber() const; @@ -154,42 +156,45 @@ /** @brief Returns the sum of last step CO2 emissions normed by the lane's length * @return CO2 emissions of vehicles on this lane during the last step, normed by the lane length */ - SUMOReal getNormedHBEFA_CO2Emissions() const ; + SUMOReal getNormedHBEFA_CO2Emissions() const; /** @brief Returns the sum of last step CO emissions normed by the lane's length * @return CO emissions of vehicles on this lane during the last step, normed by the lane length */ - SUMOReal getNormedHBEFA_COEmissions() const ; + SUMOReal getNormedHBEFA_COEmissions() const; /** @brief Returns the sum of last step PMx emissions normed by the lane's length * @return PMx emissions of vehicles on this lane during the last step, normed by the lane length */ - SUMOReal getNormedHBEFA_PMxEmissions() const ; + SUMOReal getNormedHBEFA_PMxEmissions() const; /** @brief Returns the sum of last step NOx emissions normed by the lane's length * @return NOx emissions of vehicles on this lane during the last step, normed by the lane length */ - SUMOReal getNormedHBEFA_NOxEmissions() const ; + SUMOReal getNormedHBEFA_NOxEmissions() const; /** @brief Returns the sum of last step HC emissions normed by the lane's length * @return HC emissions of vehicles on this lane during the last step, normed by the lane length */ - SUMOReal getNormedHBEFA_HCEmissions() const ; + SUMOReal getNormedHBEFA_HCEmissions() const; /** @brief Returns the sum of last step fuel comsumption normed by the lane's length * @return Fuel comsumption of vehicles on this lane during the last step, normed by the lane length */ - SUMOReal getNormedHBEFA_FuelConsumption() const ; + SUMOReal getNormedHBEFA_FuelConsumption() const; /// @} SUMOReal getEdgeLaneNumber() const; + /** @brief Returns the stored traveltime for the edge of this lane + */ + SUMOReal getStoredEdgeTravelTime() const; protected: /// The assigned lane diff -Nru sumo-0.15.0~dfsg/src/guisim/GUINet.cpp sumo-0.16.0~dfsg/src/guisim/GUINet.cpp --- sumo-0.15.0~dfsg/src/guisim/GUINet.cpp 2012-01-25 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUINet.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GUINet.cpp 11784 2012-01-24 22:35:56Z behrisch $ +/// @version $Id: GUINet.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A MSNet extended by some values for usage within the gui /****************************************************************************/ @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,10 @@ #include "GUINet.h" #include "GUIShapeContainer.h" +#ifdef HAVE_INTERNAL +#include +#endif + #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -116,11 +121,19 @@ } +MSPersonControl& +GUINet::getPersonControl() { + if (myPersonControl == 0) { + myPersonControl = new GUIPersonControl(); + } + return *myPersonControl; +} + void GUINet::initTLMap() { // get the list of loaded tl-logics - const std::vector &logics = getTLSControl().getAllLogics(); + const std::vector& logics = getTLSControl().getAllLogics(); // allocate storage for the wrappers myTLLogicWrappers.reserve(logics.size()); // go through the logics @@ -170,13 +183,6 @@ } -Boundary -GUINet::getEdgeBoundary(const std::string& name) const { - GUIEdge* edge = static_cast(MSEdge::dictionary(name)); - return edge->getBoundary(); -} - - unsigned int GUINet::getLinkTLID(MSLink* link) const { if (myLinks2Logic.count(link) == 0) { @@ -243,7 +249,7 @@ GUINet::initGUIStructures() { // initialise detector storage for gui for (std::map >::const_iterator i = myDetectorControl->myDetectors.begin(); i != myDetectorControl->myDetectors.end(); ++i) { - const std::map &dets = myDetectorControl->getTypedDetectors((*i).first).getMyMap(); + const std::map& dets = myDetectorControl->getTypedDetectors((*i).first).getMyMap(); for (std::map::const_iterator j = dets.begin(); j != dets.end(); ++j) { GUIDetectorWrapper* wrapper = (*j).second->buildDetectorGUIRepresentation(); if (wrapper != 0) { @@ -259,7 +265,7 @@ // initialise junction storage for gui size_t size = myJunctions->size(); myJunctionWrapper.reserve(size); - const std::map &junctions = myJunctions->getMyMap(); + const std::map& junctions = myJunctions->getMyMap(); for (std::map::const_iterator i = junctions.begin(); i != junctions.end(); ++i) { myJunctionWrapper.push_back(new GUIJunctionWrapper(*(*i).second)); } @@ -269,11 +275,12 @@ for (std::vector::iterator i = myEdgeWrapper.begin(); i != myEdgeWrapper.end(); ++i) { GUIEdge* edge = *i; Boundary b; - const std::vector &lanes = edge->getLanes(); + const std::vector& lanes = edge->getLanes(); for (std::vector::const_iterator j = lanes.begin(); j != lanes.end(); ++j) { b.add((*j)->getShape().getBoxBoundary()); } - b.grow(2.); + // make sure persons are always drawn and selectable since they depend on their edge being drawn + b.grow(MSPerson::SIDEWALK_OFFSET + 1); cmin[0] = b.xmin(); cmin[1] = b.ymin(); cmax[0] = b.xmax(); @@ -401,7 +408,7 @@ GUINet::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { GUIParameterTableWindow* ret = - new GUIParameterTableWindow(app, *this, 13); + new GUIParameterTableWindow(app, *this, 15); // add items ret->mkItem("loaded vehicles [#]", true, new FunctionBinding(&getVehicleControl(), &MSVehicleControl::getLoadedVehicleNo)); @@ -413,6 +420,10 @@ new FunctionBinding(&getVehicleControl(), &MSVehicleControl::getRunningVehicleNo)); ret->mkItem("arrived vehicles [#]", true, new FunctionBinding(&getVehicleControl(), &MSVehicleControl::getEndedVehicleNo)); + ret->mkItem("collisions [#]", true, + new FunctionBinding(&getVehicleControl(), &MSVehicleControl::getCollisionCount)); + ret->mkItem("teleports [#]", true, + new FunctionBinding(&getVehicleControl(), &MSVehicleControl::getTeleportCount)); ret->mkItem("end time [s]", false, OptionsCont::getOptions().getString("end")); ret->mkItem("begin time [s]", false, OptionsCont::getOptions().getString("begin")); // ret->mkItem("time step [s]", true, new FunctionBinding(this, &GUINet::getCurrentTimeStep)); @@ -459,5 +470,18 @@ throw ProcessError("A gui-network was not yet constructed."); } + +GUIVehicleControl* +GUINet::getGUIVehicleControl() { + return dynamic_cast(myVehicleControl); +} + +#ifdef HAVE_INTERNAL +GUIMEVehicleControl* +GUINet::getGUIMEVehicleControl() { + return dynamic_cast(myVehicleControl); +} +#endif + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUINet.h sumo-0.16.0~dfsg/src/guisim/GUINet.h --- sumo-0.15.0~dfsg/src/guisim/GUINet.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUINet.h 2012-10-16 16:26:47.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUINet.h 11751 2012-01-20 10:05:00Z dkrajzew $ +/// @version $Id: GUINet.h 12840 2012-10-16 09:20:45Z namdre $ /// // A MSNet extended by some values for usage within the gui /****************************************************************************/ @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +62,11 @@ class GUIEdge; class OutputDevice; class GUIVehicle; +class GUIVehicleControl; class MSVehicleControl; +#ifdef HAVE_INTERNAL +class GUIMEVehicleControl; +#endif // =========================================================================== @@ -95,11 +100,11 @@ * @exception ProcessError If a network was already constructed */ GUINet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents, - MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents) ; + MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents); /// @brief Destructor - ~GUINet() ; + ~GUINet(); @@ -114,7 +119,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -125,7 +130,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -133,14 +138,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} @@ -153,9 +158,6 @@ /// returns the information whether the vehicle still exists bool vehicleExists(const std::string& name) const; - /// returns the boundary of an edge - Boundary getEdgeBoundary(const std::string& name) const; - /// Some further steps needed for gui processing void guiSimulationStep(); @@ -166,13 +168,13 @@ /** @brief Returns the duration of the last step (sim+visualisation+idle) (in ms) * @return How long it took to compute and display the last step */ - unsigned int getWholeDuration() const ; + unsigned int getWholeDuration() const; /** @brief Returns the duration of the last step's simulation part (in ms) * @return How long it took to compute the last step */ - unsigned int getSimDuration() const ; + unsigned int getSimDuration() const; /// Returns the simulation speed as a factor to real time @@ -191,7 +193,7 @@ //int getVisDuration() const; /// Returns the duration of the last step's idle part (in ms) - unsigned int getIdleDuration() const ; + unsigned int getIdleDuration() const; /// Sets the duration of the last step's simulation part void setSimDuration(int val); @@ -204,6 +206,17 @@ //} + /** @brief Returns the person control + * + * If the person control does not exist, yet, it is created. + * + * @return The person control + * @see MSPersonControl + * @see myPersonControl + */ + MSPersonControl& getPersonControl(); + + /** Returns the gl-id of the traffic light that controls the given link * valid only if the link is controlled by a tls */ unsigned int getLinkTLID(MSLink* link) const; @@ -245,6 +258,22 @@ return myGrid; } + /** @brief Returns the vehicle control + * @return The vehicle control + * @see MSVehicleControl + * @see myVehicleControl + */ + GUIVehicleControl* getGUIVehicleControl(); + +#ifdef HAVE_INTERNAL + /** @brief Returns the vehicle control + * @return The vehicle control + * @see MSVehicleControl + * @see myVehicleControl + */ + GUIMEVehicleControl* getGUIMEVehicleControl(); +#endif + /** @brief Returns the pointer to the unique instance of GUINet (singleton). * @return Pointer to the unique GUINet-instance * @exception ProcessError If a network was not yet constructed @@ -263,7 +292,7 @@ protected: /// @brief The visualization speed-up - SUMORTree myGrid; + LayeredRTree myGrid; /// @brief The networks boundary Boundary myBoundary; diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIPerson.cpp sumo-0.16.0~dfsg/src/guisim/GUIPerson.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIPerson.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIPerson.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,365 @@ +/****************************************************************************/ +/// @file GUIPerson.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: GUIPerson.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// A MSVehicle extended by some values for usage within the gui +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "GUIPerson.h" +#include "GUINet.h" +#include "GUIEdge.h" +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +/* +FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_SHOW_ALLROUTES, GUIPerson::GUIPersonPopupMenu::onCmdShowAllRoutes), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_ALLROUTES, GUIPerson::GUIPersonPopupMenu::onCmdHideAllRoutes), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_CURRENTROUTE, GUIPerson::GUIPersonPopupMenu::onCmdShowCurrentRoute), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_CURRENTROUTE, GUIPerson::GUIPersonPopupMenu::onCmdHideCurrentRoute), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_BEST_LANES, GUIPerson::GUIPersonPopupMenu::onCmdShowBestLanes), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_BEST_LANES, GUIPerson::GUIPersonPopupMenu::onCmdHideBestLanes), + FXMAPFUNC(SEL_COMMAND, MID_START_TRACK, GUIPerson::GUIPersonPopupMenu::onCmdStartTrack), + FXMAPFUNC(SEL_COMMAND, MID_STOP_TRACK, GUIPerson::GUIPersonPopupMenu::onCmdStopTrack), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_LFLINKITEMS, GUIPerson::GUIPersonPopupMenu::onCmdShowLFLinkItems), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_LFLINKITEMS, GUIPerson::GUIPersonPopupMenu::onCmdHideLFLinkItems), +}; + +// Object implementation +FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap)) +*/ + + + +// =========================================================================== +// method definitions +// =========================================================================== +/* ------------------------------------------------------------------------- + * GUIPerson::GUIPersonPopupMenu - methods + * ----------------------------------------------------------------------- */ +GUIPerson::GUIPersonPopupMenu::GUIPersonPopupMenu( + GUIMainWindow& app, GUISUMOAbstractView& parent, + GUIGlObject& o, std::map& additionalVisualizations) + : GUIGLObjectPopupMenu(app, parent, o), myVehiclesAdditionalVisualizations(additionalVisualizations) { +} + + +GUIPerson::GUIPersonPopupMenu::~GUIPersonPopupMenu() {} + + + +/* ------------------------------------------------------------------------- + * GUIPerson - methods + * ----------------------------------------------------------------------- */ +GUIPerson::GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) : + MSPerson(pars, vtype, plan), + GUIGlObject(GLO_PERSON, pars->id), + myAmVisualizedAsStopped(false) +{ } + + +GUIPerson::~GUIPerson() { +} + + +GUIGLObjectPopupMenu* +GUIPerson::getPopUpMenu(GUIMainWindow& app, + GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIPersonPopupMenu(app, parent, *this, myAdditionalVisualizations); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + buildSelectionPopupEntry(ret); + // + buildShowParamsPopupEntry(ret); + buildPositionCopyEntry(ret, false); + return ret; +} + + +GUIParameterTableWindow* +GUIPerson::getParameterWindow(GUIMainWindow& app, + GUISUMOAbstractView&) { + GUIParameterTableWindow* ret = + new GUIParameterTableWindow(app, *this, 3); + // add items + //ret->mkItem("type [NAME]", false, myType->getID()); + ret->mkItem("stage", false, getCurrentStageTypeName()); + ret->mkItem("from", false, getFromEdge()->getID()); + ret->mkItem("to", false, getDestination().getID()); + // close building + ret->closeBuilding(); + return ret; +} + + +Boundary +GUIPerson::getCenteringBoundary() const { + Boundary b; + b.add(getPosition(MSNet::getInstance()->getCurrentTimeStep())); + b.grow(20); + return b; +} + + +void +GUIPerson::drawGL(const GUIVisualizationSettings& s) const { + glPushName(getGlID()); + glPushMatrix(); + const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); + Position p1 = getPosition(now); + glTranslated(p1.x(), p1.y(), getType()); + // XXX use person specific gui settings + // set person color + setColor(s); + // scale + SUMOReal upscale = s.vehicleExaggeration; + glScaled(upscale, upscale, 1); + switch (s.vehicleQuality) { + case 0: + case 1: + drawAction_drawAsTriangle(s); + break; + case 2: + drawAction_drawAsPoly(s); + break; + case 3: + default: + drawAction_drawAsImage(s); + break; + } + glPopMatrix(); + drawName(p1, s.scale, s.vehicleName); + glPopName(); +} + + +void +GUIPerson::drawGLAdditional(GUISUMOAbstractView* const /* parent */, const GUIVisualizationSettings& /* s */) const { + glPushName(getGlID()); + glPushMatrix(); + /* + glTranslated(0, 0, getType() - .1); // don't draw on top of other cars + if (hasActiveAddVisualisation(parent, VO_SHOW_BEST_LANES)) { + drawBestLanes(); + } + if (hasActiveAddVisualisation(parent, VO_SHOW_ROUTE)) { + drawRoute(s, 0, 0.25); + } + if (hasActiveAddVisualisation(parent, VO_SHOW_ALL_ROUTES)) { + if (getNumberReroutes() > 0) { + const int noReroutePlus1 = getNumberReroutes() + 1; + for (int i = noReroutePlus1 - 1; i >= 0; i--) { + SUMOReal darken = SUMOReal(0.4) / SUMOReal(noReroutePlus1) * SUMOReal(i); + drawRoute(s, i, darken); + } + } else { + drawRoute(s, 0, 0.25); + } + } + if (hasActiveAddVisualisation(parent, VO_SHOW_LFLINKITEMS)) { + for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) { + if((*i).myLink==0) { + continue; + } + MSLink* link = (*i).myLink; + #ifdef HAVE_INTERNAL_LANES + MSLane *via = link->getViaLane(); + if (via == 0) { + via = link->getLane(); + } + #else + MSLane *via = link->getLane(); + #endif + if (via != 0) { + Position p = via->getShape()[0]; + if((*i).mySetRequest) { + glColor3f(0, 1, 0); + } else { + glColor3f(1, 0, 0); + } + glTranslated(p.x(), p.y(), -.1); + GLHelper::drawFilledCircle(1); + glTranslated(-p.x(), -p.y(), .1); + } + } + } + */ + glPopMatrix(); + glPopName(); +} + + + + +void +GUIPerson::setColor(const GUIVisualizationSettings& s) const { + const GUIColorer& c = s.vehicleColorer; + if (!setFunctionalColor(c.getActive())) { + GLHelper::setColor(c.getScheme().getColor(getColorValue(c.getActive()))); + } +} + + +bool +GUIPerson::setFunctionalColor(size_t activeScheme) const { + switch (activeScheme) { + case 1: + GLHelper::setColor(getParameter().color); + return true; + // XXX color by stage + default: + return false; + } +} + + +SUMOReal +GUIPerson::getColorValue(size_t /* activeScheme */) const { + // XXX color by time spend waiting for a ride + /* + switch (activeScheme) { + case 7: + return getSpeed(); + case 8: + return getWaitingSeconds(); + case 9: + return getLastLaneChangeOffset(); + case 10: + return getMaxSpeed(); + case 11: + return getHBEFA_CO2Emissions(); + case 12: + return getHBEFA_COEmissions(); + case 13: + return getHBEFA_PMxEmissions(); + case 14: + return getHBEFA_NOxEmissions(); + case 15: + return getHBEFA_HCEmissions(); + case 16: + return getHBEFA_FuelConsumption(); + case 17: + return getHarmonoise_NoiseEmissions(); + case 18: + if (getNumberReroutes() == 0) { + return -1; + } + return getNumberReroutes(); + } + */ + return 0; +} + + +Position +GUIPerson::getPosition(SUMOTime now) const { + if ((*myStep)->getStageType() == DRIVING && !isWaiting4Vehicle()) { + return myPositionInVehicle; + } + return MSPerson::getPosition(now); +} + + +void +GUIPerson::drawAction_drawAsTriangle(const GUIVisualizationSettings& /* s */) const { + // draw triangle pointing down + glBegin(GL_TRIANGLES); + glVertex2d(0., 0.); + glVertex2d(-.5, 1.); + glVertex2d(.5, 1.); + glEnd(); +} + + +void +GUIPerson::drawAction_drawAsPoly(const GUIVisualizationSettings& /* s */) const { + // draw pedestrian shape + const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); + glRotated(getAngle(now), 0, 0, 1); + RGBColor lighter = GLHelper::getColor().changedBrightness(.2); + glTranslated(0, 0, .045); + GLHelper::drawFilledCircle(0.3); + glTranslated(0, 0, -.045); + glScaled(.7, 2, 1); + glTranslated(0, 0, .04); + GLHelper::setColor(lighter); + GLHelper::drawFilledCircle(0.3); + glTranslated(0, 0, -.04); +} + + +void +GUIPerson::drawAction_drawAsImage(const GUIVisualizationSettings& s) const { + if (getVehicleType().getGuiShape() == SVS_PEDESTRIAN) { + const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); + glRotated(getAngle(now), 0, 0, 1); + } + const std::string& file = getVehicleType().getImgFile(); + if (file != "") { + int textureID = GUITexturesHelper::getTextureID(file); + if (textureID > 0) { + const SUMOReal halfLength = getVehicleType().getLength() / 2.0 * s.vehicleExaggeration; + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * s.vehicleExaggeration; + GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength); + } + } else { + // fallback if no image is defined + drawAction_drawAsPoly(s); + } +} +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIPerson.h sumo-0.16.0~dfsg/src/guisim/GUIPerson.h --- sumo-0.15.0~dfsg/src/guisim/GUIPerson.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIPerson.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,201 @@ +/****************************************************************************/ +/// @file GUIPerson.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: GUIPerson.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// A MSVehicle extended by some values for usage within the gui +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef GUIPerson_h +#define GUIPerson_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class GUISUMOAbstractView; +class GUIGLObjectPopupMenu; +class MSDevice_Vehroutes; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GUIPerson + */ +class GUIPerson : public MSPerson, public GUIGlObject { +public: + /** @brief Constructor + */ + GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan); + + + /// @brief destructor + ~GUIPerson(); + + + /// @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 Draws additionally triggered visualisations + * @param[in] parent The view + * @param[in] s The settings for the current view (may influence drawing) + */ + virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const; + //@} + + /* @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 Position& pos) { + myPositionInVehicle = pos; + } + + + /// @brief overrides the base method and returns myPositionInVehicle while in driving stage + Position getPosition(SUMOTime now) const; + + /** + * @class GUIPersonPopupMenu + * + * A popup-menu for vehicles. In comparison to the normal popup-menu, this one + * also allows to trigger further visualisations and to track the vehicle. + */ + class GUIPersonPopupMenu : public GUIGLObjectPopupMenu { + //FXDECLARE(GUIPersonPopupMenu) + 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) + */ + GUIPersonPopupMenu(GUIMainWindow& app, + GUISUMOAbstractView& parent, GUIGlObject& o, std::map& additionalVisualizations); + + /// @brief Destructor + ~GUIPersonPopupMenu(); + + + protected: + /// @brief Information which additional visualisations are enabled (per view) + std::map& myVehiclesAdditionalVisualizations; + /// @brief Needed for parameterless instantiation + std::map dummy; + + protected: + /// @brief default constructor needed by FOX + GUIPersonPopupMenu() : myVehiclesAdditionalVisualizations(dummy) { } + + }; + + + + /// @brief Enabled visualisations, per view + std::map myAdditionalVisualizations; + + + + +private: + /// The mutex used to avoid concurrent updates of the vehicle buffer + mutable MFXMutex myLock; + + /// The position of a person while riding a vehicle + Position myPositionInVehicle; + + /// @brief sets the color according to the currente settings + void setColor(const GUIVisualizationSettings& s) const; + + /// @brief gets the color value according to the current scheme index + SUMOReal getColorValue(size_t activeScheme) const; + + /// @brief sets the color according to the current scheme index and some vehicle function + bool setFunctionalColor(size_t activeScheme) const; + + /// @brief whether the person is visualized as stopped + bool myAmVisualizedAsStopped; + + /// @name drawing helper methods + /// @{ + void drawAction_drawAsTriangle(const GUIVisualizationSettings& s) const; + void drawAction_drawAsPoly(const GUIVisualizationSettings& s) const; + void drawAction_drawAsImage(const GUIVisualizationSettings& s) const; + /// @} +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIPersonControl.cpp sumo-0.16.0~dfsg/src/guisim/GUIPersonControl.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIPersonControl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIPersonControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,58 @@ +/****************************************************************************/ +/// @file GUIPersonControl.cpp +/// @author Daniel Krajzewicz +/// @date Wed, 13.06.2012 +/// @version $Id: GUIPersonControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// GUI-version of the person control for building gui persons +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include "GUINet.h" +#include "GUIPersonControl.h" +#include "GUIPerson.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +GUIPersonControl::GUIPersonControl() {} + + +GUIPersonControl::~GUIPersonControl() { +} + + +MSPerson* +GUIPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const { + return new GUIPerson(pars, vtype, plan); +} + + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIPersonControl.h sumo-0.16.0~dfsg/src/guisim/GUIPersonControl.h --- sumo-0.15.0~dfsg/src/guisim/GUIPersonControl.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIPersonControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,65 @@ +/****************************************************************************/ +/// @file GUIPersonControl.h +/// @author Daniel Krajzewicz +/// @date Wed, 13.06.2012 +/// @version $Id: GUIPersonControl.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// GUI-version of the person control for building gui persons +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef GUIPersonControl_h +#define GUIPersonControl_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class GUIPersonControl + * @brief GUI-version of the person control for building gui persons + */ +class GUIPersonControl : public MSPersonControl { +public: + /// constructor + GUIPersonControl(); + + + /// destructor + virtual ~GUIPersonControl(); + + + /** @brief Builds a new person + * @param[in] pars The parameter + * @param[in] vtype The type (reusing vehicle type container here) + * @param[in] plan This person's plan + */ + virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const; + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIShapeContainer.cpp sumo-0.16.0~dfsg/src/guisim/GUIShapeContainer.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIShapeContainer.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIShapeContainer.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 08.10.2009 -/// @version $Id: GUIShapeContainer.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIShapeContainer.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for geometrical objects extended by mutexes /****************************************************************************/ @@ -34,6 +34,8 @@ #include #include #include +#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -51,124 +53,109 @@ bool -GUIShapeContainer::addPoI(const std::string& name, int layer, const std::string& type, const RGBColor& c, - const Position& pos) { - GUIPointOfInterest* p = new GUIPointOfInterest(layer, name, type, pos, c); - myLock.lock(); - const bool ret = add(layer, p); - if (ret) { - myVis.addAdditionalGLObject(p); - } else { +GUIShapeContainer::addPOI(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile, + const Position& pos, SUMOReal width, SUMOReal height) { + GUIPointOfInterest* p = new GUIPointOfInterest(id, type, color, pos, layer, angle, imgFile, width, height); + AbstractMutex::ScopedLocker locker(myLock); + if (!myPOIs.add(id, p)) { delete p; + return false; + } else { + myVis.addAdditionalGLObject(p); + return true; } - myLock.unlock(); - return ret; } bool -GUIShapeContainer::addPolygon(const std::string& name, int layer, const std::string& type, const RGBColor& c, - bool filled, const PositionVector& shape) { - GUIPolygon* p = new GUIPolygon(layer, name, type, c, shape, filled); - myLock.lock(); - const bool ret = add(layer, p); - if (ret) { - myVis.addAdditionalGLObject(p); - } else { +GUIShapeContainer::addPolygon(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, + SUMOReal angle, const std::string& imgFile, + const PositionVector& shape, bool fill) { + GUIPolygon* p = new GUIPolygon(id, type, color, shape, fill, layer, angle, imgFile); + AbstractMutex::ScopedLocker locker(myLock); + if (!myPolygons.add(id, p)) { delete p; + return false; + } else { + myVis.addAdditionalGLObject(p); + return true; } - myLock.unlock(); - return ret; } - bool -GUIShapeContainer::removePoI(int layer, const std::string& id) { - myLock.lock(); - if (myPOILayers.find(layer) == myPOILayers.end()) { - myLock.unlock(); - return false; - } - NamedObjectCont &c = myPOILayers.find(layer)->second; - PointOfInterest* p = c.get(id); +GUIShapeContainer::removePolygon(const std::string& id) { + AbstractMutex::ScopedLocker locker(myLock); + GUIPolygon* p = dynamic_cast(myPolygons.get(id)); if (p == 0) { - myLock.unlock(); return false; } - myVis.removeAdditionalGLObject(static_cast(p)); - bool ret = c.remove(id); - myLock.unlock(); - return ret; + myVis.removeAdditionalGLObject(p); + return myPolygons.remove(id); } bool -GUIShapeContainer::removePolygon(int layer, const std::string& id) { - myLock.lock(); - if (myPolygonLayers.find(layer) == myPolygonLayers.end()) { - myLock.unlock(); - return false; - } - GUIPolygon* p = static_cast(myPolygonLayers.find(layer)->second.get(id)); +GUIShapeContainer::removePOI(const std::string& id) { + AbstractMutex::ScopedLocker locker(myLock); + GUIPointOfInterest* p = dynamic_cast(myPOIs.get(id)); if (p == 0) { - myLock.unlock(); return false; } myVis.removeAdditionalGLObject(p); - bool ret = myPolygonLayers.find(layer)->second.remove(id); - myLock.unlock(); - return ret; + return myPOIs.remove(id); } - void -GUIShapeContainer::movePoI(int layer, const std::string& id, const Position& pos) { - myLock.lock(); - if (myPOILayers.find(layer) != myPOILayers.end()) { - PointOfInterest* p = myPOILayers.find(layer)->second.get(id); - if (p != 0) { - myVis.removeAdditionalGLObject(static_cast(p)); - static_cast(p)->set(pos); - myVis.addAdditionalGLObject(static_cast(p)); - } +GUIShapeContainer::movePOI(const std::string& id, const Position& pos) { + AbstractMutex::ScopedLocker locker(myLock); + GUIPointOfInterest* p = dynamic_cast(myPOIs.get(id)); + if (p != 0) { + myVis.removeAdditionalGLObject(p); + static_cast(p)->set(pos); + myVis.addAdditionalGLObject(p); } - myLock.unlock(); } void -GUIShapeContainer::reshapePolygon(int layer, const std::string& id, const PositionVector& shape) { - myLock.lock(); - if (myPolygonLayers.find(layer) != myPolygonLayers.end()) { - GUIPolygon* p = static_cast(myPolygonLayers.find(layer)->second.get(id)); - if (p != 0) { - myVis.removeAdditionalGLObject(p); - p->setShape(shape); - myVis.addAdditionalGLObject(p); - } +GUIShapeContainer::reshapePolygon(const std::string& id, const PositionVector& shape) { + AbstractMutex::ScopedLocker locker(myLock); + GUIPolygon* p = dynamic_cast(myPolygons.get(id)); + if (p != 0) { + myVis.removeAdditionalGLObject(p); + p->setShape(shape); + myVis.addAdditionalGLObject(p); } - myLock.unlock(); } + std::vector -GUIShapeContainer::getShapeIDs() const { +GUIShapeContainer::getPOIIds() const { + AbstractMutex::ScopedLocker locker(myLock); std::vector ret; - for (int j = myMinLayer; j <= myMaxLayer; ++j) { - const PolyMap& pol = getPolygonCont(j).getMyMap(); - for (PolyMap::const_iterator i = pol.begin(); i != pol.end(); ++i) { - ret.push_back(static_cast((*i).second)->getGlID()); - } - const std::map &poi = getPOICont(j).getMyMap(); - for (std::map::const_iterator i = poi.begin(); i != poi.end(); ++i) { - ret.push_back(static_cast((*i).second)->getGlID()); - } + const std::map& pois = getPOIs().getMyMap(); + for (std::map::const_iterator it = pois.begin(); it != pois.end(); ++it) { + ret.push_back(static_cast(it->second)->getGlID()); } return ret; } +std::vector +GUIShapeContainer::getPolygonIDs() const { + AbstractMutex::ScopedLocker locker(myLock); + std::vector ret; + const std::map& polygons = getPolygons().getMyMap(); + for (std::map::const_iterator it = polygons.begin(); it != polygons.end(); ++it) { + ret.push_back(static_cast(it->second)->getGlID()); + } + return ret; +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIShapeContainer.h sumo-0.16.0~dfsg/src/guisim/GUIShapeContainer.h --- sumo-0.15.0~dfsg/src/guisim/GUIShapeContainer.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIShapeContainer.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 08.10.2009 -/// @version $Id: GUIShapeContainer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIShapeContainer.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for geometrical objects extended by mutexes /****************************************************************************/ @@ -35,12 +35,12 @@ #include #include - // =========================================================================== // class declarations // =========================================================================== class SUMORTree; class Position; +class MFXMutex; // =========================================================================== @@ -54,84 +54,86 @@ class GUIShapeContainer : public ShapeContainer { public: /// @brief Constructor - GUIShapeContainer(SUMORTree& vis) ; + GUIShapeContainer(SUMORTree& vis); /// @brief Destructor - virtual ~GUIShapeContainer() ; - + virtual ~GUIShapeContainer(); - - /** @brief Builds a PoI using the given values and adds it to the according layer - * @param[in] name The name of the PoI to add - * @param[in] layer The layer to add the PoI to - * @param[in] type The type of the PoI to add - * @param[in] c The color of the PoI to add - * @param[in] pos The position of the PoI to add - * @return Whether the PoI could be added (no other with same id exists in the layer) - * @see ShapeContainer::addPoI - */ - virtual bool addPoI(const std::string& name, int layer, const std::string& type, - const RGBColor& c, const Position& pos) ; - - - /** @brief Builds a polygon using the given values and adds it to the according layer - * @param[in] name The name of the polygon to add - * @param[in] layer The layer to add the polygon to - * @param[in] type The type of the polygon to add - * @param[in] c The color of the polygon to add - * @param[in] pos The position of the polygon to add - * @return Whether the polygon could be added (no other with same id exists in the layer) - * @see ShapeContainer::addPolygon - */ - virtual bool addPolygon(const std::string& name, int layer, - const std::string& type, const RGBColor& c, bool filled, const PositionVector& shape) ; + /** @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] shape The shape of the polygon + * @param[in] fill Whether the polygon shall be filled + * @return whether the polygon could be added + */ + virtual bool addPolygon(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, + SUMOReal angle, const std::string& imgFile, + const PositionVector& shape, bool fill); + + + /** @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] 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] pos The position of the POI + * @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 + */ + virtual bool addPOI(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile, + const Position& pos, SUMOReal width, SUMOReal height); /** @brief Removes a polygon from the container - * @param[in] layer The layer the polygon is located in * @param[in] id The id of the polygon * @return Whether the polygon could be removed - * @see ShapeContainer::removePolygon */ - bool removePolygon(int layer, const std::string& id) ; + virtual bool removePolygon(const std::string& id); /** @brief Removes a PoI from the container - * @param[in] layer The layer the PoI is located in * @param[in] id The id of the PoI * @return Whether the poi could be removed - * @see ShapeContainer::removePoI */ - bool removePoI(int layer, const std::string& id) ; + virtual bool removePOI(const std::string& id); /** @brief Assigns a new position to the named PoI - * @param[in] layer The layer the PoI is located in * @param[in] id The id of the PoI to move * @param[in] pos The PoI's new position - * @see ShapeContainer::movePoI */ - void movePoI(int layer, const std::string& id, const Position& pos) ; + virtual void movePOI(const std::string& id, const Position& pos); /** @brief Assigns a shape to the named polygon - * @param[in] layer The layer the polygon is located in * @param[in] id The id of the polygon to reshape * @param[in] shape The polygon's new shape */ - void reshapePolygon(int layer, const std::string& id, const PositionVector& shape) ; + virtual void reshapePolygon(const std::string& id, const PositionVector& shape); + - /// Returns the gl-ids of all shapes - std::vector getShapeIDs() const; + /// Returns the gl-ids of all pois + std::vector getPOIIds() const; + /// Returns the gl-ids of all polygons + std::vector getPolygonIDs() const; private: /// @brief The mutex for adding/removing operations - MFXMutex myLock; + mutable MFXMutex myLock; /// @brief The RTree structure to add and remove visualization elements SUMORTree& myVis; diff -Nru sumo-0.15.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.cpp sumo-0.16.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.cpp --- sumo-0.15.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Oct/Nov 2003 -/// @version $Id: GUITrafficLightLogicWrapper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITrafficLightLogicWrapper.cpp 12284 2012-04-29 19:53:27Z behrisch $ /// // A wrapper for tl-logics to allow their visualisation and interaction /****************************************************************************/ @@ -31,12 +31,6 @@ #include #endif -#ifdef WIN32 -#include -#endif - -#include - #include #include #include @@ -55,6 +49,7 @@ #include #include "GUITrafficLightLogicWrapper.h" #include "GUINet.h" +#include #ifdef CHECK_MEMORY_LEAKS #include diff -Nru sumo-0.15.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.h sumo-0.16.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.h --- sumo-0.15.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUITrafficLightLogicWrapper.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct/Nov 2003 -/// @version $Id: GUITrafficLightLogicWrapper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITrafficLightLogicWrapper.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A wrapper for tl-logics to allow their visualisation and interaction /****************************************************************************/ @@ -55,10 +55,10 @@ class GUITrafficLightLogicWrapper : public GUIGlObject { public: /// Constructor - GUITrafficLightLogicWrapper(MSTLLogicControl& control, MSTrafficLightLogic& tll) ; + GUITrafficLightLogicWrapper(MSTLLogicControl& control, MSTrafficLightLogic& tll); /// Destructor - ~GUITrafficLightLogicWrapper() ; + ~GUITrafficLightLogicWrapper(); @@ -73,7 +73,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -84,7 +84,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -92,14 +92,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} @@ -130,7 +130,7 @@ GUISUMOAbstractView& parent, GUIGlObject& o); /// Destructor - ~GUITrafficLightLogicWrapperPopupMenu() ; + ~GUITrafficLightLogicWrapperPopupMenu(); /// Called if the phases shall be shown long onCmdShowPhases(FXObject*, FXSelector, void*); diff -Nru sumo-0.15.0~dfsg/src/guisim/GUITriggeredRerouter.cpp sumo-0.16.0~dfsg/src/guisim/GUITriggeredRerouter.cpp --- sumo-0.15.0~dfsg/src/guisim/GUITriggeredRerouter.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUITriggeredRerouter.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25.07.2005 -/// @version $Id: GUITriggeredRerouter.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITriggeredRerouter.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Reroutes vehicles passing an edge (gui version) /****************************************************************************/ @@ -30,12 +30,6 @@ #include #endif -#ifdef _WIN32 -#include -#endif - -#include - #include #include #include @@ -59,6 +53,7 @@ #include #include #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -234,35 +229,37 @@ * ----------------------------------------------------------------------- */ GUITriggeredRerouter::GUITriggeredRerouter( const std::string& id, - const std::vector &edges, - SUMOReal prob, const std::string& aXMLFilename, bool off) - : MSTriggeredRerouter(id, edges, prob, aXMLFilename, off), - GUIGlObject_AbstractAdd("rerouter", GLO_TRIGGER, id) { - size_t k; - size_t no = 0; - for (k = 0; k < edges.size(); k++) { - GUIEdge* gedge = static_cast(edges[k]); - no += gedge->getLanes().size(); + const std::vector& edges, + SUMOReal prob, const std::string& aXMLFilename, bool off, + SUMORTree& rtree) : + MSTriggeredRerouter(id, edges, prob, aXMLFilename, off), + GUIGlObject_AbstractAdd("rerouter", GLO_TRIGGER, id) { + // add visualisation objects for edges which trigger the rerouter + for (std::vector::const_iterator it = edges.begin(); it != edges.end(); ++it) { + myEdgeVisualizations.push_back(new GUITriggeredRerouterEdge(dynamic_cast(*it), this, false)); } - myFGPositions.reserve(no); - myFGRotations.reserve(no); - for (k = 0; k < edges.size(); k++) { - GUIEdge* gedge = static_cast(edges[k]); - const std::vector &lanes = gedge->getLanes(); - size_t noLanes = lanes.size(); - for (size_t i = 0; i < noLanes; ++i) { - const PositionVector& v = gedge->getLaneGeometry((size_t) i).getShape(); - SUMOReal pos = v.length() - (SUMOReal) 6.; - myFGPositions.push_back(v.positionAtLengthPosition(pos)); - myBoundary.add(v.positionAtLengthPosition(pos)); - Line l(v.getBegin(), v.getEnd()); - myFGRotations.push_back(-v.rotationDegreeAtLengthPosition(pos)); + // add visualisation objects for closed edges + for (std::vector::const_iterator it_interval = myIntervals.begin(); + it_interval != myIntervals.end(); ++it_interval) { + const std::vector& closed = it_interval->closed; + for (std::vector::const_iterator it = closed.begin(); it != closed.end(); ++it) { + myEdgeVisualizations.push_back(new GUITriggeredRerouterEdge(dynamic_cast(*it), this, true)); } } + // register with rtree and rerouter boundary + for (std::vector::iterator it = myEdgeVisualizations.begin(); it != myEdgeVisualizations.end(); ++it) { + rtree.addAdditionalGLObject(*it); + myBoundary.add((*it)->getCenteringBoundary()); + } } -GUITriggeredRerouter::~GUITriggeredRerouter() {} +GUITriggeredRerouter::~GUITriggeredRerouter() { + for (std::vector::iterator it = myEdgeVisualizations.begin(); it != myEdgeVisualizations.end(); ++it) { + delete *it; + } + myEdgeVisualizations.clear(); +} GUIGLObjectPopupMenu* @@ -288,97 +285,7 @@ void GUITriggeredRerouter::drawGL(const GUIVisualizationSettings& s) const { - glPushName(getGlID()); - for (size_t i = 0; i < myFGPositions.size(); ++i) { - const Position& pos = myFGPositions[i]; - SUMOReal rot = myFGRotations[i]; - glPushMatrix(); - glScaled(s.addExaggeration, s.addExaggeration, 1); - glTranslated(pos.x(), pos.y(), 0); - glRotated(rot, 0, 0, 1); - glTranslated(0, 0, getType()); - 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(); - - glTranslated(0, 0, .1); - glColor3d(0, 0, 0); - pfSetPosition(0, 0); - pfSetScale(3.f); - SUMOReal w = pfdkGetStringWidth("U"); - glRotated(180, 0, 1, 0); - glTranslated(-w / 2., 2, 0); - pfDrawString("U"); - - glTranslated(w / 2., -2, 0); - SUMOReal prob = myAmInUserMode ? myUserProbability : myProbability; - prob *= 100.; - prob = (SUMOReal)((int) prob); - std::string str = toString(prob) + "%"; - pfSetPosition(0, 0); - pfSetScale(.7f); - w = pfdkGetStringWidth(str.c_str()); - glTranslated(-w / 2., 4, 0); - pfDrawString(str.c_str()); - glPopMatrix(); - } - if (hasCurrentReroute(MSNet::getInstance()->getCurrentTimeStep()) && getProbability() > 0) { - const RerouteInterval& ri = - getCurrentReroute(MSNet::getInstance()->getCurrentTimeStep()); - for (std::vector::const_iterator i = ri.closed.begin(); i != ri.closed.end(); ++i) { - GUIEdge* gedge = static_cast(*i); - const std::vector &lanes = gedge->getLanes(); - size_t noLanes = lanes.size(); - SUMOReal prob = getProbability() * 360; - for (size_t j = 0; j < noLanes; ++j) { - const PositionVector& v = gedge->getLaneGeometry((size_t) j).getShape(); - SUMOReal d = 3.; - Position pos = v.positionAtLengthPosition(d); - SUMOReal rot = -v.rotationDegreeAtLengthPosition(d); - - glPushMatrix(); - glTranslated(pos.x(), pos.y(), 0); - glRotated(rot, 0, 0, 1); - glTranslated(0, -1.5, 0); - - int noPoints = 9; - if (s.scale > 25) { - noPoints = (int)(9.0 + s.scale / 10.0); - if (noPoints > 36) { - noPoints = 36; - } - } - glTranslated(0, 0, getType()); - glColor3d(0.7, 0, 0); - GLHelper::drawFilledCircle((SUMOReal) 1.3, noPoints); - glTranslated(0, 0, .1); - glColor3d(1, 0, 0); - GLHelper::drawFilledCircle((SUMOReal) 1.3, noPoints, 0, prob); - glTranslated(0, 0, .1); - glColor3d(1, 1, 1); - glRotated(-90, 0, 0, 1); - glBegin(GL_TRIANGLES); - glVertex2d(0 - .3, -1.); - glVertex2d(0 - .3, 1.); - glVertex2d(0 + .3, 1.); - glVertex2d(0 + .3, -1.); - glVertex2d(0 - .3, -1.); - glVertex2d(0 + .3, 1.); - glEnd(); - glPopMatrix(); - } - } - } - glPopName(); + UNUSED_PARAMETER(s); } @@ -402,6 +309,149 @@ } +/* ------------------------------------------------------------------------- + * GUITriggeredRerouterEdge - methods + * ----------------------------------------------------------------------- */ +GUITriggeredRerouter::GUITriggeredRerouterEdge::GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, bool closed) : + GUIGlObject("rerouter_edge", GLO_TRIGGER, parent->getID() + ":" + edge->getID()), + myParent(parent), + myEdge(edge), + myAmClosedEdge(closed) { + const std::vector& lanes = edge->getLanes(); + const size_t noLanes = lanes.size(); + myFGPositions.reserve(noLanes); + myFGRotations.reserve(noLanes); + for (size_t i = 0; i < noLanes; ++i) { + const PositionVector& v = edge->getLaneGeometry(i).getShape(); + SUMOReal pos = closed ? 3 : v.length() - (SUMOReal) 6.; + myFGPositions.push_back(v.positionAtLengthPosition(pos)); + myFGRotations.push_back(-v.rotationDegreeAtLengthPosition(pos)); + myBoundary.add(v.positionAtLengthPosition(pos)); + } +} + + +GUITriggeredRerouter::GUITriggeredRerouterEdge::~GUITriggeredRerouterEdge() {} + + +GUIGLObjectPopupMenu* +GUITriggeredRerouter::GUITriggeredRerouterEdge::getPopUpMenu(GUIMainWindow& app, + GUISUMOAbstractView& parent) { + return myParent->getPopUpMenu(app, parent); +} + + +GUIParameterTableWindow* +GUITriggeredRerouter::GUITriggeredRerouterEdge::getParameterWindow(GUIMainWindow&, + GUISUMOAbstractView&) { + return 0; +} + + +void +GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(const GUIVisualizationSettings& s) const { + if (s.scale * s.addExaggeration >= 3) { + glPushName(getGlID()); + const SUMOReal prob = myParent->getProbability(); + if (myAmClosedEdge) { + // draw closing symbol onto all lanes + if (myParent->hasCurrentReroute(MSNet::getInstance()->getCurrentTimeStep()) && prob > 0) { + const RerouteInterval& ri = + myParent->getCurrentReroute(MSNet::getInstance()->getCurrentTimeStep()); + // draw only if the edge is closed at this time + if (std::find(ri.closed.begin(), ri.closed.end(), myEdge) != ri.closed.end()) { + const size_t noLanes = myFGPositions.size(); + for (size_t j = 0; j < noLanes; ++j) { + Position pos = myFGPositions[j]; + SUMOReal rot = myFGRotations[j]; + glPushMatrix(); + glTranslated(pos.x(), pos.y(), 0); + glRotated(rot, 0, 0, 1); + glTranslated(0, -1.5, 0); + int noPoints = 9; + if (s.scale > 25) { + noPoints = (int)(9.0 + s.scale / 10.0); + if (noPoints > 36) { + noPoints = 36; + } + } + glTranslated(0, 0, getType()); + //glScaled(s.addExaggeration, s.addExaggeration, 1); + glColor3d(0.7, 0, 0); + GLHelper::drawFilledCircle((SUMOReal) 1.3, noPoints); + glTranslated(0, 0, .1); + glColor3d(1, 0, 0); + GLHelper::drawFilledCircle((SUMOReal) 1.3, noPoints, 0, prob * 360); + glTranslated(0, 0, .1); + glColor3d(1, 1, 1); + glRotated(-90, 0, 0, 1); + glBegin(GL_TRIANGLES); + glVertex2d(0 - .3, -1.); + glVertex2d(0 - .3, 1.); + glVertex2d(0 + .3, 1.); + glVertex2d(0 + .3, -1.); + glVertex2d(0 - .3, -1.); + glVertex2d(0 + .3, 1.); + glEnd(); + glPopMatrix(); + } + } + } + + } else { + // draw rerouter symbol onto all lanes + for (size_t i = 0; i < myFGPositions.size(); ++i) { + const Position& pos = myFGPositions[i]; + SUMOReal rot = myFGRotations[i]; + glPushMatrix(); + glTranslated(pos.x(), pos.y(), 0); + glRotated(rot, 0, 0, 1); + glTranslated(0, 0, getType()); + glScaled(s.addExaggeration, s.addExaggeration, 1); + 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(); + + glTranslated(0, 0, .1); + glColor3d(0, 0, 0); + pfSetPosition(0, 0); + pfSetScale(3.f); + SUMOReal w = pfdkGetStringWidth("U"); + glRotated(180, 0, 1, 0); + glTranslated(-w / 2., 2, 0); + pfDrawString("U"); + + glTranslated(w / 2., -2, 0); + std::string str = toString((int)(prob * 100)) + "%"; + pfSetPosition(0, 0); + pfSetScale(.7f); + w = pfdkGetStringWidth(str.c_str()); + glTranslated(-w / 2., 4, 0); + pfDrawString(str.c_str()); + glPopMatrix(); + } + } + glPopName(); + } +} + + +Boundary +GUITriggeredRerouter::GUITriggeredRerouterEdge::getCenteringBoundary() const { + Boundary b(myBoundary); + b.grow(20); + return b; +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUITriggeredRerouter.h sumo-0.16.0~dfsg/src/guisim/GUITriggeredRerouter.h --- sumo-0.15.0~dfsg/src/guisim/GUITriggeredRerouter.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUITriggeredRerouter.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25.07.2005 -/// @version $Id: GUITriggeredRerouter.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITriggeredRerouter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Reroutes vehicles passing an edge (gui-version) /****************************************************************************/ @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -47,6 +48,9 @@ /** * @class GUITriggeredRerouter * @brief Reroutes vehicles passing an edge + * One rerouter can be active on multiple edges. To reduce drawing load we + * instantiate GUIGlObjects for every edge + * XXX multiple rerouters active on the same edge are problematic */ class GUITriggeredRerouter : public MSTriggeredRerouter, @@ -60,13 +64,13 @@ * @param[in] off Whether the rerouter is off (not working) initially */ GUITriggeredRerouter(const std::string& id, - const std::vector &edges, SUMOReal prob, - const std::string& aXMLFilename, bool off); + const std::vector& edges, SUMOReal prob, + const std::string& aXMLFilename, bool off, + SUMORTree& rtree); /// @brief Destructor - ~GUITriggeredRerouter() ; - + ~GUITriggeredRerouter(); /// @name inherited from GUIGlObject @@ -80,7 +84,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -91,7 +95,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -99,14 +103,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} @@ -115,6 +119,81 @@ GUISUMOAbstractView& parent); public: + class GUITriggeredRerouterEdge : public GUIGlObject { + + public: + GUITriggeredRerouterEdge(GUIEdge* edge, GUITriggeredRerouter* parent, bool closed); + + virtual ~GUITriggeredRerouterEdge(); + + /// @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; + //@} + + private: + /// Definition of a positions container + typedef std::vector PosCont; + + /// Definition of a rotation container + typedef std::vector RotCont; + + private: + /// The parent rerouter to which this edge instance belongs + GUITriggeredRerouter* myParent; + + /// The edge for which this visualization applies + MSEdge* myEdge; + + /// whether this edge instance visualizes a closed edge + const bool myAmClosedEdge; + + /// The positions in full-geometry mode + PosCont myFGPositions; + + /// The rotations in full-geometry mode + RotCont myFGRotations; + + /// The boundary of this rerouter + Boundary myBoundary; + }; + +public: class GUITriggeredRerouterPopupMenu : public GUIGLObjectPopupMenu { FXDECLARE(GUITriggeredRerouterPopupMenu) public: @@ -122,7 +201,7 @@ GUITriggeredRerouterPopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o); - ~GUITriggeredRerouterPopupMenu() ; + ~GUITriggeredRerouterPopupMenu(); /** @brief Called if the object's manipulator shall be shown */ long onCmdOpenManip(FXObject*, FXSelector, void*); @@ -177,23 +256,13 @@ }; -private: - /// Definition of a positions container - typedef std::vector PosCont; - - /// Definition of a rotation container - typedef std::vector RotCont; private: - /// The positions in full-geometry mode - PosCont myFGPositions; - - /// The rotations in full-geometry mode - RotCont myFGRotations; - /// The boundary of this rerouter Boundary myBoundary; + std::vector myEdgeVisualizations; + }; diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIVehicle.cpp sumo-0.16.0~dfsg/src/guisim/GUIVehicle.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIVehicle.cpp 2012-02-15 00:02:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIVehicle.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVehicle.cpp 11889 2012-02-14 12:28:58Z dkrajzew $ +/// @version $Id: GUIVehicle.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ @@ -30,20 +30,16 @@ #include #endif -#ifdef WIN32 -#include -#endif - -#include - #include #include #include #include #include #include +#include #include #include +#include #include #include #include @@ -54,12 +50,14 @@ #include #include #include +#include #include #include #include "GUIVehicle.h" +#include "GUIPerson.h" #include "GUINet.h" #include "GUIEdge.h" - +#include "GUILaneWrapper.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -135,7 +133,7 @@ * ----------------------------------------------------------------------- */ GUIVehicle::GUIVehiclePopupMenu::GUIVehiclePopupMenu( GUIMainWindow& app, GUISUMOAbstractView& parent, - GUIGlObject& o, std::map &additionalVisualizations) + GUIGlObject& o, std::map& additionalVisualizations) : GUIGLObjectPopupMenu(app, parent, o), myVehiclesAdditionalVisualizations(additionalVisualizations) { } @@ -235,12 +233,13 @@ * ----------------------------------------------------------------------- */ GUIVehicle::GUIVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type, - int vehicleIndex) - : MSVehicle(pars, route, type, vehicleIndex), - GUIGlObject(GLO_VEHICLE, pars->id) { + SUMOReal speedFactor, int vehicleIndex) : + MSVehicle(pars, route, type, speedFactor, vehicleIndex), + GUIGlObject(GLO_VEHICLE, pars->id) { // as it is possible to show all vehicle routes, we have to store them... (bug [ 2519761 ]) myRoutes = MSDevice_Vehroutes::buildVehicleDevices(*this, myDevices, 5); myMoveReminders.push_back(std::make_pair(myRoutes, 0.)); + mySeatPositions.push_back(Position(0, 0)); // ensure length 1 } @@ -303,7 +302,7 @@ GUIVehicle::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { GUIParameterTableWindow* ret = - new GUIParameterTableWindow(app, *this, 15); + new GUIParameterTableWindow(app, *this, 20); // add items ret->mkItem("type [NAME]", false, myType->getID()); if (getParameter().repetitionNumber > 0) { @@ -312,6 +311,10 @@ if (getParameter().repetitionOffset > 0) { ret->mkItem("insertion period [s]", false, time2string(getParameter().repetitionOffset)); } + if (getChosenSpeedFactor() != 1) { + ret->mkItem("speed factor", false, getChosenSpeedFactor()); + } + ret->mkItem("insertion period [s]", false, time2string(getParameter().repetitionOffset)); ret->mkItem("waiting time [s]", true, new FunctionBinding(this, &MSVehicle::getWaitingSeconds)); ret->mkItem("last lane change [s]", true, @@ -323,17 +326,17 @@ new FunctionBinding(this, &GUIVehicle::getSpeed)); ret->mkItem("angle", true, new FunctionBinding(this, &MSVehicle::getAngle)); - ret->mkItem("CO2 (HBEFA) [g/s]", true, + ret->mkItem("CO2 (HBEFA) [mg/s]", true, new FunctionBinding(this, &GUIVehicle::getHBEFA_CO2Emissions)); - ret->mkItem("CO (HBEFA) [g/s]", true, + ret->mkItem("CO (HBEFA) [mg/s]", true, new FunctionBinding(this, &GUIVehicle::getHBEFA_COEmissions)); - ret->mkItem("HC (HBEFA) [g/s]", true, + ret->mkItem("HC (HBEFA) [mg/s]", true, new FunctionBinding(this, &GUIVehicle::getHBEFA_HCEmissions)); - ret->mkItem("NOx (HBEFA) [g/s]", true, + ret->mkItem("NOx (HBEFA) [mg/s]", true, new FunctionBinding(this, &GUIVehicle::getHBEFA_NOxEmissions)); - ret->mkItem("PMx (HBEFA) [g/s]", true, + ret->mkItem("PMx (HBEFA) [mg/s]", true, new FunctionBinding(this, &GUIVehicle::getHBEFA_PMxEmissions)); - ret->mkItem("fuel (HBEFA) [l/s]", true, + ret->mkItem("fuel (HBEFA) [ml/s]", true, new FunctionBinding(this, &GUIVehicle::getHBEFA_FuelConsumption)); ret->mkItem("noise (Harmonoise) [dB]", true, new FunctionBinding(this, &GUIVehicle::getHarmonoise_NoiseEmissions)); @@ -352,41 +355,41 @@ } -inline void -drawAction_drawVehicleAsBoxPlus(const GUIVehicle& veh) { +void +GUIVehicle::drawAction_drawVehicleAsBoxPlus() const { glPushMatrix(); - glScaled(veh.getVehicleType().getWidth(), veh.getVehicleType().getLength(), 1.); + glScaled(getVehicleType().getWidth(), getVehicleType().getLength(), 1.); glBegin(GL_TRIANGLE_STRIP); glVertex2d(0., 0.); glVertex2d(-.5, .15); - glVertex2d( .5, .15); + glVertex2d(.5, .15); glVertex2d(-.5, 1.); - glVertex2d( .5, 1.); + glVertex2d(.5, 1.); glEnd(); glPopMatrix(); } -inline void -drawAction_drawVehicleAsTrianglePlus(const GUIVehicle& veh) { - const SUMOReal length = veh.getVehicleType().getLength(); +void +GUIVehicle::drawAction_drawVehicleAsTrianglePlus() const { + const SUMOReal length = getVehicleType().getLength(); if (length >= 8.) { - drawAction_drawVehicleAsBoxPlus(veh); + drawAction_drawVehicleAsBoxPlus(); return; } glPushMatrix(); - glScaled(veh.getVehicleType().getWidth(), length, 1.); + glScaled(getVehicleType().getWidth(), length, 1.); glBegin(GL_TRIANGLES); glVertex2d(0., 0.); glVertex2d(-.5, 1.); - glVertex2d( .5, 1.); + glVertex2d(.5, 1.); glEnd(); glPopMatrix(); } void -drawPoly(double* poses, SUMOReal offset) { +GUIVehicle::drawPoly(double* poses, SUMOReal offset) { glPushMatrix(); glTranslated(0, 0, offset * .1); glPolygonOffset(0, offset * -1); @@ -401,17 +404,18 @@ } -inline void -drawAction_drawVehicleAsPoly(const GUIVehicle& veh) { +void +GUIVehicle::drawAction_drawVehicleAsPoly(const GUIVisualizationSettings& s) const { RGBColor current = GLHelper::getColor(); RGBColor lighter = current.changedBrightness(.2); RGBColor darker = current.changedBrightness(-.2); - SUMOReal length = veh.getVehicleType().getLength(); + const SUMOReal length = getVehicleType().getLength(); + const SUMOReal width = getVehicleType().getWidth(); glPushMatrix(); glRotated(90, 0, 0, 1); - glScaled(length, veh.getVehicleType().getWidth(), 1.); - SUMOVehicleShape shape = veh.getVehicleType().getGuiShape(); + glScaled(length, width, 1.); + SUMOVehicleShape shape = getVehicleType().getGuiShape(); // draw main body switch (shape) { @@ -539,27 +543,22 @@ break; case SVS_BUS_OVERLAND: case SVS_RAIL: + drawAction_drawRailCarriages(s, 25.0, 1); + break; case SVS_RAIL_LIGHT: + drawAction_drawRailCarriages(s, 38.0); + break; case SVS_RAIL_CITY: + drawAction_drawRailCarriages(s, 25.0); + break; case SVS_RAIL_SLOW: + drawAction_drawRailCarriages(s, 15.0, 1); + break; case SVS_RAIL_FAST: + drawAction_drawRailCarriages(s, 40.0, 1); + break; case SVS_RAIL_CARGO: - glScaled(1. / (length), 1, 1.); - glTranslated(0, 0, .04); - glBegin(GL_TRIANGLE_FAN); - glVertex2d(length/ 2., 0); - glVertex2d(0, 0); - glVertex2d(0, -.45); - glVertex2d(.05, -.5); - glVertex2d(length - .05, -.5); - glVertex2d(length, -.45); - glVertex2d(length, .45); - glVertex2d(length - .05, .5); - glVertex2d(.05, .5); - glVertex2d(0, .45); - glVertex2d(0, 0); - glEnd(); - glTranslated(0, 0, -.04); + drawAction_drawRailCarriages(s, 20.0); break; case SVS_E_VEHICLE: drawPoly(vehiclePoly_EVehicleBody, 4); @@ -803,6 +802,24 @@ } +bool +GUIVehicle::drawAction_drawVehicleAsImage(const GUIVisualizationSettings& s, SUMOReal length) const { + const std::string& file = getVehicleType().getImgFile(); + if (file != "") { + int textureID = GUITexturesHelper::getTextureID(file); + if (textureID > 0) { + if (length < 0) { + length = getVehicleType().getLength() * s.vehicleExaggeration; + } + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * s.vehicleExaggeration; + GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, 0, halfWidth, length); + return true; + } + } + return false; +} + + #define BLINKER_POS_FRONT .5 #define BLINKER_POS_BACK .5 @@ -860,7 +877,12 @@ GUIVehicle::drawGL(const GUIVisualizationSettings& s) const { glPushName(getGlID()); glPushMatrix(); - Position p1 = myLane->getShape().positionAtLengthPosition(myState.pos()); + Position p1 = myLane->getShape().positionAtLengthPosition( + myLane->interpolateLanePosToGeometryPos(myState.pos())); + // one seat in the center of the vehicle by default + mySeatPositions[0] = myLane->getShape().positionAtLengthPosition( + myLane->interpolateLanePosToGeometryPos( + myState.pos() - getVehicleType().getLength() / 2)); glTranslated(p1.x(), p1.y(), getType()); glRotated(getAngle(), 0, 0, 1); // set lane color @@ -881,14 +903,43 @@ // draw the vehicle switch (s.vehicleQuality) { case 0: - drawAction_drawVehicleAsTrianglePlus(*this); + drawAction_drawVehicleAsTrianglePlus(); break; case 1: - drawAction_drawVehicleAsBoxPlus(*this); + drawAction_drawVehicleAsBoxPlus(); break; case 2: + drawAction_drawVehicleAsPoly(s); + break; + case 3: default: - drawAction_drawVehicleAsPoly(*this); + // draw as image but take special care for drawing trains + // XXX handle default carriage lenghts someplace else + switch (getVehicleType().getGuiShape()) { + case SVS_RAIL: + drawAction_drawRailCarriages(s, 25.0, 1, true); + break; + case SVS_RAIL_LIGHT: + drawAction_drawRailCarriages(s, 38.0, true); + break; + case SVS_RAIL_CITY: + drawAction_drawRailCarriages(s, 25.0, true); + break; + case SVS_RAIL_SLOW: + drawAction_drawRailCarriages(s, 15.0, 1, true); + break; + case SVS_RAIL_FAST: + drawAction_drawRailCarriages(s, 40.0, 1, true); + break; + case SVS_RAIL_CARGO: + drawAction_drawRailCarriages(s, 20.0, true); + break; + default: + // draw normal vehicle + if (!drawAction_drawVehicleAsImage(s)) { + drawAction_drawVehicleAsPoly(s); + }; + }; break; } if (s.drawMinGap) { @@ -913,7 +964,7 @@ case SVS_RAIL_SLOW: case SVS_RAIL_FAST: case SVS_RAIL_CARGO: - // only SVS_RAIL_CITY has blinkers and brake lights + // only SVS_RAIL_CITY has blinkers and brake lights break; default: drawAction_drawVehicleBlinker(*this); @@ -947,8 +998,8 @@ */ } // draw best lanes + /* if (true) { - /* const MSLane &l = veh->getLane(); SUMOReal r1 = veh->allowedContinuationsLength(&l, 0); SUMOReal r2 = l.getLeftLane()!=0 ? veh->allowedContinuationsLength(l.getLeftLane(), 0) : 0; @@ -966,12 +1017,24 @@ glVertex2f(-.4, 0); glVertex2f(-.4, r3/mmax/2.); glEnd(); - */ } + */ glPopMatrix(); - drawName(myLane->getShape().positionAtLengthPosition(myState.pos() - getVehicleType().getLength() / 2), + drawName(myLane->getShape().positionAtLengthPosition( + myLane->interpolateLanePosToGeometryPos( + myState.pos() - MIN2(getVehicleType().getLength() / 2, SUMOReal(5)))), s.scale, s.vehicleName); glPopName(); + if (myPersonDevice != 0) { + const std::vector& ps = myPersonDevice->getPersons(); + size_t personIndex = 0; + for (std::vector::const_iterator i = ps.begin(); i != ps.end(); ++i) { + GUIPerson* person = dynamic_cast(*i); + assert(person != 0); + person->setPositionInVehicle(getSeatPosition(personIndex++)); + person->drawGL(s); + } + } } @@ -999,27 +1062,25 @@ } if (hasActiveAddVisualisation(parent, VO_SHOW_LFLINKITEMS)) { for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) { - if((*i).myLink==0) { + if ((*i).myLink == 0) { continue; } MSLink* link = (*i).myLink; -#ifdef HAVE_INTERNAL_LANES - MSLane *via = link->getViaLane(); - if (via == 0) { - via = link->getLane(); - } -#else - MSLane *via = link->getLane(); -#endif + MSLane* via = link->getViaLaneOrLane(); if (via != 0) { Position p = via->getShape()[0]; - if((*i).mySetRequest) { - glColor3f(0, 1, 0); + if ((*i).mySetRequest) { + glColor3d(0, .8, 0); } else { - glColor3f(1, 0, 0); + glColor3d(.8, 0, 0); } glTranslated(p.x(), p.y(), -.1); GLHelper::drawFilledCircle(1); + + const SUMOTime leaveTime = (*i).myArrivalTime + TIME2STEPS(((*i).myLink->getLength() + getVehicleType().getLength()) / (*i).myArrivalSpeed); + std::string times = toString(STEPS2TIME((*i).myArrivalTime)) + "/" + toString(STEPS2TIME(leaveTime)); + GLHelper::drawText(times.c_str(), Position(), .1, 1.6 * s.addExaggeration, RGBColor(0, 1, 0), 0); + glTranslated(-p.x(), -p.y(), .1); } } @@ -1029,10 +1090,10 @@ } -const std::vector & +const std::vector& GUIVehicle::getBestLanes() const { myLock.lock(); - const std::vector &ret = MSVehicle::getBestLanes(); + const std::vector& ret = MSVehicle::getBestLanes(); myLock.unlock(); return ret; } @@ -1050,19 +1111,43 @@ bool GUIVehicle::setFunctionalColor(size_t activeScheme) const { switch (activeScheme) { - case 1: { - GLHelper::setColor(getParameter().color); - return true; + 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; + } + if (&getRoute().getColor() != &RGBColor::DEFAULT_COLOR) { + GLHelper::setColor(getRoute().getColor()); + return true; + } + return false; } case 2: { - GLHelper::setColor(getVehicleType().getColor()); - return true; + if (getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(getParameter().color); + return true; + } + return false; } case 3: { - GLHelper::setColor(getRoute().getColor()); - return true; + if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(getVehicleType().getColor()); + return true; + } + return false; } case 4: { + if (&getRoute().getColor() != &RGBColor::DEFAULT_COLOR) { + GLHelper::setColor(getRoute().getColor()); + return true; + } + return false; + } + case 5: { Position p = getRoute().getEdges()[0]->getLanes()[0]->getShape()[0]; const Boundary& b = ((GUINet*) MSNet::getInstance())->getBoundary(); Position center = b.getCenter(); @@ -1071,7 +1156,7 @@ GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); return true; } - case 5: { + case 6: { Position p = getRoute().getEdges().back()->getLanes()[0]->getShape()[-1]; const Boundary& b = ((GUINet*) MSNet::getInstance())->getBoundary(); Position center = b.getCenter(); @@ -1080,7 +1165,7 @@ GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); return true; } - case 6: { + case 7: { Position pb = getRoute().getEdges()[0]->getLanes()[0]->getShape()[0]; Position pe = getRoute().getEdges().back()->getLanes()[0]->getShape()[-1]; const Boundary& b = ((GUINet*) MSNet::getInstance())->getBoundary(); @@ -1099,29 +1184,29 @@ SUMOReal GUIVehicle::getColorValue(size_t activeScheme) const { switch (activeScheme) { - case 7: - return getSpeed(); case 8: - return getWaitingSeconds(); + return getSpeed(); case 9: - return getLastLaneChangeOffset(); + return getWaitingSeconds(); case 10: - return getMaxSpeed(); + return getLastLaneChangeOffset(); case 11: - return getHBEFA_CO2Emissions(); + return getMaxSpeed(); case 12: - return getHBEFA_COEmissions(); + return getHBEFA_CO2Emissions(); case 13: - return getHBEFA_PMxEmissions(); + return getHBEFA_COEmissions(); case 14: - return getHBEFA_NOxEmissions(); + return getHBEFA_PMxEmissions(); case 15: - return getHBEFA_HCEmissions(); + return getHBEFA_NOxEmissions(); case 16: - return getHBEFA_FuelConsumption(); + return getHBEFA_HCEmissions(); case 17: - return getHarmonoise_NoiseEmissions(); + return getHBEFA_FuelConsumption(); case 18: + return getHarmonoise_NoiseEmissions(); + case 19: if (getNumberReroutes() == 0) { return -1; } @@ -1193,7 +1278,7 @@ myLock.unlock(); SUMOReal width = 0.5; for (std::vector >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) { - std::vector &lanes = *j; + std::vector& lanes = *j; SUMOReal gmax = -1; SUMOReal rmax = -1; for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { @@ -1235,5 +1320,148 @@ } +GUILaneWrapper& +GUIVehicle::getLaneWrapper() const { + GUIEdge* edge = dynamic_cast(&(myLane->getEdge())); + assert(edge != 0); + return edge->getLaneGeometry(myLane); +} + + +MSLane* +GUIVehicle::getPreviousLane(MSLane* current, int& routeIndex) const { + const bool isInternal = current->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL; + if (isInternal) { + // route pointer still points to the previous lane + return myRoute->getEdges()[routeIndex]->getLanes()[0]; + } else if (routeIndex == 0) { + // there is no previous lane because the route has just begun + return current; + } else { + // retrieve the previous internal edge + routeIndex -= 1; + const MSEdge* previous = myRoute->getEdges()[routeIndex]; +#ifdef HAVE_INTERNAL_LANES + const MSEdge* previousInternal = previous->getInternalFollowingEdge(¤t->getEdge()); +#else + const MSEdge* previousInternal = 0; +#endif + if (previousInternal != 0) { + return previousInternal->getLanes()[0]; + } else { + // network without internal links, use previous edge instead + return previous->getLanes()[0]; + } + } +} + + +void +GUIVehicle::drawAction_drawRailCarriages(const GUIVisualizationSettings& s, SUMOReal defaultLength, int firstPassengerCarriage, bool asImage) const { + RGBColor current = GLHelper::getColor(); + RGBColor darker = current.changedBrightness(-.2); + const SUMOReal length = getVehicleType().getLength() * s.vehicleExaggeration; + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * s.vehicleExaggeration; + glPopMatrix(); // undo scaling and 90 degree rotation + glPopMatrix(); // undo initial translation and rotation + glPushMatrix(); + glPushMatrix(); + GLHelper::setColor(darker); + const SUMOReal carriageGap = 1; + const SUMOReal xCornerCut = 0.3; + const SUMOReal yCornerCut = 0.4; + // round to closest integer + const int numCarriages = floor(length / (defaultLength + carriageGap) + 0.5); + assert(numCarriages > 0); + const SUMOReal carriageLengthWithGap = length / numCarriages; + const SUMOReal carriageLength = carriageLengthWithGap - carriageGap; + // lane on which the carriage front is situated + MSLane* lane = myLane; + int routeIndex = myCurrEdge - myRoute->begin(); + // lane on which the carriage back is situated + MSLane* backLane = myLane; + int backRouteIndex = routeIndex; + // offsets of front and back + SUMOReal carriageOffset = myState.pos(); + SUMOReal carriageBackOffset = myState.pos() - carriageLength; + // handle seats + int requiredSeats = getNumPassengers(); + if (requiredSeats > 0) { + mySeatPositions.clear(); + } + // draw individual carriages + for (int i = 0; i < numCarriages; ++i) { + while (carriageOffset < 0) { + lane = getPreviousLane(lane, routeIndex); + carriageOffset += lane->getLength(); + } + while (carriageBackOffset < 0) { + backLane = getPreviousLane(backLane, backRouteIndex); + carriageBackOffset += backLane->getLength(); + } + const Position front = lane->getShape().positionAtLengthPosition2D(carriageOffset); + const Position back = backLane->getShape().positionAtLengthPosition2D(carriageBackOffset); + const SUMOReal angle = atan2((front.x() - back.x()), (back.y() - front.y())) * (SUMOReal) 180.0 / (SUMOReal) PI; + if (i >= firstPassengerCarriage) { + computeSeats(front, back, requiredSeats); + } + glPushMatrix(); + glTranslated(front.x(), front.y(), getType()); + glRotated(angle, 0, 0, 1); + if (!asImage || !drawAction_drawVehicleAsImage(s, carriageLength)) { + glBegin(GL_TRIANGLE_FAN); + glVertex2d(-halfWidth + xCornerCut, 0); + glVertex2d(-halfWidth, yCornerCut); + glVertex2d(-halfWidth, carriageLength - yCornerCut); + glVertex2d(-halfWidth + xCornerCut, carriageLength); + glVertex2d(halfWidth - xCornerCut, carriageLength); + glVertex2d(halfWidth, carriageLength - yCornerCut); + glVertex2d(halfWidth, yCornerCut); + glVertex2d(halfWidth - xCornerCut, 0); + glEnd(); + } + glPopMatrix(); + carriageOffset -= carriageLengthWithGap; + carriageBackOffset -= carriageLengthWithGap; + GLHelper::setColor(current); + } +} + + +const Position& +GUIVehicle::getSeatPosition(size_t personIndex) const { + /// if there are not enough seats in the vehicle people have to squeeze onto the last seat + return mySeatPositions[(int)MIN2(personIndex, mySeatPositions.size() - 1)]; +} + + +int +GUIVehicle::getNumPassengers() const { + if (myPersonDevice != 0) { + return (int)myPersonDevice->getPersons().size(); + } + return 0; +} + + +void +GUIVehicle::computeSeats(const Position& front, const Position& back, int& requiredSeats) const { + if (requiredSeats <= 0) { + return; // save some work + } + const Line l(front, back); + const SUMOReal length = l.length2D(); + if (length < 4) { + // small vehicle, sit at the center + mySeatPositions.push_back(l.getPositionAtDistance2D(length / 2)); + requiredSeats--; + } else { + for (SUMOReal p = 2; p <= length - 1; p += 1) { + mySeatPositions.push_back(l.getPositionAtDistance2D(p)); + requiredSeats--; + } + } +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIVehicle.h sumo-0.16.0~dfsg/src/guisim/GUIVehicle.h --- sumo-0.15.0~dfsg/src/guisim/GUIVehicle.h 2012-02-08 00:02:17.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIVehicle.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVehicle.h 11847 2012-02-07 13:48:32Z dkrajzew $ +/// @version $Id: GUIVehicle.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,7 @@ // =========================================================================== class GUISUMOAbstractView; class GUIGLObjectPopupMenu; +class GUILaneWrapper; class MSDevice_Vehroutes; @@ -70,15 +72,16 @@ * @param[in] pars The vehicle description * @param[in] route The vehicle's route * @param[in] type The vehicle's type + * @param[in] speedFactor The factor for driven lane's speed limits * @param[in] vehicleIndex The vehicle's running index * @exception ProcessError If a value is wrong */ GUIVehicle(SUMOVehicleParameter* pars, const MSRoute* route, - const MSVehicleType* type, int vehicleIndex) ; + const MSVehicleType* type, SUMOReal speedFactor, int vehicleIndex); /// @brief destructor - ~GUIVehicle() ; + ~GUIVehicle(); /// @name inherited from GUIGlObject @@ -91,7 +94,7 @@ * @return The built popup-menu * @see GUIGlObject::getPopUpMenu */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -101,7 +104,7 @@ * @return The built parameter window * @see GUIGlObject::getParameterWindow */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -109,14 +112,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; @@ -124,7 +127,7 @@ * @param[in] parent The view * @param[in] s The settings for the current view (may influence drawing) */ - virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const ; + virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const; //@} @@ -137,7 +140,7 @@ * @param[in] which The visualisation feature * @return see comment */ - bool hasActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) const ; + bool hasActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) const; /** @brief Adds the named visualisation feature to the given view @@ -146,7 +149,7 @@ * @return Always true * @see GUISUMOAbstractView::addAdditionalGLVisualisation */ - bool addActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) ; + bool addActiveAddVisualisation(GUISUMOAbstractView* const parent, int which); /** @brief Adds the named visualisation feature to the given view @@ -155,7 +158,7 @@ * @return Whether the vehicle was known to the view * @see GUISUMOAbstractView::removeAdditionalGLVisualisation */ - bool removeActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) ; + bool removeActiveAddVisualisation(GUISUMOAbstractView* const parent, int which); /// @} @@ -176,7 +179,8 @@ * @return The best lanes structure holding matching the current vehicle position and state ahead * @see MSVehicle::getBestLanes */ - const std::vector &getBestLanes() const ; + const std::vector& getBestLanes() const; + /** * @class GUIVehiclePopupMenu @@ -194,10 +198,10 @@ * @param[in, out] additionalVisualizations Information which additional visualisations are enabled (per view) */ GUIVehiclePopupMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent, GUIGlObject& o, std::map &additionalVisualizations); + GUISUMOAbstractView& parent, GUIGlObject& o, std::map& additionalVisualizations); /// @brief Destructor - ~GUIVehiclePopupMenu() ; + ~GUIVehiclePopupMenu(); /// @brief Called if all routes of the vehicle shall be shown long onCmdShowAllRoutes(FXObject*, FXSelector, void*); @@ -222,7 +226,7 @@ protected: /// @brief Information which additional visualisations are enabled (per view) - std::map &myVehiclesAdditionalVisualizations; + std::map& myVehiclesAdditionalVisualizations; /// @brief Needed for parameterless instantiation std::map dummy; @@ -258,7 +262,7 @@ /** @brief Draws the route * @param[in] r The route to draw */ - void draw(const MSRoute& r) const ; + void draw(const MSRoute& r) const; /** @brief Chooses the route to draw and draws it, darkening it as given @@ -266,21 +270,24 @@ * @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, SUMOReal darken) const ; + void drawRoute(const GUIVisualizationSettings& s, int routeNo, SUMOReal darken) const; /** @brief Draws the vehicle's best lanes */ - void drawBestLanes() const ; + void drawBestLanes() const; /// @} private: + /// The mutex used to avoid concurrent updates of the vehicle buffer mutable MFXMutex myLock; MSDevice_Vehroutes* myRoutes; +private: + /// @brief sets the color according to the currente settings void setColor(const GUIVisualizationSettings& s) const; @@ -289,6 +296,47 @@ /// @brief sets the color according to the current scheme index and some vehicle function bool setFunctionalColor(size_t activeScheme) const; + + /// @brief retrieves the laneWrapper for this vehicles lane + GUILaneWrapper& getLaneWrapper() const; + + /// @name drawing helper methods + /// @{ + static void drawPoly(double* poses, SUMOReal offset); + + void drawAction_drawVehicleAsBoxPlus() const; + void drawAction_drawVehicleAsTrianglePlus() const; + void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings& s) const; + + /* @brief try to draw vehicle as raster image and return true if sucessful + * @param[in] length The custom length of the vehicle + * (defaults to the * length specified in the vehicle type if -1 is passed) + */ + bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings& s, SUMOReal length = -1) const; + + /* @brief draw train with individual carriages. The number of carriages is + * determined from defaultLength of carriages and vehicle length + * passengerSeats are computed beginning at firstPassengerCarriage */ + void drawAction_drawRailCarriages(const GUIVisualizationSettings& s, SUMOReal defaultLength, int firstPassengerCarriage = 0, bool asImage = false) const; + /// @} + + /* @brief return the previous lane in this vehicles route including internal lanes + * @param[in] current The lane of which the predecessor should be returned + * @param[in,out] routeIndex The index of the current or previous non-internal edge in the route + */ + MSLane* getPreviousLane(MSLane* current, int& routeIndex) const; + + /// @brief returns the seat position for the person with the given index + const Position& getSeatPosition(size_t personIndex) const; + + /// @brief positions of seats in the vehicle (updated at every drawing step) + mutable PositionVector mySeatPositions; + + /// @brief return the number of passengers + int getNumPassengers() const; + + /// @brief add seats to mySeatPositions and update requiredSeats + void computeSeats(const Position& front, const Position& back, int& requiredSeats) const; }; diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIVehicleControl.cpp sumo-0.16.0~dfsg/src/guisim/GUIVehicleControl.cpp --- sumo-0.15.0~dfsg/src/guisim/GUIVehicleControl.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIVehicleControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: GUIVehicleControl.cpp 11747 2012-01-20 08:29:46Z namdre $ +/// @version $Id: GUIVehicleControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The class responsible for building and deletion of vehicles (gui-version) /****************************************************************************/ @@ -60,7 +60,7 @@ GUIVehicleControl::buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, const MSVehicleType* type) { myLoadedVehNo++; - MSVehicle* built = new GUIVehicle(defs, route, type, myLoadedVehNo - 1); + MSVehicle* built = new GUIVehicle(defs, route, type, type->computeChosenSpeedDeviation(myVehicleParamsRNG), myLoadedVehNo - 1); MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); return built; } @@ -68,24 +68,21 @@ bool GUIVehicleControl::addVehicle(const std::string& id, SUMOVehicle* v) { - myLock.lock(); - const bool result = MSVehicleControl::addVehicle(id, v); - myLock.unlock(); - return result; + AbstractMutex::ScopedLocker locker(myLock); + return MSVehicleControl::addVehicle(id, v); } void GUIVehicleControl::deleteVehicle(SUMOVehicle* veh, bool discard) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); MSVehicleControl::deleteVehicle(veh, discard); - myLock.unlock(); } void -GUIVehicleControl::insertVehicleIDs(std::vector &into) { - myLock.lock(); +GUIVehicleControl::insertVehicleIDs(std::vector& into) { + AbstractMutex::ScopedLocker locker(myLock); into.reserve(myVehicleDict.size()); for (VehicleDictType::iterator i = myVehicleDict.begin(); i != myVehicleDict.end(); ++i) { SUMOVehicle* veh = (*i).second; @@ -93,6 +90,17 @@ into.push_back(static_cast((*i).second)->getGlID()); } } +} + + +void +GUIVehicleControl::secureVehicles() { + myLock.lock(); +} + + +void +GUIVehicleControl::releaseVehicles() { myLock.unlock(); } diff -Nru sumo-0.15.0~dfsg/src/guisim/GUIVehicleControl.h sumo-0.16.0~dfsg/src/guisim/GUIVehicleControl.h --- sumo-0.15.0~dfsg/src/guisim/GUIVehicleControl.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUIVehicleControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: GUIVehicleControl.h 11747 2012-01-20 08:29:46Z namdre $ +/// @version $Id: GUIVehicleControl.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The class responsible for building and deletion of vehicles (gui-version) /****************************************************************************/ @@ -58,11 +58,11 @@ class GUIVehicleControl : public MSVehicleControl { public: /// @brief Constructor - GUIVehicleControl() ; + GUIVehicleControl(); /// @brief Destructor - ~GUIVehicleControl() ; + ~GUIVehicleControl(); /// @name Vehicle creation @@ -72,17 +72,14 @@ * * Instead of a MSVehicle, a GUIVehicle is built * - * @param[in] id The id of the vehicle to build + * @param[in] defs The parameter defining the vehicle * @param[in] route The route of this vehicle - * @param[in] departTime The departure time of this vehicle * @param[in] type The type of this vehicle - * @param[in] repNo The number of repetitions - * @param[in] repOffset The repetition offset - * @return The built vehicle (GUIVehicle instance) + * @return The built vehicle (MSVehicle instance) * @see MSVehicleControl::buildVehicle */ SUMOVehicle* buildVehicle(SUMOVehicleParameter* defs, - const MSRoute* route, const MSVehicleType* type) ; + const MSRoute* route, const MSVehicleType* type); /// @} @@ -94,7 +91,7 @@ * @param[in] v The vehicle * @return Whether the vehicle could be inserted (no other vehicle with the same id was inserted before) */ - bool addVehicle(const std::string& id, SUMOVehicle* v) ; + bool addVehicle(const std::string& id, SUMOVehicle* v); /** @brief Deletes the vehicle @@ -104,14 +101,21 @@ * @param[in] v The vehicle to delete * @param[discard] Whether the vehicle is discard during loading (scale < 1) */ - void deleteVehicle(SUMOVehicle* v, bool discard=false); + void deleteVehicle(SUMOVehicle* v, bool discard = false); /** @brief Returns the list of all known vehicles by gl-id * @param[fill] into The list to fill with vehicle ids * @todo Well, what about concurrent modifications? */ - void insertVehicleIDs(std::vector &into) ; + void insertVehicleIDs(std::vector& into); + + + /// @brief lock access to vehicle removal/additions for thread synchronization + void secureVehicles(); + + /// @brief unlock access to vehicle removal/additions for thread synchronization + void releaseVehicles(); private: diff -Nru sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_Collector.cpp sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_Collector.cpp --- sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_Collector.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_Collector.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_Collector.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUI_E2_ZS_Collector.cpp 12284 2012-04-29 19:53:27Z behrisch $ /// // The gui-version of the MS_E2_ZS_Collector /****************************************************************************/ @@ -41,12 +41,7 @@ #include #include #include "GUIEdge.h" - -#ifdef _WIN32 -#include -#endif - -#include +#include #ifdef CHECK_MEMORY_LEAKS #include diff -Nru sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_Collector.h sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_Collector.h --- sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_Collector.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_Collector.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_Collector.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: GUI_E2_ZS_Collector.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The gui-version of the MS_E2_ZS_Collector /****************************************************************************/ @@ -77,11 +77,11 @@ GUI_E2_ZS_Collector(const std::string& id, DetectorUsage usage, MSLane* const lane, SUMOReal startPos, SUMOReal detLength, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /// @brief Destructor - ~GUI_E2_ZS_Collector() ; + ~GUI_E2_ZS_Collector(); /** @brief Returns the wrapper for this detector @@ -99,10 +99,10 @@ class MyWrapper : public GUIDetectorWrapper { public: /// @brief Constructor - MyWrapper(GUI_E2_ZS_Collector& detector) ; + MyWrapper(GUI_E2_ZS_Collector& detector); /// @brief Destrutor - ~MyWrapper() ; + ~MyWrapper(); /// @name inherited from GUIGlObject @@ -116,7 +116,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -124,14 +124,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} diff -Nru sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp --- sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_CollectorOverLanes.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUI_E2_ZS_CollectorOverLanes.cpp 12428 2012-06-26 11:24:19Z behrisch $ /// // The gui-version of a MS_E2_ZS_CollectorOverLanes. /****************************************************************************/ @@ -41,11 +41,6 @@ #include "GUILaneWrapper.h" #include "GUI_E2_ZS_CollectorOverLanes.h" -#ifdef _WIN32 -#include -#include /* OpenGL header file */ -#endif // _WIN32 - #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -98,9 +93,6 @@ : GUIDetectorWrapper("E2OverLanes detector", detector.getID()), myDetector(detector) { for (LaneDetMap::const_iterator i = detectors.begin(); i != detectors.end(); ++i) { - MSLane* l = (*i).first; - GUIEdge& edge = static_cast(l->getEdge()); - GUILaneWrapper& w = edge.getLaneGeometry(l); GUI_E2_ZS_Collector* c = static_cast((*i).second); GUIDetectorWrapper* dw = c->buildDetectorGUIRepresentation(); mySubWrappers.push_back(dw); diff -Nru sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.h sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.h --- sumo-0.15.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_CollectorOverLanes.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUI_E2_ZS_CollectorOverLanes.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The gui-version of a MS_E2_ZS_CollectorOverLanes. /****************************************************************************/ @@ -69,10 +69,10 @@ MSLane* lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /// Destructor - ~GUI_E2_ZS_CollectorOverLanes() ; + ~GUI_E2_ZS_CollectorOverLanes(); // invalid in fact, as collectors do not need a lane virtual GUIDetectorWrapper* buildDetectorGUIRepresentation(); @@ -80,7 +80,7 @@ protected: MSE2Collector* buildCollector(size_t c, size_t r, - MSLane* l, SUMOReal start, SUMOReal end) ; + MSLane* l, SUMOReal start, SUMOReal end); public: @@ -92,10 +92,10 @@ public: /// Constructor MyWrapper(GUI_E2_ZS_CollectorOverLanes& detector, - const LaneDetMap& detectors) ; + const LaneDetMap& detectors); /// Destrutor - ~MyWrapper() ; + ~MyWrapper(); /// @name inherited from GUIGlObject @@ -109,7 +109,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow( - GUIMainWindow& app, GUISUMOAbstractView& parent) ; + GUIMainWindow& app, GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -117,14 +117,14 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} diff -Nru sumo-0.15.0~dfsg/src/guisim/Makefile.am sumo-0.16.0~dfsg/src/guisim/Makefile.am --- sumo-0.15.0~dfsg/src/guisim/Makefile.am 2011-09-13 23:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/Makefile.am 2012-09-25 22:01:46.000000000 +0000 @@ -11,6 +11,7 @@ GUILane.cpp GUILane.h \ GUILaneSpeedTrigger.cpp GUILaneSpeedTrigger.h \ GUILaneWrapper.cpp GUILaneWrapper.h \ +GUIPerson.cpp GUIPerson.h GUIPersonControl.cpp GUIPersonControl.h \ GUINet.cpp GUINet.h \ GUIShapeContainer.cpp GUIShapeContainer.h \ GUITrafficLightLogicWrapper.cpp GUITrafficLightLogicWrapper.h \ diff -Nru sumo-0.15.0~dfsg/src/guisim/Makefile.in sumo-0.16.0~dfsg/src/guisim/Makefile.in --- sumo-0.15.0~dfsg/src/guisim/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -55,7 +55,8 @@ GUIInductLoop.$(OBJEXT) GUIInstantInductLoop.$(OBJEXT) \ GUIInternalLane.$(OBJEXT) GUIJunctionWrapper.$(OBJEXT) \ GUILane.$(OBJEXT) GUILaneSpeedTrigger.$(OBJEXT) \ - GUILaneWrapper.$(OBJEXT) GUINet.$(OBJEXT) \ + GUILaneWrapper.$(OBJEXT) GUIPerson.$(OBJEXT) \ + GUIPersonControl.$(OBJEXT) GUINet.$(OBJEXT) \ GUIShapeContainer.$(OBJEXT) \ GUITrafficLightLogicWrapper.$(OBJEXT) \ GUITriggeredRerouter.$(OBJEXT) GUIVehicle.$(OBJEXT) \ @@ -111,6 +112,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -141,6 +143,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -175,6 +178,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -208,7 +212,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -240,6 +243,7 @@ GUILane.cpp GUILane.h \ GUILaneSpeedTrigger.cpp GUILaneSpeedTrigger.h \ GUILaneWrapper.cpp GUILaneWrapper.h \ +GUIPerson.cpp GUIPerson.h GUIPersonControl.cpp GUIPersonControl.h \ GUINet.cpp GUINet.h \ GUIShapeContainer.cpp GUIShapeContainer.h \ GUITrafficLightLogicWrapper.cpp GUITrafficLightLogicWrapper.h \ @@ -310,6 +314,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUILaneSpeedTrigger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUILaneWrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUINet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIPerson.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIPersonControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIShapeContainer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUITrafficLightLogicWrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUITriggeredRerouter.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/guisim_main.cpp sumo-0.16.0~dfsg/src/guisim_main.cpp --- sumo-0.15.0~dfsg/src/guisim_main.cpp 2012-02-16 15:58:05.000000000 +0000 +++ sumo-0.16.0~dfsg/src/guisim_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Felix Brack /// @date Tue, 20 Nov 2001 -/// @version $Id: guisim_main.cpp 11915 2012-02-16 15:38:12Z behrisch $ +/// @version $Id: guisim_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for GUISIM /****************************************************************************/ @@ -38,8 +38,6 @@ #include #include #include -#include -#include #include #include #include @@ -52,11 +50,7 @@ #include #include #include -#include -#include #include -#include -#include #ifdef CHECK_MEMORY_LEAKS #include @@ -86,13 +80,14 @@ { #endif // initialise subsystems - XMLSubSys::init(false); + XMLSubSys::init(); MSFrame::fillOptions(); OptionsIO::getOptions(false, argc, argv); if (oc.processMetaOptions(false)) { SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); // Make application FXApp application("SUMO GUISimulation", "DLR"); // Open display @@ -117,13 +112,17 @@ // Run ret = application.run(); #ifndef _DEBUG - } catch (...) { + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; - } -#else - } + } catch (...) { + MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); + ret = 1; #endif + } SystemFrame::close(); return ret; } diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/Makefile.am sumo-0.16.0~dfsg/src/jtrrouter/Makefile.am --- sumo-0.15.0~dfsg/src/jtrrouter/Makefile.am 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -15,8 +15,8 @@ jtrrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/Makefile.in sumo-0.16.0~dfsg/src/jtrrouter/Makefile.in --- sumo-0.15.0~dfsg/src/jtrrouter/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -53,8 +53,8 @@ ROJTRTurnDefLoader.$(OBJEXT) ROJTRFrame.$(OBJEXT) jtrrouter_OBJECTS = $(am_jtrrouter_OBJECTS) jtrrouter_DEPENDENCIES = ../router/librouter.a \ - ../utils/options/liboptions.a ../utils/common/libcommon.a \ - ../utils/xml/libxml.a ../utils/importio/libimportio.a \ + ../utils/options/liboptions.a ../utils/xml/libxml.a \ + ../utils/common/libcommon.a ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../foreign/tcpip/libtcpip.a $(MEM_LIBS) jtrrouter_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @@ -109,6 +109,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -139,6 +140,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -173,6 +175,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -206,7 +209,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -236,8 +238,8 @@ jtrrouter_LDFLAGS = $(XERCES_LDFLAGS) jtrrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../utils/geom/libgeom.a \ diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTREdge.cpp sumo-0.16.0~dfsg/src/jtrrouter/ROJTREdge.cpp --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTREdge.cpp 2012-03-07 00:02:29.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTREdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdge.cpp 12018 2012-03-06 09:40:54Z behrisch $ +/// @version $Id: ROJTREdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An edge the jtr-router may route through /****************************************************************************/ @@ -114,7 +114,7 @@ void -ROJTREdge::setTurnDefaults(const std::vector &defs) { +ROJTREdge::setTurnDefaults(const std::vector& defs) { // I hope, we'll find a less ridiculous solution for this std::vector tmp(defs.size()*myFollowingEdges.size(), 0); // store in less common multiple diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTREdge.h sumo-0.16.0~dfsg/src/jtrrouter/ROJTREdge.h --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTREdge.h 2012-03-07 00:02:29.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTREdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdge.h 12018 2012-03-06 09:40:54Z behrisch $ +/// @version $Id: ROJTREdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An edge the jtr-router may route through /****************************************************************************/ @@ -63,11 +63,11 @@ * @param[in] to The node the edge ends at * @param[in] index The numeric id of the edge */ - ROJTREdge(const std::string& id, RONode* from, RONode* to, unsigned int index) ; + ROJTREdge(const std::string& id, RONode* from, RONode* to, unsigned int index); /// @brief Destructor - ~ROJTREdge() ; + ~ROJTREdge(); /** @brief Adds information about a connected edge @@ -80,7 +80,7 @@ * @param[in] s The following edge * @see ROEdge::addFollower */ - void addFollower(ROEdge* s, std::string dir="") ; + void addFollower(ROEdge* s, std::string dir = ""); /** @brief adds the information about the percentage of using a certain follower @@ -105,7 +105,7 @@ /** @brief Sets the turning definition defaults * @param[in] def The turning percentage defaults */ - void setTurnDefaults(const std::vector &defs); + void setTurnDefaults(const std::vector& defs); private: diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTREdgeBuilder.h sumo-0.16.0~dfsg/src/jtrrouter/ROJTREdgeBuilder.h --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTREdgeBuilder.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTREdgeBuilder.h 2012-09-25 22:01:46.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdgeBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROJTREdgeBuilder.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Interface for building instances of jtrrouter-edges /****************************************************************************/ @@ -55,11 +55,11 @@ class ROJTREdgeBuilder : public ROAbstractEdgeBuilder { public: /// @brief Constructor - ROJTREdgeBuilder() ; + ROJTREdgeBuilder(); /// @brief Destructor - ~ROJTREdgeBuilder() ; + ~ROJTREdgeBuilder(); /// @name Methods inherited from ROAbstractEdgeBuilder @@ -75,7 +75,7 @@ * @return A proper instance of the named edge * @see ROJTREdge */ - ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to) ; + ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to); /// @} diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTRFrame.cpp sumo-0.16.0~dfsg/src/jtrrouter/ROJTRFrame.cpp --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTRFrame.cpp 2012-01-27 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTRFrame.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROJTRFrame.cpp 11795 2012-01-26 21:48:41Z behrisch $ +/// @version $Id: ROJTRFrame.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Sets and checks options for jtr-routing /****************************************************************************/ @@ -70,7 +70,6 @@ oc.doRegister("turn-ratio-files", 't', new Option_FileName()); oc.addSynonyme("turn-ratio-files", "turns"); - oc.addSynonyme("turn-ratio-files", "turn-definitions", true); oc.addDescription("turn-ratio-files", "Input", "Read turning ratios from FILE(s)"); oc.doRegister("exit-times", new Option_Bool(false)); @@ -90,7 +89,6 @@ oc.addDescription("accept-all-destinations", "Processing", "Whether all edges are allowed as sink edges"); oc.doRegister("ignore-vclasses", 'i', new Option_Bool(false)); - oc.addSynonyme("ignore-vclasses", "ignore-classes", true); oc.addDescription("ignore-vclasses", "Processing", "Ignore road restrictions based on vehicle class"); oc.doRegister("allow-loops", new Option_Bool(false)); @@ -105,12 +103,33 @@ ROJTRFrame::checkOptions() { OptionsCont& oc = OptionsCont::getOptions(); bool ok = ROFrame::checkOptions(oc); - ok &= (!oc.isSet("departlane") || SUMOVehicleParameter::departlaneValidate(oc.getString("departlane"))); - ok &= (!oc.isSet("departpos") || SUMOVehicleParameter::departposValidate(oc.getString("departpos"))); - ok &= (!oc.isSet("departspeed") || SUMOVehicleParameter::departspeedValidate(oc.getString("departspeed"))); - ok &= (!oc.isSet("arrivallane") || SUMOVehicleParameter::arrivallaneValidate(oc.getString("arrivallane"))); - ok &= (!oc.isSet("arrivalpos") || SUMOVehicleParameter::arrivalposValidate(oc.getString("arrivalpos"))); - ok &= (!oc.isSet("arrivalspeed") || SUMOVehicleParameter::arrivalspeedValidate(oc.getString("arrivalspeed"))); + + SUMOVehicleParameter p; + std::string error; + if (oc.isSet("departlane") && !SUMOVehicleParameter::parseDepartLane(oc.getString("departlane"), "option", "departlane", p.departLane, p.departLaneProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("departpos") && !SUMOVehicleParameter::parseDepartPos(oc.getString("departpos"), "option", "departpos", p.departPos, p.departPosProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("departspeed") && !SUMOVehicleParameter::parseDepartSpeed(oc.getString("departspeed"), "option", "departspeed", p.departSpeed, p.departSpeedProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivallane") && !SUMOVehicleParameter::parseArrivalLane(oc.getString("arrivallane"), "option", "arrivallane", p.arrivalLane, p.arrivalLaneProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivalpos") && !SUMOVehicleParameter::parseArrivalPos(oc.getString("arrivalpos"), "option", "arrivalpos", p.arrivalPos, p.arrivalPosProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivalspeed") && !SUMOVehicleParameter::parseArrivalSpeed(oc.getString("arrivalspeed"), "option", "arrivalspeed", p.arrivalSpeed, p.arrivalSpeedProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } return ok; } diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTRRouter.cpp sumo-0.16.0~dfsg/src/jtrrouter/ROJTRRouter.cpp --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTRRouter.cpp 2012-02-25 00:03:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTRRouter.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRRouter.cpp 11951 2012-02-24 09:43:35Z namdre $ +/// @version $Id: ROJTRRouter.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Computes routes using junction turning percentages /****************************************************************************/ @@ -44,11 +44,11 @@ // method definitions // =========================================================================== ROJTRRouter::ROJTRRouter(RONet& net, bool unbuildIsWarningOnly, bool acceptAllDestinations, - int maxEdges, bool ignoreClasses, bool allowLoops) : + int maxEdges, bool ignoreClasses, bool allowLoops) : SUMOAbstractRouter("JTRRouter"), myNet(net), myUnbuildIsWarningOnly(unbuildIsWarningOnly), myAcceptAllDestination(acceptAllDestinations), myMaxEdges(maxEdges), - myIgnoreClasses(ignoreClasses), myAllowLoops(allowLoops) + myIgnoreClasses(ignoreClasses), myAllowLoops(allowLoops) { } @@ -58,7 +58,7 @@ void ROJTRRouter::compute(const ROEdge* from, const ROEdge* /*to*/, const ROVehicle* const vehicle, - SUMOTime time, std::vector &into) { + SUMOTime time, std::vector& into) { const ROJTREdge* current = static_cast(from); // route until a sinks has been found while (current != 0 @@ -94,7 +94,7 @@ SUMOReal -ROJTRRouter::recomputeCosts(const std::vector &edges, const ROVehicle* const v, SUMOTime time) const { +ROJTRRouter::recomputeCosts(const std::vector& edges, const ROVehicle* const v, SUMOTime time) const { SUMOReal costs = 0; for (std::vector::const_iterator i = edges.begin(); i != edges.end(); i++) { /* diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTRRouter.h sumo-0.16.0~dfsg/src/jtrrouter/ROJTRRouter.h --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTRRouter.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTRRouter.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRRouter.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROJTRRouter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Computes routes using junction turning percentages /****************************************************************************/ @@ -82,7 +82,7 @@ * @param[filled] into The list of edges to store the route into */ void compute(const ROEdge* from, const ROEdge* to, const ROVehicle* const vehicle, - SUMOTime time, std::vector &into); + SUMOTime time, std::vector& into); /** @brief Recomputes the costs of a route @@ -91,7 +91,7 @@ * @param[in] time The departure time of the vehicle * @return The route costs */ - SUMOReal recomputeCosts(const std::vector &edges, const ROVehicle* const v, SUMOTime time) const; + SUMOReal recomputeCosts(const std::vector& edges, const ROVehicle* const v, SUMOTime time) const; /// @} @@ -99,20 +99,20 @@ /// @brief The network to use RONet& myNet; - /// @brief The maximum number of edges a route may have - int myMaxEdges; - /// @brief Whether unbuildable routes shall be reported as warniings, not errors - bool myUnbuildIsWarningOnly; + const bool myUnbuildIsWarningOnly; /// @brief Whether all edges may be used as route end - bool myAcceptAllDestination; + const bool myAcceptAllDestination; + + /// @brief The maximum number of edges a route may have + const int myMaxEdges; /// @brief Whether vehicle class information shall be ignored - bool myIgnoreClasses; + const bool myIgnoreClasses; /// @brief Whether a vehicle may reuse a road - bool myAllowLoops; + const bool myAllowLoops; }; diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.cpp sumo-0.16.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.cpp --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRTurnDefLoader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROJTRTurnDefLoader.cpp 12538 2012-08-13 13:46:11Z dkrajzew $ /// // Loader for the of turning percentages and source/sink definitions /****************************************************************************/ @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -54,11 +53,7 @@ // =========================================================================== ROJTRTurnDefLoader::ROJTRTurnDefLoader(RONet& net) : SUMOSAXHandler("turn-ratio-file"), myNet(net), - myIntervalBegin(0), myIntervalEnd(SUMOTime_MAX), myEdge(0), - myHaveWarnedAboutDeprecatedSources(false), - myHaveWarnedAboutDeprecatedSinks(false), - myHaveWarnedAboutDeprecatedFromEdge(false), - myHaveWarnedAboutDeprecatedToEdge(false) {} + myIntervalBegin(0), myIntervalEnd(SUMOTime_MAX), myEdge(0) {} ROJTRTurnDefLoader::~ROJTRTurnDefLoader() {} @@ -73,19 +68,9 @@ myIntervalBegin = attrs.getSUMOTimeReporting(SUMO_ATTR_BEGIN, 0, ok); myIntervalEnd = attrs.getSUMOTimeReporting(SUMO_ATTR_END, 0, ok); break; - case SUMO_TAG_FROMEDGE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedFromEdge) { - myHaveWarnedAboutDeprecatedFromEdge = true; - WRITE_WARNING("'" + toString(SUMO_TAG_FROMEDGE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_FROMEDGE) + "'."); - } case SUMO_TAG_FROMEDGE: beginFromEdge(attrs); break; - case SUMO_TAG_TOEDGE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedToEdge) { - myHaveWarnedAboutDeprecatedToEdge = true; - WRITE_WARNING("'" + toString(SUMO_TAG_TOEDGE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_TOEDGE) + "'."); - } case SUMO_TAG_TOEDGE: addToEdge(attrs); break; @@ -124,40 +109,6 @@ void -ROJTRTurnDefLoader::myCharacters(int element, - const std::string& chars) { - switch (element) { - case SUMO_TAG_SINK: { - ROEdge* edge = myNet.getEdge(chars); - if (edge == 0) { - throw ProcessError("The edge '" + chars + "' declared as a sink is not known."); - } - if (!myHaveWarnedAboutDeprecatedSinks) { - myHaveWarnedAboutDeprecatedSinks = true; - WRITE_WARNING("Using characters for sinks is deprecated; use attribute 'edges' instead."); - } - edge->setType(ROEdge::ET_SINK); - } - break; - case SUMO_TAG_SOURCE: { - ROEdge* edge = myNet.getEdge(chars); - if (edge == 0) { - throw ProcessError("The edge '" + chars + "' declared as a source is not known."); - } - if (!myHaveWarnedAboutDeprecatedSources) { - myHaveWarnedAboutDeprecatedSources = true; - WRITE_WARNING("Using characters for sources is deprecated; use attribute 'edges' instead."); - } - edge->setType(ROEdge::ET_SOURCE); - } - break; - default: - break; - } -} - - -void ROJTRTurnDefLoader::beginFromEdge(const SUMOSAXAttributes& attrs) { myEdge = 0; bool ok = true; diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.h sumo-0.16.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.h --- sumo-0.15.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/ROJTRTurnDefLoader.h 2012-09-25 22:01:46.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRTurnDefLoader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROJTRTurnDefLoader.h 12538 2012-08-13 13:46:11Z dkrajzew $ /// // Loader for the of turning percentages and source/sink definitions /****************************************************************************/ @@ -65,11 +65,11 @@ * * @param[in] net The net to add loaded turning percentages into */ - ROJTRTurnDefLoader(RONet& net) ; + ROJTRTurnDefLoader(RONet& net); /// @brief Destructor - ~ROJTRTurnDefLoader() ; + ~ROJTRTurnDefLoader(); protected: @@ -83,19 +83,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; - - - /** @brief Called when characters occure - * - * @param[in] element ID of the last opened element - * @param[in] chars The read characters (complete) - * @exception ProcessError If something fails - * @see GenericSAXHandler::myCharacters - */ - void myCharacters(int element, - const std::string& chars) ; + void myStartElement(int element, const SUMOSAXAttributes& attrs); //@} @@ -110,7 +98,7 @@ * * @param[in] attrs The SAX-attributes to parse incoming edge from */ - void beginFromEdge(const SUMOSAXAttributes& attrs) ; + void beginFromEdge(const SUMOSAXAttributes& attrs); /** @brief Parses the probability to use a certain outgoing edge @@ -126,7 +114,7 @@ * * @param[in] attrs The SAX-attributes to parse the destination edge and the probability to use it from */ - void addToEdge(const SUMOSAXAttributes& attrs) ; + void addToEdge(const SUMOSAXAttributes& attrs); private: @@ -139,10 +127,6 @@ /// @brief The current incoming edge the turning probabilities are set into ROJTREdge* myEdge; - /// @brief Whether the loader has warned about deprecated usage of characters - bool myHaveWarnedAboutDeprecatedSources, myHaveWarnedAboutDeprecatedSinks; - bool myHaveWarnedAboutDeprecatedFromEdge, myHaveWarnedAboutDeprecatedToEdge; - }; diff -Nru sumo-0.15.0~dfsg/src/jtrrouter/jtrrouter_main.cpp sumo-0.16.0~dfsg/src/jtrrouter/jtrrouter_main.cpp --- sumo-0.15.0~dfsg/src/jtrrouter/jtrrouter_main.cpp 2012-02-18 00:03:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/jtrrouter/jtrrouter_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: jtrrouter_main.cpp 11927 2012-02-17 10:03:39Z namdre $ +/// @version $Id: jtrrouter_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for JTRROUTER /****************************************************************************/ @@ -79,13 +79,13 @@ * weights which may be supplied in a separate file */ void -initNet(RONet& net, ROLoader& loader, OptionsCont& oc, - const std::vector &turnDefs) { +initNet(RONet& net, ROLoader& loader, + const std::vector& turnDefs) { // load the net ROJTREdgeBuilder builder; loader.loadNet(net, builder); // set the turn defaults - const std::map &edges = net.getEdgeMap(); + const std::map& edges = net.getEdgeMap(); for (std::map::const_iterator i = edges.begin(); i != edges.end(); ++i) { static_cast((*i).second)->setTurnDefaults(turnDefs); } @@ -100,7 +100,7 @@ } for (std::vector::const_iterator i = defs.begin(); i != defs.end(); ++i) { try { - SUMOReal val = TplConvert::_2SUMOReal((*i).c_str()); + SUMOReal val = TplConvert::_2SUMOReal((*i).c_str()); ret.push_back(val); } catch (NumberFormatException&) { throw ProcessError("A turn default is not numeric."); @@ -177,14 +177,14 @@ RONet* net = 0; try { // initialise the application system (messaging, xml, options) - XMLSubSys::init(false); + XMLSubSys::init(); ROJTRFrame::fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!ROJTRFrame::checkOptions()) { throw ProcessError(); @@ -194,36 +194,41 @@ // load data ROLoader loader(oc, true); net = new RONet(); - initNet(*net, loader, oc, defs); + initNet(*net, loader, defs); try { // parse and set the turn defaults first loadJTRDefinitions(*net, oc); // build routes computeRoutes(*net, loader, oc); - } catch (SAXParseException& e) { + } catch (XERCES_CPP_NAMESPACE::SAXParseException& e) { WRITE_ERROR(toString(e.getLineNumber())); ret = 1; - } catch (SAXException& e) { - WRITE_ERROR(TplConvert::_2str(e.getMessage())); + } catch (XERCES_CPP_NAMESPACE::SAXException& e) { + WRITE_ERROR(TplConvert::_2str(e.getMessage())); ret = 1; } if (MsgHandler::getErrorInstance()->wasInformed()) { throw ProcessError(); } - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } delete net; - OutputDevice::closeAll(); SystemFrame::close(); if (ret == 0) { std::cout << "Success." << std::endl; @@ -234,4 +239,3 @@ /****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/microsim/MSAbstractLaneChangeModel.h sumo-0.16.0~dfsg/src/microsim/MSAbstractLaneChangeModel.h --- sumo-0.15.0~dfsg/src/microsim/MSAbstractLaneChangeModel.h 2012-02-15 00:02:43.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSAbstractLaneChangeModel.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: MSAbstractLaneChangeModel.h 11889 2012-02-14 12:28:58Z dkrajzew $ +/// @version $Id: MSAbstractLaneChangeModel.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Interface for lane-change models /****************************************************************************/ @@ -198,11 +198,11 @@ and whether another lane may be more preferable */ virtual int wantsChangeToRight( MSLCMessager& msgPass, int blocked, - const std::pair &leader, - const std::pair &neighLead, - const std::pair &neighFollow, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, const MSLane& neighLane, - const std::vector &preb, + const std::vector& preb, MSVehicle** lastBlocked) = 0; /** @brief Called to examine whether the vehicle wants to change to left @@ -210,11 +210,11 @@ and whether another lane may be more preferable */ virtual int wantsChangeToLeft( MSLCMessager& msgPass, int blocked, - const std::pair &leader, - const std::pair &neighLead, - const std::pair &neighFollow, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, const MSLane& neighLane, - const std::vector &preb, + const std::vector& preb, MSVehicle** lastBlocked) = 0; virtual void* inform(void* info, MSVehicle* sender) = 0; @@ -267,7 +267,7 @@ // Congested situation are relevant only on highways (maxSpeed > 70km/h) // and congested on German Highways means that the vehicles have speeds // below 60km/h. Overtaking on the right is allowed then. - if ((myVehicle.getLane()->getMaxSpeed() <= 70.0 / 3.6) || (neighLeader->getLane()->getMaxSpeed() <= 70.0 / 3.6)) { + if ((myVehicle.getLane()->getSpeedLimit() <= 70.0 / 3.6) || (neighLeader->getLane()->getSpeedLimit() <= 70.0 / 3.6)) { return false; } @@ -306,6 +306,9 @@ /// @brief The vehicle's car following model const MSCFModel& myCarFollowModel; +private: + /// @brief Invalidated assignment operator + MSAbstractLaneChangeModel& operator=(const MSAbstractLaneChangeModel& s); }; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSBaseVehicle.cpp sumo-0.16.0~dfsg/src/microsim/MSBaseVehicle.cpp --- sumo-0.15.0~dfsg/src/microsim/MSBaseVehicle.cpp 2012-03-02 00:03:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSBaseVehicle.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Mon, 8 Nov 2010 -/// @version $Id: MSBaseVehicle.cpp 11988 2012-03-01 15:06:05Z behrisch $ +/// @version $Id: MSBaseVehicle.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A base class for vehicle implementations /****************************************************************************/ @@ -49,20 +49,22 @@ #include #endif // CHECK_MEMORY_LEAKS +// =========================================================================== +// static members +// =========================================================================== +const SUMOTime MSBaseVehicle::NOT_YET_DEPARTED = SUMOTime_MAX; // =========================================================================== // method definitions // =========================================================================== -MSBaseVehicle::MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type) : +MSBaseVehicle::MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type, SUMOReal speedFactor) : myParameter(pars), myRoute(route), myType(type), myCurrEdge(route->begin()), - myIndividualMaxSpeed(0.0), - myHasIndividualMaxSpeed(false), - myReferenceSpeed(-1.0), + myChosenSpeedFactor(speedFactor), myMoveReminders(0), - myDeparture(-1), + myDeparture(NOT_YET_DEPARTED), myArrivalPos(-1), myNumberReroutes(0) { // init devices @@ -70,6 +72,7 @@ MSDevice_Tripinfo::buildVehicleDevices(*this, myDevices); MSDevice_Routing::buildVehicleDevices(*this, myDevices); MSDevice_HBEFA::buildVehicleDevices(*this, myDevices); + // for (std::vector< MSDevice* >::iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) { myMoveReminders.push_back(std::make_pair(*dev, 0.)); } @@ -112,27 +115,10 @@ SUMOReal MSBaseVehicle::getMaxSpeed() const { - if (myHasIndividualMaxSpeed) { - return myIndividualMaxSpeed; - } return myType->getMaxSpeed(); } -SUMOReal -MSBaseVehicle::adaptMaxSpeed(SUMOReal referenceSpeed) { - if (myType->hasSpeedDeviation() && referenceSpeed != myReferenceSpeed) { - myHasIndividualMaxSpeed = true; - myIndividualMaxSpeed = myType->getMaxSpeedWithDeviation(referenceSpeed); - myReferenceSpeed = referenceSpeed; - } - if (myHasIndividualMaxSpeed) { - return myIndividualMaxSpeed; - } - return MIN2(myType->getMaxSpeed(), referenceSpeed); -} - - const MSEdge* MSBaseVehicle::succEdge(unsigned int nSuccs) const { if (myCurrEdge + nSuccs < myRoute->end()) { @@ -150,7 +136,7 @@ void -MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter &router, bool withTaz) { +MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter& router, bool withTaz) { // check whether to reroute std::vector edges; if (withTaz && MSEdge::dictionary(myParameter->fromTaz + "-source") && MSEdge::dictionary(myParameter->toTaz + "-sink")) { @@ -182,7 +168,8 @@ } else { id = id + "!var#1"; } - MSRoute* newRoute = new MSRoute(id, edges, 0, myRoute->getColor(), myRoute->getStops()); + const RGBColor& c = myRoute->getColor(); + MSRoute* newRoute = new MSRoute(id, edges, 0, &c == &RGBColor::DEFAULT_COLOR ? 0 : new RGBColor(c), myRoute->getStops()); if (!MSRoute::dictionary(id, newRoute)) { delete newRoute; return false; @@ -197,7 +184,7 @@ SUMOReal -MSBaseVehicle::getPreDawdleAcceleration() const { +MSBaseVehicle::getAcceleration() const { return 0; } @@ -209,18 +196,17 @@ } -SUMOTime -MSBaseVehicle::getDeparture() const { - return myDeparture; +bool +MSBaseVehicle::hasDeparted() const { + return myDeparture != NOT_YET_DEPARTED; } -unsigned int -MSBaseVehicle::getNumberReroutes() const { - return myNumberReroutes; +bool +MSBaseVehicle::hasArrived() const { + return succEdge(1) == 0; } - void MSBaseVehicle::addPerson(MSPerson* /*person*/) { } @@ -282,9 +268,9 @@ const SUMOReal lastLaneLength = (myRoute->getLastEdge()->getLanes())[0]->getLength(); switch (myParameter->arrivalPosProcedure) { case ARRIVAL_POS_GIVEN: - if (fabs(myParameter->arrivalPos) > lastLaneLength) { - WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given position!"); - } + if (fabs(myParameter->arrivalPos) > lastLaneLength) { + WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given position!"); + } // Maybe we should warn the user about invalid inputs! myArrivalPos = MIN2(myParameter->arrivalPos, lastLaneLength); if (myArrivalPos < 0) { @@ -294,8 +280,7 @@ case ARRIVAL_POS_RANDOM: myArrivalPos = RandHelper::rand(static_cast(0), lastLaneLength); break; - case ARRIVAL_POS_MAX: - case ARRIVAL_POS_DEFAULT: + default: myArrivalPos = lastLaneLength; break; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSBaseVehicle.h sumo-0.16.0~dfsg/src/microsim/MSBaseVehicle.h --- sumo-0.15.0~dfsg/src/microsim/MSBaseVehicle.h 2012-03-02 00:03:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSBaseVehicle.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 8 Nov 2010 -/// @version $Id: MSBaseVehicle.h 11988 2012-03-01 15:06:05Z behrisch $ +/// @version $Id: MSBaseVehicle.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A base class for vehicle implementations /****************************************************************************/ @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include @@ -57,48 +56,47 @@ class MSBaseVehicle : public SUMOVehicle { public: /** @brief Constructor + * @param[in] pars The vehicle description + * @param[in] route The vehicle's route + * @param[in] type The vehicle's type + * @param[in] speedFactor The factor for driven lane's speed limits + * @exception ProcessError If a value is wrong */ - MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type) ; + MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type, SUMOReal speedFactor); /// @brief Destructor - virtual ~MSBaseVehicle() ; + virtual ~MSBaseVehicle(); /// Returns the name of the vehicle - const std::string& getID() const ; + const std::string& getID() const; /** @brief Returns the vehicle's parameter (including departure definition) * * @return The vehicle's parameter */ - const SUMOVehicleParameter& getParameter() const ; + const SUMOVehicleParameter& getParameter() const; /** @brief Returns the current route * @return The route the vehicle uses */ - const MSRoute& getRoute() const ; + const MSRoute& getRoute() const; /** @brief Returns the vehicle's type definition * @return The vehicle's type definition */ - const MSVehicleType& getVehicleType() const ; + const MSVehicleType& getVehicleType() const; - /** @brief Returns the current maximum speed + /** @brief Returns the maximum speed * @return The vehicle's maximum speed */ SUMOReal getMaxSpeed() const; - /** @brief Adapts the current maximum speed using the distribution given in the type - * @return The vehicle's new maximum speed - */ - SUMOReal adaptMaxSpeed(SUMOReal referenceSpeed); - - /** @brief Returns the nSuccs'th successor of edge the vehicle is currently at * * If the rest of the route (counted from the current edge) has less than nSuccs edges, @@ -106,7 +104,7 @@ * @param[in] nSuccs The number of edge to look forward * @return The nSuccs'th following edge in the vehicle's route */ - const MSEdge* succEdge(unsigned int nSuccs) const ; + const MSEdge* succEdge(unsigned int nSuccs) const; /** @brief Returns the edge the vehicle is currently at * @@ -132,7 +130,7 @@ * @param[in] router The router to use * @see replaceRoute */ - void reroute(SUMOTime t, SUMOAbstractRouter &router, bool withTaz = false) ; + void reroute(SUMOTime t, SUMOAbstractRouter& router, bool withTaz = false); /** @brief Replaces the current route by the given edges @@ -145,38 +143,50 @@ * @param[in] simTime The time at which the route was replaced * @return Whether the new route was accepted */ - bool replaceRouteEdges(const MSEdgeVector& edges, bool onInit = false) ; + bool replaceRouteEdges(const MSEdgeVector& edges, bool onInit = false); - /** @brief Returns the vehicle's acceleration before dawdling + /** @brief Returns the vehicle's acceleration * * This default implementation returns always 0. - * - * @return The acceleration before dawdling + * @return The acceleration */ - virtual SUMOReal getPreDawdleAcceleration() const ; + virtual SUMOReal getAcceleration() const; /** @brief Called when the vehicle is inserted into the network * * Sets optional information about departure time, informs the vehicle * control about a further running vehicle. */ - void onDepart() ; + void onDepart(); /** @brief Returns this vehicle's real departure time * @return This vehicle's real departure time */ - SUMOTime getDeparture() const ; + inline SUMOTime getDeparture() const { + return myDeparture; + } + + /** @brief Returns whether this vehicle has already departed + */ + bool hasDeparted() const; + + /** @brief Returns whether this vehicle has already arived + * (by default this is true if the vehicle has reached its final edge) + */ + virtual bool hasArrived() const; /** @brief Returns the number of new routes this vehicle got * @return the number of new routes this vehicle got */ - unsigned int getNumberReroutes() const ; + inline unsigned int getNumberReroutes() const { + return myNumberReroutes; + } /** @brief Returns this vehicle's devices * @return This vehicle's devices */ - const std::vector &getDevices() const { + inline const std::vector& getDevices() const { return myDevices; } @@ -186,27 +196,27 @@ * * @param[in] person The person to add */ - virtual void addPerson(MSPerson* person) ; + virtual void addPerson(MSPerson* person); /** @brief Validates the current route * @param[out] msg Description why the route is not valid (if it is the case) * @return Whether the vehicle's current route is valid */ - bool hasValidRoute(std::string& msg) const ; + bool hasValidRoute(std::string& msg) const; /** @brief Adds a MoveReminder dynamically * * @param[in] rem the reminder to add * @see MSMoveReminder */ - void addReminder(MSMoveReminder* rem) ; + void addReminder(MSMoveReminder* rem); /** @brief Removes a MoveReminder dynamically * * @param[in] rem the reminder to remove * @see MSMoveReminder */ - void removeReminder(MSMoveReminder* rem) ; + void removeReminder(MSMoveReminder* rem); /** @brief "Activates" all current move reminder * @@ -218,12 +228,19 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - virtual void activateReminders(const MSMoveReminder::Notification reason) ; + virtual void activateReminders(const MSMoveReminder::Notification reason); + + /** @brief Returns the precomputed factor by which the driver wants to be faster than the speed limit + * @return Speed limit factor + */ + SUMOReal getChosenSpeedFactor() const { + return myChosenSpeedFactor; + } protected: /** @brief (Re-)Calculates the arrival position from the vehicle parameters */ - void calculateArrivalPos() ; + void calculateArrivalPos(); protected: /// @brief This Vehicle's parameter. @@ -238,17 +255,9 @@ /// @brief Iterator to current route-edge MSRouteIterator myCurrEdge; - /// An individual speed for an vehicle that is used (iff set) instead of - /// the maximal speed of the vehicle class. - /// NOTE: This is just a little workaround for allowing an external - /// influence on the actual speed - SUMOReal myIndividualMaxSpeed; - - /// is true if there has an individual speed been set - bool myHasIndividualMaxSpeed; + /// @brief A precomputed factor by which the driver wants to be faster than the speed limit + SUMOReal myChosenSpeedFactor; - /// the speed which served as reference when calculating the individual maxspeed - SUMOReal myReferenceSpeed; /// @name Move reminder structures /// @{ @@ -272,6 +281,12 @@ /// @brief The number of reroutings unsigned int myNumberReroutes; +private: + /* @brief magic value for undeparted vehicles + * @note: in previous versions this was -1 + */ + static const SUMOTime NOT_YET_DEPARTED; + }; #endif diff -Nru sumo-0.15.0~dfsg/src/microsim/MSBitSetLogic.h sumo-0.16.0~dfsg/src/microsim/MSBitSetLogic.h --- sumo-0.15.0~dfsg/src/microsim/MSBitSetLogic.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSBitSetLogic.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSBitSetLogic.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSBitSetLogic.h 13107 2012-12-02 13:57:34Z behrisch $ /// // »missingDescription« /****************************************************************************/ @@ -35,7 +35,6 @@ #include #include -#include #include "MSJunctionLogic.h" #include "MSLogicJunction.h" @@ -86,7 +85,7 @@ return (*myLogic)[linkIndex]; } - const std::bitset<64> &getInternalFoesFor(unsigned int linkIndex) const { + const std::bitset<64>& getInternalFoesFor(unsigned int linkIndex) const { return (*myInternalLinksFoes)[linkIndex]; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSCFModel.cpp sumo-0.16.0~dfsg/src/microsim/MSCFModel.cpp --- sumo-0.15.0~dfsg/src/microsim/MSCFModel.cpp 2012-02-15 00:02:44.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSCFModel.cpp 2012-11-09 00:02:18.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 27 Jul 2009 -/// @version $Id: MSCFModel.cpp 11889 2012-02-14 12:28:58Z dkrajzew $ +/// @version $Id: MSCFModel.cpp 12954 2012-11-08 15:09:47Z namdre $ /// // The car-following model abstraction /****************************************************************************/ @@ -59,9 +59,8 @@ // in this case, we neglect dawdling, nonetheless, using // vSafe does not incorporate speed reduction due to interaction // on lane changing - veh->setPreDawdleAcceleration(SPEED2ACCEL(vSafe - oldV)); - const SUMOReal vMin = MAX2((SUMOReal) 0, oldV - ACCEL2SPEED(myDecel)); - const SUMOReal vMax = MIN3(veh->getLane()->getMaxSpeed(), maxNextSpeed(oldV), vSafe); + const SUMOReal vMin = getSpeedAfterMaxDecel(oldV); + const SUMOReal vMax = MIN3(veh->getLane()->getVehicleMaxSpeed(veh), maxNextSpeed(oldV), vSafe); assert(vMin <= vMax); return veh->getLaneChangeModel().patchSpeed(vMin, vMax, vMax, *this); } @@ -72,7 +71,7 @@ // Resolve the vsafe equation to gap. Assume predecessor has // speed != 0 and that vsafe will be the current speed plus acceleration, // i.e that with this gap there will be no interaction. - const SUMOReal vNext = MIN2(maxNextSpeed(veh->getSpeed()), veh->getLane()->getMaxSpeed()); + const SUMOReal vNext = MIN2(maxNextSpeed(veh->getSpeed()), veh->getLane()->getVehicleMaxSpeed(veh)); const SUMOReal gap = (vNext - vL) * ((veh->getSpeed() + vL) / (2.*myDecel) + myHeadwayTime) + vL * myHeadwayTime; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSCFModel.h sumo-0.16.0~dfsg/src/microsim/MSCFModel.h --- sumo-0.15.0~dfsg/src/microsim/MSCFModel.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSCFModel.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 27 Jul 2009 -/// @version $Id: MSCFModel.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The car-following model abstraction /****************************************************************************/ @@ -32,7 +32,6 @@ #include #endif -#include #include #include #include @@ -86,7 +85,7 @@ /** @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. + * velocity at the end of the free range. * @param[in] veh The vehicle (EGO) * @param[in] speed The vehicle's speed * @param[in] seen The look ahead distance diff -Nru sumo-0.15.0~dfsg/src/microsim/MSEdge.cpp sumo-0.16.0~dfsg/src/microsim/MSEdge.cpp --- sumo-0.15.0~dfsg/src/microsim/MSEdge.cpp 2012-03-08 00:03:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -8,7 +8,7 @@ /// @author Michael Behrisch /// @author Sascha Krieg /// @date Tue, 06 Mar 2001 -/// @version $Id: MSEdge.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: MSEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A road/street connecting two junctions /****************************************************************************/ @@ -46,7 +46,7 @@ #include "MSVehicle.h" #include "MSEdgeWeightsStorage.h" -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #include @@ -67,11 +67,12 @@ // =========================================================================== // member method definitions // =========================================================================== -MSEdge::MSEdge(const std::string& id, unsigned int numericalID, +MSEdge::MSEdge(const std::string& id, int numericalID, + const EdgeBasicFunction function, const std::string& streetName) : - myID(id), myNumericalID(numericalID), myLanes(0), - myLaneChanger(0), myVaporizationRequests(0), myLastFailedInsertionTime(-1), - myStreetName(streetName) {} + Named(id), myNumericalID(numericalID), myLanes(0), + myLaneChanger(0), myFunction(function), myVaporizationRequests(0), + myLastFailedInsertionTime(-1), myStreetName(streetName) {} MSEdge::~MSEdge() { @@ -90,11 +91,10 @@ void -MSEdge::initialize(std::vector* lanes, EdgeBasicFunction function) { - assert(function == EDGEFUNCTION_DISTRICT || lanes != 0); +MSEdge::initialize(std::vector* lanes) { + assert(myFunction == EDGEFUNCTION_DISTRICT || lanes != 0); myLanes = lanes; - myFunction = function; - if (myLanes && myLanes->size() > 1 && function != EDGEFUNCTION_INTERNAL) { + if (myLanes && myLanes->size() > 1 && myFunction != EDGEFUNCTION_INTERNAL) { myLaneChanger = new MSLaneChanger(myLanes, OptionsCont::getOptions().getBool("lanechange.allow-swap")); } } @@ -123,6 +123,13 @@ } myAllowed[&to]->push_back(*i); } +#ifdef HAVE_INTERNAL_LANES + toL = (*j)->getViaLane(); + if (toL != 0) { + MSEdge& to = toL->getEdge(); + to.myPredeccesors.push_back(this); + } +#endif } } std::sort(mySuccessors.begin(), mySuccessors.end(), by_id_sorter()); @@ -132,7 +139,7 @@ void MSEdge::rebuildAllowedLanes() { - // clear myClassedAllowed. + // clear myClassedAllowed. // it will be rebuilt on demand for (ClassedAllowedLanesCont::iterator i2 = myClassedAllowed.begin(); i2 != myClassedAllowed.end(); i2++) { for (AllowedLanesCont::iterator i1 = (*i2).second.begin(); i1 != (*i2).second.end(); i1++) { @@ -183,7 +190,7 @@ } -const std::vector* +const std::vector* MSEdge::getAllowedLanesWithDefault(const AllowedLanesCont& c, const MSEdge* dest) const { AllowedLanesCont::const_iterator it = c.find(dest); if (it == c.end()) { @@ -284,14 +291,14 @@ return getFreeLane(allowedLanes(**(veh.getRoute().begin() + 1)), veh.getVehicleType().getVehicleClass()); } case DEPART_LANE_BEST_FREE: { - const std::vector &bl = veh.getBestLanes(false, (*myLanes)[0]); + const std::vector& bl = veh.getBestLanes(false, (*myLanes)[0]); SUMOReal bestLength = -1; for (std::vector::const_iterator i = bl.begin(); i != bl.end(); ++i) { if ((*i).length > bestLength) { bestLength = (*i).length; } } - std::vector *bestLanes = new std::vector(); + std::vector* bestLanes = new std::vector(); for (std::vector::const_iterator i = bl.begin(); i != bl.end(); ++i) { if ((*i).length == bestLength) { bestLanes->push_back((*i).lane); @@ -318,7 +325,7 @@ if (isVaporizing()) { return false; } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { const SUMOVehicleParameter& pars = v.getParameter(); SUMOReal pos = 0.0; @@ -330,8 +337,8 @@ pos = pars.departPos + getLength(); } if (pos < 0 || pos > getLength()) { - WRITE_WARNING("Invalid departPos " + toString(pos) + " given for vehicle '" + - v.getID() + "'. Inserting at lane end instead."); + WRITE_WARNING("Invalid departPos " + toString(pos) + " given for vehicle '" + + v.getID() + "'. Inserting at lane end instead."); pos = getLength(); } break; @@ -355,6 +362,8 @@ } return result; } +#else + UNUSED_PARAMETER(time); #endif MSLane* insertionLane = getDepartLane(static_cast(v)); return insertionLane != 0 && insertionLane->insertVehicle(static_cast(v)); @@ -382,7 +391,11 @@ for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); ++j) { MSLink* link = *j; if (&link->getLane()->getEdge() == followerAfterInternal) { - return &link->getViaLane()->getEdge(); + if (link->getViaLane() != 0) { + return &link->getViaLane()->getEdge(); + } else { + return 0; // network without internal links + } } } } @@ -392,9 +405,10 @@ SUMOReal -MSEdge::getCurrentTravelTime() const { +MSEdge::getCurrentTravelTime(SUMOReal minSpeed) const { + assert(minSpeed > 0); SUMOReal v = 0; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* first = MSGlobals::gMesoNet->getSegmentForEdge(*this); unsigned segments = 0; @@ -410,14 +424,11 @@ v += (*i)->getMeanSpeed(); } v /= (SUMOReal) myLanes->size(); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif - if (v != 0) { - return getLength() / v; - } else { - return 1000000.; - } + v = MAX2(minSpeed, v); + return getLength() / v; } @@ -427,10 +438,12 @@ if (it == myDict.end()) { // id not in myDict. myDict[id] = ptr; - while (myEdges.size() < ptr->getNumericalID() + 1) { - myEdges.push_back(0); + if (ptr->getNumericalID() != -1) { + while ((int)myEdges.size() < ptr->getNumericalID() + 1) { + myEdges.push_back(0); + } + myEdges[ptr->getNumericalID()] = ptr; } - myEdges[ptr->getNumericalID()] = ptr; return true; } return false; @@ -461,6 +474,12 @@ } +size_t +MSEdge::numericalDictSize() { + return myEdges.size(); +} + + void MSEdge::clear() { for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) { @@ -471,7 +490,7 @@ void -MSEdge::insertIDs(std::vector &into) { +MSEdge::insertIDs(std::vector& into) { for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) { into.push_back((*i).first); } @@ -479,15 +498,22 @@ void -MSEdge::parseEdgesList(const std::string& desc, std::vector &into, +MSEdge::parseEdgesList(const std::string& desc, std::vector& into, const std::string& rid) { - StringTokenizer st(desc); - parseEdgesList(st.getVector(), into, 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); + } } void -MSEdge::parseEdgesList(const std::vector &desc, std::vector &into, +MSEdge::parseEdgesList(const std::vector& desc, std::vector& into, const std::string& rid) { for (std::vector::const_iterator i = desc.begin(); i != desc.end(); ++i) { const MSEdge* edge = MSEdge::dictionary(*i); @@ -501,22 +527,33 @@ } -SUMOReal +SUMOReal MSEdge::getDistanceTo(const MSEdge* other) const { - return getLanes()[0]->getShape()[-1].distanceTo2D(other->getLanes()[0]->getShape()[0]); + if (getLanes().size() > 0 && other->getLanes().size() > 0) { + return getLanes()[0]->getShape()[-1].distanceTo2D(other->getLanes()[0]->getShape()[0]); + } else { + return 0; // optimism is just right for astar + } } -SUMOReal +SUMOReal MSEdge::getLength() const { return getLanes()[0]->getLength(); } -SUMOReal -MSEdge::getMaxSpeed() const { +SUMOReal +MSEdge::getSpeedLimit() const { + // @note lanes might have different maximum speeds in theory + return getLanes()[0]->getSpeedLimit(); +} + + +SUMOReal +MSEdge::getVehicleMaxSpeed(const SUMOVehicle* const veh) const { // @note lanes might have different maximum speeds in theory - return getLanes()[0]->getMaxSpeed(); + return getLanes()[0]->getVehicleMaxSpeed(veh); } /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSEdge.h sumo-0.16.0~dfsg/src/microsim/MSEdge.h --- sumo-0.15.0~dfsg/src/microsim/MSEdge.h 2012-03-08 00:03:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSEdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSEdge.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: MSEdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A road/street connecting two junctions /****************************************************************************/ @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include #include @@ -55,6 +57,7 @@ class SUMOVehicleParameter; class MSVehicle; class MSLane; +class MSPerson; // =========================================================================== @@ -67,7 +70,7 @@ * A single connection between two junctions. * Holds lanes which are reponsible for vehicle movements. */ -class MSEdge { +class MSEdge : public Named, public Parameterised { public: /** * @enum EdgeBasicFunction @@ -106,22 +109,22 @@ * * @param[in] id The id of the edge * @param[in] numericalID The numerical id (index) of the edge + * @param[in] function A basic type of the edge * @param[in] streetName The street name for that edge */ - MSEdge(const std::string& id, unsigned int numericalID, const std::string& streetName = "") ; + MSEdge(const std::string& id, int numericalID, const EdgeBasicFunction function, const std::string& streetName = ""); /// @brief Destructor. - virtual ~MSEdge() ; + virtual ~MSEdge(); /** @brief Initialize the edge. * * @param[in] allowed Information which edges may be reached from which lanes * @param[in] lanes List of this edge's lanes - * @param[in] function A basic type of the edge */ - void initialize(std::vector* lanes, EdgeBasicFunction function) ; + void initialize(std::vector* lanes); /// @todo Has to be called after all edges were built and all connections were set...; Still, is not very nice @@ -137,7 +140,7 @@ * @return The lane left to the given, 0 if no such lane exists * @todo This method searches for the given in the container; probably, this could be done faster */ - MSLane* leftLane(const MSLane* const lane) const ; + MSLane* leftLane(const MSLane* const lane) const; /** @brief Returns the lane right to the one given, 0 if the given lane is rightmost @@ -146,14 +149,14 @@ * @return The lane right to the given, 0 if no such lane exists * @todo This method searches for the given in the container; probably, this could be done faster */ - MSLane* rightLane(const MSLane* const lane) const ; + MSLane* rightLane(const MSLane* const lane) const; /** @brief Returns this edge's lanes * * @return This edge's lanes */ - const std::vector &getLanes() const { + const std::vector& getLanes() const { return *myLanes; } @@ -167,7 +170,7 @@ * @return The lanes that may be used to reach the given edge, 0 if no such lanes exist */ const std::vector* allowedLanes(const MSEdge& destination, - SUMOVehicleClass vclass = SVC_UNKNOWN) const ; + SUMOVehicleClass vclass = SVC_UNKNOWN) const; /** @brief Get the allowed lanes for the given vehicle class. @@ -177,7 +180,7 @@ * @param[in] vclass The vehicle class for which this information shall be returned * @return The lanes that may be used by the given vclass */ - const std::vector* allowedLanes(SUMOVehicleClass vclass = SVC_UNKNOWN) const ; + const std::vector* allowedLanes(SUMOVehicleClass vclass = SVC_UNKNOWN) const; /// @} @@ -185,14 +188,6 @@ /// @name Access to other edge attributes /// @{ - /** @brief Returns the id of the edge - * @return This edge's id - */ - const std::string& getID() const { - return myID; - } - - /** @brief Returns the edge type (EdgeBasicFunction) * @return This edge's EdgeBasicFunction * @see EdgeBasicFunction @@ -205,7 +200,7 @@ /** @brief Returns the numerical id of the edge * @return This edge's numerical id */ - unsigned int getNumericalID() const { + int getNumericalID() const { return myNumericalID; } @@ -233,7 +228,7 @@ /** @brief Returns the list of edges from which this edge may be reached * @return Edges from which this edge may be reached */ - const std::vector &getIncomingEdges() const { + const std::vector& getIncomingEdges() const { return myPredeccesors; } @@ -276,7 +271,7 @@ * @return Time to next call (always 0) * @exception ProcessError not thrown by this method, just derived */ - SUMOTime incVaporization(SUMOTime t) ; + SUMOTime incVaporization(SUMOTime t); /** @brief Disables vaporization @@ -288,20 +283,29 @@ * @return Time to next call (always 0) * @exception ProcessError not thrown by this method, just derived */ - SUMOTime decVaporization(SUMOTime t) ; + SUMOTime decVaporization(SUMOTime t); /// @} /** @brief Computes and returns the current travel time for this edge * - * The mean travel time of all lanes is summed and divided by the number - * of lanes. If the result is zero, 1000000. (a very large number) is - * returned, otherwise the edge's length divided by this speed. + * The mean speed of all lanes is used to compute the travel time. + * To avoid inifinte travel times, the given minimum speed is used. * + * @param[in] minSpeed The minimumSpeed to assume if traffic on this edge is stopped * @return The current effort (travel time) to pass the edge */ - SUMOReal getCurrentTravelTime() const ; + SUMOReal getCurrentTravelTime(const SUMOReal minSpeed = 0.00001) const; + + /// @brief returns the minimum travel time for the given vehicle + inline SUMOReal getMinimumTravelTime(const SUMOVehicle* const veh) const { + if (veh != 0) { + return getLength() / MIN2(veh->getMaxSpeed(), getVehicleMaxSpeed(veh)); + } else { + return getLength() / getSpeedLimit(); + } + } /// @name Methods releated to vehicle insertion @@ -320,7 +324,7 @@ * @return Whether the vehicle could be inserted * @see MSLane::insertVehicle */ - bool insertVehicle(SUMOVehicle& v, SUMOTime time) const ; + bool insertVehicle(SUMOVehicle& v, SUMOTime time) const; /** @brief Finds the emptiest lane allowing the vehicle class @@ -337,7 +341,7 @@ * @return the least occupied lane * @see allowedLanes */ - MSLane* getFreeLane(const std::vector* allowed, const SUMOVehicleClass vclass) const ; + MSLane* getFreeLane(const std::vector* allowed, const SUMOVehicleClass vclass) const; /** @brief Finds a depart lane for the given vehicle parameters @@ -350,7 +354,7 @@ * @param[in] veh The vehicle to get the depart lane for * @return a possible/chosen depart lane, 0 if no lane can be used */ - MSLane* getDepartLane(const MSVehicle& veh) const ; + MSLane* getDepartLane(const MSVehicle& veh) const; /** @brief Returns the last time a vehicle could not be inserted @@ -371,16 +375,19 @@ /** @brief Performs lane changing on this edge */ - virtual void changeLanes(SUMOTime t) ; + virtual void changeLanes(SUMOTime t); #ifdef HAVE_INTERNAL_LANES /// @todo extension: inner junctions are not filled - const MSEdge* getInternalFollowingEdge(MSEdge* followerAfterInternal) const ; + const MSEdge* getInternalFollowingEdge(MSEdge* followerAfterInternal) const; #endif /// @brief Returns whether the vehicle (class) is not allowed on the edge inline bool prohibits(const SUMOVehicle* const vehicle) const { + if (vehicle == 0) { + return false; + } const SUMOVehicleClass svc = vehicle->getVehicleType().getVehicleClass(); return (myCombinedPermissions & svc) != svc; } @@ -388,35 +395,69 @@ void rebuildAllowedLanes(); - /// @brief optimistic distance heuristic for use in routing + /** @brief optimistic air distance heuristic for use in routing + * @param[in] other The edge to which the distance shall be returned + * @return The distance to the other edge + */ SUMOReal getDistanceTo(const MSEdge* other) const; - /// @brief return the length of the edge + /** @brief return the length of the edge + * @return The edge's length + */ SUMOReal getLength() const; - /// @brief return the maximum speed the edge - SUMOReal getMaxSpeed() const; + + /** @brief Returns the speed limit of the edge + * @caution The speed limit of the first lane is retured; should probably be the fastest edge + * @return The maximum speed allowed on this edge + */ + SUMOReal getSpeedLimit() const; + + + /** @brief Returns the maximum speed the vehicle may use on this edge + * + * Note that the vehicle's max. speed is not considered herein, only the edge's speed limit and the + * driver's adaptation of this speed. + * @caution Only the first lane is considered + * @return The maximum velocity on this edge for the given vehicle + */ + SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const; + + virtual void addPerson(MSPerson* p) const { + myPersons.insert(p); + } + + virtual void removePerson(MSPerson* p) const { + std::set::iterator i = myPersons.find(p); + if (i != myPersons.end()) { + myPersons.erase(i); + } + } + /** @brief Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary. Otherwise returns false. */ - static bool dictionary(const std::string& id, MSEdge* edge) ; + static bool dictionary(const std::string& id, MSEdge* edge); /** @brief Returns the MSEdge associated to the key id if exists, otherwise returns 0. */ - static MSEdge* dictionary(const std::string& id) ; + static MSEdge* dictionary(const std::string& id); /** @brief Returns the MSEdge at the index */ - static MSEdge* dictionary(size_t index) ; + static MSEdge* dictionary(size_t index); /// @brief Returns the number of edges - static size_t dictSize() ; + static size_t dictSize(); + + /// @brief Returns the number of edges with a numerical id + static size_t numericalDictSize(); /** @brief Clears the dictionary */ - static void clear() ; + static void clear(); /** @brief Inserts IDs of all known edges into the given vector */ - static void insertIDs(std::vector &into) ; + static void insertIDs(std::vector& into); public: @@ -431,8 +472,8 @@ * @param[in] rid The id of the route these description belongs to; used for error message generation * @exception ProcessError If one of the strings contained is not a known edge id */ - static void parseEdgesList(const std::string& desc, std::vector &into, - const std::string& rid) ; + static void parseEdgesList(const std::string& desc, std::vector& into, + const std::string& rid); /** @brief Parses the given string vector assuming it edge ids @@ -441,8 +482,8 @@ * @param[in] rid The id of the route these description belongs to; used for error message generation * @exception ProcessError If one of the strings contained is not a known edge id */ - static void parseEdgesList(const std::vector &desc, std::vector &into, - const std::string& rid) ; + static void parseEdgesList(const std::vector& desc, std::vector& into, + const std::string& rid); /// @} @@ -472,18 +513,15 @@ * @return The lanes that may be used to reach the given edge, 0 if no such lanes exist */ const std::vector* allowedLanes(const MSEdge* destination, - SUMOVehicleClass vclass = SVC_UNKNOWN) const ; + SUMOVehicleClass vclass = SVC_UNKNOWN) const; /// @brief lookup in map and return 0 if not found const std::vector* getAllowedLanesWithDefault(const AllowedLanesCont& c, const MSEdge* dest) const; protected: - /// @brief Unique ID. - std::string myID; - /// @brief This edge's numerical id - unsigned int myNumericalID; + int myNumericalID; /// @brief Container for the edge's lane; should be sorted: (right-hand-traffic) the more left the lane, the higher the container-index std::vector* myLanes; @@ -492,7 +530,7 @@ MSLaneChanger* myLaneChanger; /// @brief the purpose of the edge - EdgeBasicFunction myFunction; + const EdgeBasicFunction myFunction; /// @brief Vaporizer counter int myVaporizationRequests; @@ -506,7 +544,8 @@ /// @brief The preceeding edges std::vector myPredeccesors; - + /// @brief Persons on the edge (only for drawing) + mutable std::set myPersons; /// @name Storages for allowed lanes (depending on vehicle classes) /// @{ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSEdgeControl.cpp sumo-0.16.0~dfsg/src/microsim/MSEdgeControl.cpp --- sumo-0.15.0~dfsg/src/microsim/MSEdgeControl.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSEdgeControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 09 Apr 2001 -/// @version $Id: MSEdgeControl.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSEdgeControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Stores edges and lanes, performs moving of vehicle /****************************************************************************/ @@ -45,13 +45,13 @@ // =========================================================================== // member method definitions // =========================================================================== -MSEdgeControl::MSEdgeControl(const std::vector< MSEdge* > &edges) +MSEdgeControl::MSEdgeControl(const std::vector< MSEdge* >& edges) : myEdges(edges), myLanes(MSLane::dictSize()), myLastLaneChange(MSEdge::dictSize()) { // build the usage definitions for lanes for (std::vector< MSEdge* >::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { - const std::vector &lanes = (*i)->getLanes(); + const std::vector& lanes = (*i)->getLanes(); if (lanes.size() == 1) { size_t pos = (*lanes.begin())->getNumericalID(); myLanes[pos].lane = *(lanes.begin()); @@ -68,9 +68,8 @@ myLanes[pos].amActive = false; myLanes[pos].haveNeighbors = true; } + myLastLaneChange[(*i)->getNumericalID()] = -1; } - size_t pos = (*i)->getNumericalID(); - myLastLaneChange[pos] = -1; } } @@ -147,7 +146,7 @@ if (myLastLaneChange[edge.getNumericalID()] != t) { myLastLaneChange[edge.getNumericalID()] = t; edge.changeLanes(t); - const std::vector &lanes = edge.getLanes(); + const std::vector& lanes = edge.getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { LaneUsage& lu = myLanes[(*i)->getNumericalID()]; if ((*i)->getVehicleNumber() > 0 && !lu.amActive) { diff -Nru sumo-0.15.0~dfsg/src/microsim/MSEdgeControl.h sumo-0.16.0~dfsg/src/microsim/MSEdgeControl.h --- sumo-0.15.0~dfsg/src/microsim/MSEdgeControl.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSEdgeControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 09 Apr 2001 -/// @version $Id: MSEdgeControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSEdgeControl.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Stores edges and lanes, performs moving of vehicle /****************************************************************************/ @@ -51,7 +51,6 @@ class MSEdge; class MSLane; class OutputDevice; -class BinaryInputDevice; // =========================================================================== @@ -84,11 +83,11 @@ * @param[in] edges The loaded edges * @todo Assure both containers are not 0 */ - MSEdgeControl(const std::vector< MSEdge* > &edges) ; + MSEdgeControl(const std::vector< MSEdge* >& edges); /// @brief Destructor. - ~MSEdgeControl() ; + ~MSEdgeControl(); /** @brief Resets information whether a lane is active for all lanes @@ -97,7 +96,7 @@ * and is not marked as being active, it is added to the list og active lanes * and marked as being active. */ - void patchActiveLanes() ; + void patchActiveLanes(); /// @name Interfaces for longitudinal vehicle movement @@ -115,7 +114,7 @@ * * @see MSLane::moveCritical */ - void moveCritical(SUMOTime t) ; + void moveCritical(SUMOTime t); /** @brief Really moves critical vehicles @@ -136,7 +135,7 @@ * @see MSLane::integrateNewVehicle * @todo When moving to parallel processing, the usage of myWithVehicles2Integrate would get insecure!! */ - void moveFirst(SUMOTime t) ; + void moveFirst(SUMOTime t); /// @} @@ -148,7 +147,7 @@ * * @see MSEdge::changeLanes */ - void changeLanes(SUMOTime t) ; + void changeLanes(SUMOTime t); /** @brief Detect collisions @@ -159,7 +158,7 @@ * * @param[in] timestep The current time step */ - void detectCollisions(SUMOTime timestep) ; + void detectCollisions(SUMOTime timestep); /** @brief Returns loaded edges @@ -167,7 +166,7 @@ * @return the container storing one-lane edges * @todo Check: Is this secure? */ - const std::vector &getEdges() const { + const std::vector& getEdges() const { return myEdges; } @@ -176,7 +175,7 @@ * * @return a vector of names of all known edges */ - std::vector getEdgeNames() const ; + std::vector getEdgeNames() const; /** @brief Informs the control that the given lane got active @@ -184,7 +183,7 @@ * @param[in] l The activated lane * @todo Check for l==0? */ - void gotActive(MSLane* l) ; + void gotActive(MSLane* l); public: diff -Nru sumo-0.15.0~dfsg/src/microsim/MSEdgeWeightsStorage.cpp sumo-0.16.0~dfsg/src/microsim/MSEdgeWeightsStorage.cpp --- sumo-0.15.0~dfsg/src/microsim/MSEdgeWeightsStorage.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSEdgeWeightsStorage.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 02.11.2009 -/// @version $Id: MSEdgeWeightsStorage.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSEdgeWeightsStorage.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A storage for edge travel times and efforts /****************************************************************************/ @@ -54,7 +54,7 @@ if (i == myTravelTimes.end()) { return false; } - const ValueTimeLine &tl = (*i).second; + const ValueTimeLine& tl = (*i).second; if (!tl.describesTime(t)) { return false; } @@ -70,7 +70,7 @@ if (i == myEfforts.end()) { return false; } - const ValueTimeLine &tl = (*i).second; + const ValueTimeLine& tl = (*i).second; if (!tl.describesTime(t)) { return false; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSEdgeWeightsStorage.h sumo-0.16.0~dfsg/src/microsim/MSEdgeWeightsStorage.h --- sumo-0.15.0~dfsg/src/microsim/MSEdgeWeightsStorage.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSEdgeWeightsStorage.h 2012-09-25 22:01:39.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 02.11.2009 -/// @version $Id: MSEdgeWeightsStorage.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSEdgeWeightsStorage.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A storage for edge travel times and efforts /****************************************************************************/ @@ -52,11 +52,11 @@ class MSEdgeWeightsStorage { public: /// @brief Constructor - MSEdgeWeightsStorage() ; + MSEdgeWeightsStorage(); /// @brief Destructor - ~MSEdgeWeightsStorage() ; + ~MSEdgeWeightsStorage(); /** @brief Returns a travel time for an edge and time if stored @@ -67,7 +67,7 @@ * @return Whether the requested edge/time is described */ bool retrieveExistingTravelTime(const MSEdge* const e, const SUMOVehicle* const v, - SUMOReal t, SUMOReal& value) const ; + SUMOReal t, SUMOReal& value) const; /** @brief Returns an effort for an edge and time if stored @@ -78,7 +78,7 @@ * @return Whether the requested edge/time is described */ bool retrieveExistingEffort(const MSEdge* const e, const SUMOVehicle* const v, - SUMOReal t, SUMOReal& value) const ; + SUMOReal t, SUMOReal& value) const; /** @brief Adds a travel time information for an edge and a time span @@ -87,7 +87,7 @@ * @param[in] end The end of the described time span * @param[in] value The travel time value for this edge and time span */ - void addTravelTime(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value) ; + void addTravelTime(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value); /** @brief Adds an effort information for an edge and a time span @@ -96,33 +96,33 @@ * @param[in] end The end of the described time span * @param[in] value Theeffort value for this edge and time span */ - void addEffort(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value) ; + void addEffort(const MSEdge* const e, SUMOReal begin, SUMOReal end, SUMOReal value); /** @brief Removes the travel time information for an edge * @param[in] e The described edge */ - void removeTravelTime(const MSEdge* const e) ; + void removeTravelTime(const MSEdge* const e); /** @brief Removes the effort information for an edge * @param[in] e The described edge */ - void removeEffort(const MSEdge* const e) ; + void removeEffort(const MSEdge* const e); /** @brief Returns the information whether any travel time is known for the given edge * @param[in] e The investigated edge * @return Whether any travel time information about this edge is stored */ - bool knowsTravelTime(const MSEdge* const e) const ; + bool knowsTravelTime(const MSEdge* const e) const; /** @brief Returns the information whether any effort is known for the given edge * @param[in] e The investigated edge * @return Whether any travel time information about this edge is stored */ - bool knowsEffort(const MSEdge* const e) const ; + bool knowsEffort(const MSEdge* const e) const; private: diff -Nru sumo-0.15.0~dfsg/src/microsim/MSFrame.cpp sumo-0.16.0~dfsg/src/microsim/MSFrame.cpp --- sumo-0.15.0~dfsg/src/microsim/MSFrame.cpp 2012-01-27 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSFrame.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,9 +5,10 @@ /// @author Jakob Erdmann /// @author Axel Wegener /// @author Thimor Bohn +/// @author Mario Krumnow /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSFrame.cpp 11795 2012-01-26 21:48:41Z behrisch $ +/// @version $Id: MSFrame.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Sets and checks options for microsim; inits global outputs and settings /****************************************************************************/ @@ -42,8 +43,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -98,7 +101,7 @@ oc.addSynonyme("weight-attribute", "measure", true); oc.addDescription("weight-attribute", "Input", "Name of the xml attribute which gives the edge weight"); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL oc.doRegister("load-state", new Option_FileName());//!!! check, describe oc.addDescription("load-state", "Input", "Loads a network state from FILE"); oc.doRegister("load-state.offset", new Option_String("0", "TIME"));//!!! check, describe @@ -115,6 +118,21 @@ oc.addSynonyme("netstate-dump.empty-edges", "dump-empty-edges", true); oc.addDescription("netstate-dump.empty-edges", "Output", "Write also empty edges completely when dumping"); + + oc.doRegister("emission-output", new Option_FileName()); + oc.addDescription("emission-output", "Output", "Save the emission values of each vehicle"); + oc.doRegister("fcd-output", new Option_FileName()); + oc.addDescription("fcd-output", "Output", "Save the Floating Car Data"); + oc.doRegister("fcd-output.geo", new Option_Bool(false)); + oc.addDescription("fcd-output.geo", "Output", "Save the Floating Car Data using geo-coordinates (lon/lat)"); + oc.doRegister("full-output", new Option_FileName()); + oc.addDescription("full-output", "Output", "Save a lot of information for each timestep (very redundant)"); + oc.doRegister("queue-output", new Option_FileName()); + oc.addDescription("queue-output", "Output", "Save the vehicle queues at the junctions (experimental)"); + oc.doRegister("vtk-output", new Option_FileName()); + oc.addDescription("vtk-output", "Output", "Save complete vehicle positions in VTK Format (usage: /file/out will produce /file/out_$NR$.vtp files)"); + + oc.doRegister("summary-output", new Option_FileName()); oc.addSynonyme("summary-output", "summary"); oc.addSynonyme("summary-output", "emissions-output", true); @@ -141,10 +159,15 @@ oc.addSynonyme("vehroute-output.sorted", "vehroutes.sorted"); oc.addDescription("vehroute-output.sorted", "Output", "Sorts the output by departure time"); -#ifdef HAVE_MESOSIM + oc.doRegister("vehroute-output.write-unfinished", new Option_Bool(false)); + oc.addDescription("vehroute-output.write-unfinished", "Output", "Write vehroute output for vehicles which have not arrived at simulation end"); + + + +#ifdef HAVE_INTERNAL oc.doRegister("save-state.times", new Option_IntVector(IntVector()));//!!! check, describe oc.addDescription("save-state.times", "Output", "Use INT[] as times at which a network state written"); - oc.doRegister("save-state.prefix", new Option_FileName());//!!! check, describe + oc.doRegister("save-state.prefix", new Option_FileName("state"));//!!! check, describe oc.addDescription("save-state.prefix", "Output", "Prefix for network states"); oc.doRegister("save-state.files", new Option_FileName());//!!! check, describe oc.addDescription("save-state.files", "Output", "Files for network states"); @@ -201,6 +224,13 @@ oc.doRegister("lanechange.allow-swap", new Option_Bool(false)); oc.addDescription("lanechange.allow-swap", "Processing", "Whether blocking vehicles trying to change lanes may be swapped."); + oc.doRegister("routing-algorithm", new Option_String("dijkstra")); + oc.addDescription("routing-algorithm", "Processing", + "Select among routing algorithms ['dijkstra', 'astar']"); + + oc.doRegister("routeDist.maxsize", new Option_Integer()); + oc.addDescription("routeDist.maxsize", "Processing", + "Restrict the maximum size of route distributions"); // devices MSDevice_Routing::insertOptions(); @@ -226,7 +256,7 @@ #endif #endif // -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL oc.addOptionSubTopic("Mesoscopic"); oc.doRegister("mesosim", new Option_Bool(false)); oc.addDescription("mesosim", "Mesoscopic", "Enables mesoscopic simulation"); @@ -240,12 +270,14 @@ oc.addDescription("meso-taujf", "Mesoscopic", "Factor for calculating the jam-free headway time"); oc.doRegister("meso-taujj", new Option_String("2", "TIME")); oc.addDescription("meso-taujj", "Mesoscopic", "Factor for calculating the jam-jam headway time"); - oc.doRegister("meso-jam-threshold", new Option_Float(0.29f)); - oc.addDescription("meso-jam-threshold", "Mesoscopic", "Minimum percentage of occupied space to consider a segment jammed"); + oc.doRegister("meso-jam-threshold", new Option_Float(-1)); + oc.addDescription("meso-jam-threshold", "Mesoscopic", "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)"); oc.doRegister("meso-multi-queue", new Option_Bool(false)); oc.addDescription("meso-multi-queue", "Mesoscopic", "Enable multiple queues at edge ends"); oc.doRegister("meso-junction-control", new Option_Bool(false)); oc.addDescription("meso-junction-control", "Mesoscopic", "Enable mesoscopic traffic light and priority junction handling"); + oc.doRegister("meso-junction-control.limited", new Option_Bool(false)); + oc.addDescription("meso-junction-control.limited", "Mesoscopic", "Enable mesoscopic traffic light and priority junction handling for saturated links. This prevents faulty traffic lights from hindering flow in low-traffic situations"); oc.doRegister("meso-recheck", new Option_String("0", "TIME")); oc.addDescription("meso-recheck", "Mesoscopic", "Time interval for rechecking insertion into the next segment after failure"); #endif @@ -280,6 +312,14 @@ OutputDevice::createDeviceByOption("netstate-dump", "sumo-netstate"); OutputDevice::createDeviceByOption("summary-output", "summary"); OutputDevice::createDeviceByOption("tripinfo-output", "tripinfos"); + + //extended + OutputDevice::createDeviceByOption("fcd-output", "fcd-export"); + OutputDevice::createDeviceByOption("emission-output", "emission-export"); + OutputDevice::createDeviceByOption("full-output", "full-export"); + OutputDevice::createDeviceByOption("queue-output", "queue-export"); + OutputDevice::createDeviceByOption("vtk-output", "vtk-export"); + MSDevice_Vehroutes::init(); } @@ -309,6 +349,20 @@ WRITE_ERROR("A vehroute-output file is needed for exit times."); ok = false; } + if (oc.isSet("gui-settings-file") && + oc.getString("gui-settings-file") != "" && + !oc.isUsableFileList("gui-settings-file")) { + ok = false; + } + if (oc.isSet("routeDist.maxsize") && oc.getInt("routeDist.maxsize") <= 0) { + WRITE_ERROR("routeDist.maxsize must be positive"); + ok = false; + } +#ifdef HAVE_INTERNAL + if (oc.getBool("meso-junction-control.limited") && !oc.getBool("meso-junction-control")) { + oc.set("meso-junction-control", "true"); + } +#endif return ok; } @@ -328,14 +382,21 @@ MSGlobals::gTimeToGridlock = string2time(oc.getString("time-to-teleport")) < 0 ? 0 : string2time(oc.getString("time-to-teleport")); MSGlobals::gCheck4Accidents = !oc.getBool("ignore-accidents"); MSGlobals::gCheckRoutes = !oc.getBool("ignore-route-errors"); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL MSGlobals::gStateLoaded = oc.isSet("load-state"); MSGlobals::gUseMesoSim = oc.getBool("mesosim"); + MSGlobals::gMesoLimitedJunctionControl = oc.getBool("meso-junction-control.limited"); + if (MSGlobals::gUseMesoSim) { + MSGlobals::gUsingInternalLanes = false; + } #endif #ifdef HAVE_SUBSECOND_TIMESTEPS DELTA_T = string2time(oc.getString("step-length")); #endif + if (oc.isSet("routeDist.maxsize")) { + MSRoute::setMaxRouteDistSize(oc.getInt("routeDist.maxsize")); + } } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSGlobals.cpp sumo-0.16.0~dfsg/src/microsim/MSGlobals.cpp --- sumo-0.15.0~dfsg/src/microsim/MSGlobals.cpp 2012-02-14 00:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSGlobals.cpp 2012-11-27 00:02:17.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date late summer 2003 -/// @version $Id: MSGlobals.cpp 11882 2012-02-13 09:31:35Z namdre $ +/// @version $Id: MSGlobals.cpp 13049 2012-11-26 09:10:34Z namdre $ /// // Some static variables for faster access /****************************************************************************/ @@ -49,14 +49,19 @@ bool MSGlobals::gCheckRoutes; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL bool MSGlobals::gStateLoaded; bool MSGlobals::gUseMesoSim; +bool MSGlobals::gMesoLimitedJunctionControl; MELoop* MSGlobals::gMesoNet; #else const bool MSGlobals::gUseMesoSim = false; #endif +#ifdef _DEBUG +bool MSGlobals::gDebugFlag1 = false; +bool MSGlobals::gDebugFlag2 = false; +#endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSGlobals.h sumo-0.16.0~dfsg/src/microsim/MSGlobals.h --- sumo-0.15.0~dfsg/src/microsim/MSGlobals.h 2012-02-14 00:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSGlobals.h 2012-11-27 00:02:17.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date late summer 2003 -/// @version $Id: MSGlobals.h 11882 2012-02-13 09:31:35Z namdre $ +/// @version $Id: MSGlobals.h 13049 2012-11-26 09:10:34Z namdre $ /// // Some static variables for faster access /****************************************************************************/ @@ -39,7 +39,7 @@ // =========================================================================== // class declarations // =========================================================================== -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL class MELoop; #endif @@ -72,13 +72,16 @@ /** information whether the routes shall be checked for connectivity */ static bool gCheckRoutes; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /// Information whether a state has been loaded static bool gStateLoaded; /** Information whether mesosim shall be used */ static bool gUseMesoSim; + /** Information whether limited junction control shall be used */ + static bool gMesoLimitedJunctionControl; + /// mesoscopic simulation infrastructure static MELoop* gMesoNet; #else @@ -87,6 +90,12 @@ #endif +#ifdef _DEBUG + /// @brief global utility flags for debugging + static bool gDebugFlag1; + static bool gDebugFlag2; +#endif + }; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSInsertionControl.cpp sumo-0.16.0~dfsg/src/microsim/MSInsertionControl.cpp --- sumo-0.15.0~dfsg/src/microsim/MSInsertionControl.cpp 2012-03-02 00:03:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSInsertionControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSInsertionControl.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSInsertionControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Inserts vehicles into the network when their departure time is reached /****************************************************************************/ @@ -76,7 +76,7 @@ pars->departPosProcedure == DEPART_POS_RANDOM || MSNet::getInstance()->getVehicleControl().hasVTypeDistribution(pars->vtypeid); if (!flow.isVolatile) { - RandomDistributor *dist = MSRoute::distDictionary(pars->routeid); + RandomDistributor* dist = MSRoute::distDictionary(pars->routeid); if (dist != 0) { const std::vector& routes = dist->getVals(); const MSEdge* e = 0; @@ -156,11 +156,16 @@ if (myMaxDepartDelay >= 0 && time - veh->getParameter().depart > myMaxDepartDelay) { // remove vehicles waiting too long for departure checkFlowWait(veh); - myVehicleControl.deleteVehicle(veh); + myVehicleControl.deleteVehicle(veh, true); } else if (edge.isVaporizing()) { // remove vehicles if the edge shall be empty checkFlowWait(veh); - myVehicleControl.deleteVehicle(veh); + myVehicleControl.deleteVehicle(veh, true); + } else if (myAbortedEmits.count(veh) > 0) { + // remove vehicles which shall not be inserted for some reason + myAbortedEmits.erase(veh); + checkFlowWait(veh); + myVehicleControl.deleteVehicle(veh, true); } else { // let the vehicle wait one step, we'll retry then refusedEmits.push_back(veh); @@ -197,6 +202,7 @@ unsigned int MSInsertionControl::checkFlows(SUMOTime time, MSVehicleContainer::VehicleVector& refusedEmits) { + MSVehicleControl& vehControl = MSNet::getInstance()->getVehicleControl(); unsigned int noEmitted = 0; for (std::vector::iterator i = myFlows.begin(); i != myFlows.end();) { SUMOVehicleParameter* pars = i->pars; @@ -211,18 +217,23 @@ newPars->depart = static_cast(pars->depart + pars->repetitionsDone * pars->repetitionOffset); pars->repetitionsDone++; // try to build the vehicle - if (MSNet::getInstance()->getVehicleControl().getVehicle(newPars->id) == 0) { + if (vehControl.getVehicle(newPars->id) == 0) { const MSRoute* route = MSRoute::dictionary(pars->routeid); - const MSVehicleType* vtype = MSNet::getInstance()->getVehicleControl().getVType(pars->vtypeid); - i->vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(newPars, route, vtype); - MSNet::getInstance()->getVehicleControl().addVehicle(newPars->id, i->vehicle); - noEmitted += tryInsert(time, i->vehicle, refusedEmits); - if (!i->isVolatile && i->vehicle != 0) { - break; + const MSVehicleType* vtype = vehControl.getVType(pars->vtypeid); + i->vehicle = vehControl.buildVehicle(newPars, route, vtype); + if (vehControl.isInQuota()) { + vehControl.addVehicle(newPars->id, i->vehicle); + noEmitted += tryInsert(time, i->vehicle, refusedEmits); + if (!i->isVolatile && i->vehicle != 0) { + break; + } + } else { + vehControl.deleteVehicle(i->vehicle, true); + i->vehicle = 0; } } else { // strange: another vehicle with the same id already exists -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gStateLoaded) { break; } @@ -253,5 +264,10 @@ } +void +MSInsertionControl::descheduleDeparture(SUMOVehicle* veh) { + myAbortedEmits.insert(veh); +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSInsertionControl.h sumo-0.16.0~dfsg/src/microsim/MSInsertionControl.h --- sumo-0.15.0~dfsg/src/microsim/MSInsertionControl.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSInsertionControl.h 2012-11-28 00:02:18.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSInsertionControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSInsertionControl.h 13056 2012-11-27 10:33:52Z namdre $ /// // Inserts vehicles into the network when their departure time is reached /****************************************************************************/ @@ -71,11 +71,11 @@ * @param[in] maxDepartDelay Vehicles waiting for insertion longer than this time are deleted (-1: no deletion) * @param[in] checkEdgesOnce Whether an edge on which a vehicle could not depart should be ignored in the same step */ - MSInsertionControl(MSVehicleControl& vc, SUMOTime maxDepartDelay, bool checkEdgesOnce) ; + MSInsertionControl(MSVehicleControl& vc, SUMOTime maxDepartDelay, bool checkEdgesOnce); /// @brief Destructor. - ~MSInsertionControl() ; + ~MSInsertionControl(); /** @brief Emits vehicles that want to depart at the given time @@ -94,7 +94,7 @@ * @param[in] time The current simulation time * @return The number of vehicles that could be inserted into the net */ - unsigned int emitVehicles(SUMOTime time) ; + unsigned int emitVehicles(SUMOTime time); /** @brief Adds a single vehicle for departure @@ -103,14 +103,14 @@ * * @param[in] veh The vehicle to add for later insertion */ - void add(SUMOVehicle* veh) ; + void add(SUMOVehicle* veh); /** @brief Adds parameter for a vehicle flow for departure * * @param[in] flow The flow to add for later insertion */ - void add(SUMOVehicleParameter* pars) ; + void add(SUMOVehicleParameter* pars); /** @brief Returns the number of waiting vehicles @@ -120,14 +120,18 @@ * * @return The number of vehicles that could not (yet) be inserted into the net */ - unsigned int getWaitingVehicleNo() const ; + unsigned int getWaitingVehicleNo() const; /** @brief Returns the number of flows that are still active * * @return number of active flows */ - int getPendingFlowCount() const ; + int getPendingFlowCount() const; + + + /// @brief stops trying to emit the given vehicle + void descheduleDeparture(SUMOVehicle* veh); private: @@ -146,14 +150,14 @@ * @return The number of emitted vehicles (0 or 1) */ unsigned int tryInsert(SUMOTime time, SUMOVehicle* veh, - MSVehicleContainer::VehicleVector& refusedEmits) ; + MSVehicleContainer::VehicleVector& refusedEmits); /** @brief Checks whether any flow is blocked due to this vehicle and clears the block * * @param[in] veh The vehicle to check for */ - void checkFlowWait(SUMOVehicle* veh) ; + void checkFlowWait(SUMOVehicle* veh); /** @brief Adds all vehicles that should have been emitted earlier to the refuse container @@ -161,7 +165,7 @@ * @param[in] time The current simulation time * @todo recheck */ - void checkPrevious(SUMOTime time) ; + void checkPrevious(SUMOTime time); /** @brief Checks for all vehicles coming from flows whether they can be emitted @@ -171,7 +175,7 @@ * @return The number of emitted vehicles */ unsigned int checkFlows(SUMOTime time, - MSVehicleContainer::VehicleVector& refusedEmits) ; + MSVehicleContainer::VehicleVector& refusedEmits); private: @@ -181,9 +185,12 @@ /// @brief All loaded vehicles sorted by their departure time MSVehicleContainer myAllVeh; - /// @brief Buffers for vehicles that could not been inserted + /// @brief Buffers for vehicles that could not be inserted MSVehicleContainer::VehicleVector myRefusedEmits1, myRefusedEmits2; + /// @brief Set of vehicles which shall not be inserted anymore + std::set myAbortedEmits; + /** @struct Stop * @brief Definition of vehicle stop (position and duration) */ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSInternalJunction.cpp sumo-0.16.0~dfsg/src/microsim/MSInternalJunction.cpp --- sumo-0.15.0~dfsg/src/microsim/MSInternalJunction.cpp 2012-02-11 00:02:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSInternalJunction.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSInternalJunction.cpp 11868 2012-02-10 11:49:38Z dkrajzew $ +/// @version $Id: MSInternalJunction.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // junction. /****************************************************************************/ @@ -64,15 +64,15 @@ // inform links where they have to report approaching vehicles to unsigned int requestPos = 0; for (std::vector::iterator i = myInternalLanes.begin(); i != myInternalLanes.end(); ++i) { - const MSLinkCont& lc = (*i)->getLinkCont(); - for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) { - if ((*q)->getViaLane() != 0) { - myInternalLaneFoes.push_back((*q)->getViaLane()); - } else { - myInternalLaneFoes.push_back(*i); - } + const MSLinkCont& lc = (*i)->getLinkCont(); + for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) { + if ((*q)->getViaLane() != 0) { + myInternalLaneFoes.push_back((*q)->getViaLane()); + } else { + myInternalLaneFoes.push_back(*i); } - + } + } for (std::vector::const_iterator i = myIncomingLanes.begin() + 1; i != myIncomingLanes.end(); ++i) { MSLane* l = *i; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSInternalJunction.h sumo-0.16.0~dfsg/src/microsim/MSInternalJunction.h --- sumo-0.15.0~dfsg/src/microsim/MSInternalJunction.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSInternalJunction.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSInternalJunction.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSInternalJunction.h 13107 2012-12-02 13:57:34Z behrisch $ /// // junction. /****************************************************************************/ @@ -68,20 +68,20 @@ */ MSInternalJunction(const std::string& id, const Position& position, const PositionVector& shape, - std::vector incoming, std::vector internal) ; + std::vector incoming, std::vector internal); /// Destructor. virtual ~MSInternalJunction(); - void postloadInit() ; + void postloadInit(); - const std::vector &getFoeLinks(const MSLink* const srcLink) const { + const std::vector& getFoeLinks(const MSLink* const srcLink) const { UNUSED_PARAMETER(srcLink); return myInternalLinkFoes; } - const std::vector &getFoeInternalLanes(const MSLink* const srcLink) const { + const std::vector& getFoeInternalLanes(const MSLink* const srcLink) const { UNUSED_PARAMETER(srcLink); return myInternalLaneFoes; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSInternalLane.cpp sumo-0.16.0~dfsg/src/microsim/MSInternalLane.cpp --- sumo-0.15.0~dfsg/src/microsim/MSInternalLane.cpp 2012-03-08 00:03:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSInternalLane.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2003 -/// @version $Id: MSInternalLane.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: MSInternalLane.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a lane over a junction /****************************************************************************/ @@ -62,7 +62,7 @@ const PositionVector& shape, SUMOReal width, SVCPermissions permissions): MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions), - myFoesIndex(-1) + myFoesIndex(-1) {} @@ -77,12 +77,6 @@ } -void -MSInternalLane::setPassPosition(SUMOReal passPos) { - myPassPosition = passPos; -} - - bool MSInternalLane::moveCritical(SUMOTime t) { assert(myVehicles.size() > 0); diff -Nru sumo-0.15.0~dfsg/src/microsim/MSInternalLane.h sumo-0.16.0~dfsg/src/microsim/MSInternalLane.h --- sumo-0.15.0~dfsg/src/microsim/MSInternalLane.h 2012-03-08 00:03:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSInternalLane.h 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2003 -/// @version $Id: MSInternalLane.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: MSInternalLane.h 12548 2012-08-15 08:48:04Z namdre $ /// // Representation of a lane over a junction /****************************************************************************/ @@ -96,7 +96,7 @@ /// @brief Destructor - virtual ~MSInternalLane() ; + virtual ~MSInternalLane(); /// @name Additional initialisation @@ -112,15 +112,7 @@ * @param[in] foesIdx This lane's index within this state */ void setParentJunctionInformation(MSLogicJunction::InnerState* const foescont, - unsigned int foesIdx) ; - - - /** @brief Sets the position that must be free so that vehicles can pass - * @todo !!! incomplete usage; check - */ - void setPassPosition(SUMOReal passPos) ; - /// @} - + unsigned int foesIdx); /// @name Vehicle movement (longitudinal) @@ -138,12 +130,6 @@ /// @brief The index on which to write into this container int myFoesIndex; - /** @brief The position that must be free so that vehicles can pass - * @todo !!! incomplete usage; check - */ - SUMOReal myPassPosition; - - private: /// @brief invalidated copy constructor MSInternalLane(const MSInternalLane& s); diff -Nru sumo-0.15.0~dfsg/src/microsim/MSJunction.cpp sumo-0.16.0~dfsg/src/microsim/MSJunction.cpp --- sumo-0.15.0~dfsg/src/microsim/MSJunction.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSJunction.cpp 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunction.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSJunction.cpp 12722 2012-09-17 09:41:32Z dkrajzew $ /// // The base class for an intersection /****************************************************************************/ @@ -48,7 +48,7 @@ // =========================================================================== MSJunction::MSJunction(const std::string& id, const Position& position, const PositionVector& shape) - : myID(id), myPosition(position), myShape(shape) {} + : Named(id), myPosition(position), myShape(shape) {} MSJunction::~MSJunction() {} @@ -64,11 +64,6 @@ MSJunction::postloadInit() {} -const std::string& -MSJunction::getID() const { - return myID; -} - /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSJunction.h sumo-0.16.0~dfsg/src/microsim/MSJunction.h --- sumo-0.15.0~dfsg/src/microsim/MSJunction.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSJunction.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunction.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSJunction.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The base class for an intersection /****************************************************************************/ @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -53,29 +54,29 @@ * @class MSJunction * @brief The base class for an intersection */ -class MSJunction { +class MSJunction : public Named { public: - /// @brief Destructor. - virtual ~MSJunction(); - /** @brief Constructor * @param[in] id The id of the junction * @param[in] position The position of the junction * @param[in] shape The shape of the junction */ MSJunction(const std::string& id, const Position& position, - const PositionVector& shape) ; + const PositionVector& shape); + + + /// @brief Destructor. + virtual ~MSJunction(); + /** performs some initialisation after the loading (e.g., link map computation) */ - virtual void postloadInit() ; + virtual void postloadInit(); /** returns the junction's position */ const Position& getPosition() const; - /// Returns the id of the junction - const std::string& getID() const; /** @brief Returns this junction's shape * @return The shape of this junction @@ -84,18 +85,15 @@ return myShape; } - virtual const std::vector &getFoeLinks(const MSLink* const /*srcLink*/) const { + virtual const std::vector& getFoeLinks(const MSLink* const /*srcLink*/) const { return myEmptyLinks; } - virtual const std::vector &getFoeInternalLanes(const MSLink* const /*srcLink*/) const { + virtual const std::vector& getFoeInternalLanes(const MSLink* const /*srcLink*/) const { return myEmptyLanes; } protected: - /// @brief The id of the junction - std::string myID; - /// @brief The position of the junction Position myPosition; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSJunctionControl.cpp sumo-0.16.0~dfsg/src/microsim/MSJunctionControl.cpp --- sumo-0.15.0~dfsg/src/microsim/MSJunctionControl.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSJunctionControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 06 Mar 2001 -/// @version $Id: MSJunctionControl.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSJunctionControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Container for junctions; performs operations on all stored junctions /****************************************************************************/ @@ -52,7 +52,7 @@ void MSJunctionControl::postloadInitContainer() { - const std::vector &junctions = buildAndGetStaticVector(); + const std::vector& junctions = buildAndGetStaticVector(); for (std::vector::const_iterator i = junctions.begin(); i != junctions.end(); ++i) { (*i)->postloadInit(); } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSJunctionControl.h sumo-0.16.0~dfsg/src/microsim/MSJunctionControl.h --- sumo-0.15.0~dfsg/src/microsim/MSJunctionControl.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSJunctionControl.h 2012-09-25 22:01:39.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSJunctionControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSJunctionControl.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Container for junctions; performs operations on all stored junctions /****************************************************************************/ @@ -57,11 +57,11 @@ class MSJunctionControl : public NamedObjectCont { public: /// @brief Constructor - MSJunctionControl() ; + MSJunctionControl(); /// @brief Destructor - ~MSJunctionControl() ; + ~MSJunctionControl(); /** @brief Closes building of junctions @@ -70,7 +70,7 @@ * @exception ProcessError From the called "postloadInit" * @see MSJunction::postloadInit */ - void postloadInitContainer() ; + void postloadInitContainer(); private: diff -Nru sumo-0.15.0~dfsg/src/microsim/MSJunctionLogic.h sumo-0.16.0~dfsg/src/microsim/MSJunctionLogic.h --- sumo-0.15.0~dfsg/src/microsim/MSJunctionLogic.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSJunctionLogic.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunctionLogic.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSJunctionLogic.h 13107 2012-12-02 13:57:34Z behrisch $ /// // kinds of logic-implementations. /****************************************************************************/ @@ -57,7 +57,7 @@ return myDummyFoes; } - virtual const std::bitset<64> &getInternalFoesFor(unsigned int linkIndex) const { + virtual const std::bitset<64>& getInternalFoesFor(unsigned int linkIndex) const { UNUSED_PARAMETER(linkIndex); return myDummyFoes; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLCM_DK2004.cpp sumo-0.16.0~dfsg/src/microsim/MSLCM_DK2004.cpp --- sumo-0.15.0~dfsg/src/microsim/MSLCM_DK2004.cpp 2012-03-02 00:03:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLCM_DK2004.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: MSLCM_DK2004.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSLCM_DK2004.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A lane change model developed by D. Krajzewicz between 2004 and 2010 /****************************************************************************/ @@ -80,11 +80,11 @@ int MSLCM_DK2004::wantsChangeToRight(MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair &leader, - const std::pair &neighLead, - const std::pair &neighFollow, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, const MSLane& neighLane, - const std::vector &preb, + const std::vector& preb, MSVehicle** lastBlocked) { #ifdef DEBUG_VEHICLE_GUI_SELECTION if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { @@ -210,7 +210,7 @@ // in this case, we do not want to get to the dead-end of an on-ramp // // THIS RULE APPLIES ONLY TO CHANGING TO THE RIGHT LANE - if (bestLaneOffset == 0 && preb[currIdx - 1].bestLaneOffset != 0 && myVehicle.getLane()->getMaxSpeed() > 80. / 3.6) { + if (bestLaneOffset == 0 && preb[currIdx - 1].bestLaneOffset != 0 && myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle) > 80. / 3.6) { return ret; } // -------- @@ -236,8 +236,8 @@ if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! return ret; } - SUMOReal thisLaneVSafe = myVehicle.getLane()->getMaxSpeed(); - SUMOReal neighLaneVSafe = neighLane.getMaxSpeed(); + SUMOReal thisLaneVSafe = myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle); + SUMOReal neighLaneVSafe = neighLane.getVehicleMaxSpeed(&myVehicle); if (neighLead.first == 0) { neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighDist, 0, 0)); } else { @@ -260,11 +260,11 @@ } } else { // ok, the right lane is faster than the current - myChangeProbability -= (SUMOReal)((neighLaneVSafe - thisLaneVSafe) / (myVehicle.getLane()->getMaxSpeed())); + myChangeProbability -= (SUMOReal)((neighLaneVSafe - thisLaneVSafe) / (myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle))); } // let's recheck the "Rechtsfahrgebot" - SUMOReal vmax = MIN2(myVehicle.getLane()->getMaxSpeed(), myVehicle.getVehicleType().getMaxSpeed()); + SUMOReal vmax = MIN2(myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle), myVehicle.getVehicleType().getMaxSpeed()); vmax -= (SUMOReal)(5. / 2.6); if (neighLaneVSafe >= vmax) { #ifndef NO_TRACI @@ -297,11 +297,11 @@ int MSLCM_DK2004::wantsChangeToLeft(MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair &leader, - const std::pair &neighLead, - const std::pair &neighFollow, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, const MSLane& neighLane, - const std::vector &preb, + const std::vector& preb, MSVehicle** lastBlocked) { #ifdef DEBUG_VEHICLE_GUI_SELECTION if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { @@ -462,8 +462,8 @@ if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! return ret; } - SUMOReal neighLaneVSafe = neighLane.getMaxSpeed(); - SUMOReal thisLaneVSafe = myVehicle.getLane()->getMaxSpeed(); + SUMOReal neighLaneVSafe = neighLane.getVehicleMaxSpeed(&myVehicle); + SUMOReal thisLaneVSafe = myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle); if (neighLead.first == 0) { neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighDist, 0, 0)); // !!! warum nicht die Folgesgeschw.? } else { @@ -485,7 +485,7 @@ } } else { // right lane is better - myChangeProbability += (SUMOReal)((neighLaneVSafe - thisLaneVSafe) / (myVehicle.getLane()->getMaxSpeed())); // !!! Fahrzeuggeschw.! + myChangeProbability += (SUMOReal)((neighLaneVSafe - thisLaneVSafe) / (myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle))); // !!! Fahrzeuggeschw.! } if (myChangeProbability > .2 && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { // .1 return ret | LCA_LEFT | LCA_SPEEDGAIN | LCA_URGENT; @@ -622,8 +622,8 @@ MSLCM_DK2004::informBlocker(MSAbstractLaneChangeModel::MSLCMessager& msgPass, int& blocked, int dir, - const std::pair &neighLead, - const std::pair &neighFollow) { + const std::pair& neighLead, + const std::pair& neighFollow) { if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { assert(neighFollow.first != 0); MSVehicle* nv = neighFollow.first; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLCM_DK2004.h sumo-0.16.0~dfsg/src/microsim/MSLCM_DK2004.h --- sumo-0.15.0~dfsg/src/microsim/MSLCM_DK2004.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLCM_DK2004.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: MSLCM_DK2004.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSLCM_DK2004.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A lane change model developed by D. Krajzewicz between 2004 and 2010 /****************************************************************************/ @@ -72,11 +72,11 @@ and whether another lane may be more preferable */ virtual int wantsChangeToRight( MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair &leader, - const std::pair &neighLead, - const std::pair &neighFollow, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, const MSLane& neighLane, - const std::vector &preb, + const std::vector& preb, MSVehicle** lastBlocked); /** @brief Called to examine whether the vehicle wants to change to left @@ -84,11 +84,11 @@ and whether another lane may be more preferable */ virtual int wantsChangeToLeft( MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair &leader, - const std::pair &neighLead, - const std::pair &neighFollow, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, const MSLane& neighLane, - const std::vector &preb, + const std::vector& preb, MSVehicle** lastBlocked); virtual void* inform(void* info, MSVehicle* sender); @@ -117,8 +117,8 @@ protected: void informBlocker(MSAbstractLaneChangeModel::MSLCMessager& msgPass, int& blocked, int dir, - const std::pair &neighLead, - const std::pair &neighFollow); + const std::pair& neighLead, + const std::pair& neighFollow); inline bool amBlockingLeader() { return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLane.cpp sumo-0.16.0~dfsg/src/microsim/MSLane.cpp --- sumo-0.15.0~dfsg/src/microsim/MSLane.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLane.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -8,7 +8,7 @@ /// @author Michael Behrisch /// @author Christoph Sommer /// @date Mon, 05 Mar 2001 -/// @version $Id: MSLane.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: MSLane.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a lane in the micro simulation /****************************************************************************/ @@ -48,6 +48,7 @@ #include "MSVehicleTransfer.h" #include "MSGlobals.h" #include "MSVehicleControl.h" +#include "MSInsertionControl.h" #include #include #include @@ -87,8 +88,8 @@ myVehicles(), myLength(length), myWidth(width), myEdge(edge), myMaxSpeed(maxSpeed), myPermissions(permissions), myLogicalPredecessorLane(0), - myVehicleLengthSum(0), myInlappingVehicleEnd(10000), myInlappingVehicle(0) { -} + myVehicleLengthSum(0), myInlappingVehicleEnd(10000), myInlappingVehicle(0), + myLengthGeometryFactor(myShape.length() / myLength) {} MSLane::~MSLane() { @@ -99,13 +100,6 @@ void -MSLane::initialize(MSLinkCont* links) { - myLinks = *links; - delete links; -} - - -void MSLane::addLink(MSLink* link) { myLinks.push_back(link); } @@ -125,6 +119,7 @@ // ------ Vehicle emission ------ void MSLane::incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator& at, MSMoveReminder::Notification notification) { + assert(pos <= myLength); bool wasInactive = myVehicles.size() == 0; veh->enterLaneAtInsertion(this, pos, speed, notification); if (at == myVehicles.end()) { @@ -155,7 +150,7 @@ SUMOReal brakeGap = veh.getCarFollowModel().brakeGap(mspeed); std::pair leader = getLeaderOnConsecutive(brakeGap, 0, mspeed, veh, veh.getBestLanesContinuation(this)); if (leader.first != 0) { - xIn = getLength() + leader.second - veh.getVehicleType().getMinGap(); + xIn = getLength() + leader.second; vIn = leader.first->getSpeed(); leaderDecel = leader.first->getCarFollowModel().getMaxDecel(); } else { @@ -199,7 +194,7 @@ SUMOReal brakeGap = veh.getCarFollowModel().brakeGap(mspeed); std::pair leader = getLeaderOnConsecutive(brakeGap, 0, mspeed, veh, veh.getBestLanesContinuation(this)); if (leader.first != 0) { - xIn = getLength() + leader.second - veh.getVehicleType().getMinGap(); + xIn = getLength() + leader.second; vIn = leader.first->getSpeed(); } else { incorporateVehicle(&veh, maxPos, mspeed, myVehicles.end()); @@ -242,21 +237,21 @@ leaderSpeed = leader->getSpeed(); } const SUMOReal nettoGap = leaderRearPos - follower->getPositionOnLane() - veh.getVehicleType().getLengthWithGap(); - if (nettoGap > 0) { - const SUMOReal tau = veh.getCarFollowModel().getHeadwayTime(); - const SUMOReal tauDecel = tau * veh.getCarFollowModel().getMaxDecel(); - const SUMOReal fSpeed = follower->getSpeed(); - const SUMOReal lhs = nettoGap/tau + tauDecel - fSpeed - fSpeed*fSpeed/(2*tauDecel) + leaderSpeed*leaderSpeed/(2*tauDecel); - if (lhs >= sqrt(tauDecel * tauDecel + leaderSpeed * leaderSpeed)) { - const SUMOReal frontGap = (lhs * lhs - tauDecel * tauDecel - leaderSpeed * leaderSpeed) / (2*veh.getCarFollowModel().getMaxDecel()); - const SUMOReal currentMaxSpeed = lhs - tauDecel; - if (MIN2(currentMaxSpeed, mspeed) > maxSpeed) { - maxSpeed = currentMaxSpeed; - maxPos = leaderRearPos + frontGap; - maxIt = predIt+1; - } - } - } + if (nettoGap > 0) { + const SUMOReal tau = veh.getCarFollowModel().getHeadwayTime(); + const SUMOReal tauDecel = tau * veh.getCarFollowModel().getMaxDecel(); + const SUMOReal fSpeed = follower->getSpeed(); + const SUMOReal lhs = nettoGap / tau + tauDecel - fSpeed - fSpeed * fSpeed / (2 * tauDecel) + leaderSpeed * leaderSpeed / (2 * tauDecel); + if (lhs >= sqrt(tauDecel * tauDecel + leaderSpeed * leaderSpeed)) { + const SUMOReal frontGap = (lhs * lhs - tauDecel * tauDecel - leaderSpeed * leaderSpeed) / (2 * veh.getCarFollowModel().getMaxDecel()); + const SUMOReal currentMaxSpeed = lhs - tauDecel; + if (MIN2(currentMaxSpeed, mspeed) > maxSpeed) { + maxSpeed = currentMaxSpeed; + maxPos = leaderRearPos + frontGap; + maxIt = predIt + 1; + } + } + } ++predIt; } if (maxSpeed > 0) { @@ -316,9 +311,9 @@ frontMax = leaderRearPos - frontGapNeeded; } // compute the space needed to not let the follower collide - const SUMOReal followPos = follower->getPositionOnLane(); + const SUMOReal followPos = follower->getPositionOnLane() + follower->getVehicleType().getMinGap(); const SUMOReal backGapNeeded = follower->getCarFollowModel().getSecureGap(follower->getSpeed(), veh.getSpeed(), veh.getCarFollowModel().getMaxDecel()); - const SUMOReal backMin = followPos + backGapNeeded + veh.getVehicleType().getLengthWithGap(); + const SUMOReal backMin = followPos + backGapNeeded + veh.getVehicleType().getLength(); // check whether there is enough room (given some extra space for rounding errors) if (frontMax > 0 && backMin + POSITION_EPS < frontMax) { @@ -348,26 +343,26 @@ patchSpeed = false; break; case DEPART_SPEED_RANDOM: - speed = RandHelper::rand(MIN2(veh.getMaxSpeed(), getMaxSpeed())); - patchSpeed = true; // !!!(?) + speed = RandHelper::rand(MIN2(veh.getMaxSpeed(), getVehicleMaxSpeed(&veh))); + patchSpeed = true; // @todo check break; case DEPART_SPEED_MAX: - speed = MIN2(veh.getMaxSpeed(), getMaxSpeed()); - patchSpeed = true; // !!!(?) + speed = MIN2(veh.getMaxSpeed(), getVehicleMaxSpeed(&veh)); + patchSpeed = true; // @todo check break; case DEPART_SPEED_DEFAULT: default: // speed = 0 was set before - patchSpeed = false; // !!!(?) + patchSpeed = false; // @todo check break; } // determine the position switch (pars.departPosProcedure) { case DEPART_POS_GIVEN: - pos = pars.departPos; + pos = pars.departPos; if (pos < 0.) { - pos += myLength; + pos += myLength; } break; case DEPART_POS_RANDOM: @@ -410,40 +405,75 @@ MSMoveReminder::Notification notification) { if (pos < 0 || pos > myLength) { // we may not start there - WRITE_WARNING("Invalid departPos " + toString(pos) + " given for vehicle '" + - aVehicle->getID() + "'. Inserting at lane end instead."); + WRITE_WARNING("Invalid departPos " + toString(pos) + " given for vehicle '" + + aVehicle->getID() + "'. Inserting at lane end instead."); pos = myLength; } aVehicle->getBestLanes(true, this); const MSCFModel& cfModel = aVehicle->getCarFollowModel(); - const std::vector &bestLaneConts = aVehicle->getBestLanesContinuation(this); + const std::vector& bestLaneConts = aVehicle->getBestLanesContinuation(this); std::vector::const_iterator ri = bestLaneConts.begin(); SUMOReal seen = getLength() - pos; - SUMOReal dist = cfModel.brakeGap(speed); + SUMOReal dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); const MSRoute& r = aVehicle->getRoute(); MSRouteIterator ce = r.begin(); + unsigned int nRouteSuccs = 1; MSLane* currentLane = this; MSLane* nextLane = this; SUMOTime arrivalTime = MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(seen / speed); while (seen < dist && ri != bestLaneConts.end()) { // get the next link used... - MSLinkCont::const_iterator link = currentLane->succLinkSec(*aVehicle, 1, *currentLane, bestLaneConts); - // ...and the next used lane (including internal) - if (!currentLane->isLinkEnd(link) && (*link)->opened(arrivalTime, speed, aVehicle->getVehicleType().getLength()) && (*link)->getState() != LINKSTATE_TL_RED) { // red may have priority? -#ifdef HAVE_INTERNAL_LANES - bool nextInternal = false; - nextLane = (*link)->getViaLane(); - if (nextLane == 0) { - nextLane = (*link)->getLane(); + MSLinkCont::const_iterator link = currentLane->succLinkSec(*aVehicle, nRouteSuccs, *currentLane, bestLaneConts); + if (currentLane->isLinkEnd(link)) { + if (¤tLane->getEdge() == r.getLastEdge()) { + // reached the end of the route + if (aVehicle->getParameter().arrivalSpeedProcedure == ARRIVAL_SPEED_GIVEN) { + SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, seen, aVehicle->getParameter().arrivalSpeed, 0); + if (nspeed < speed) { + if (patchSpeed) { + speed = MIN2(nspeed, speed); + dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); + } else { + // we may not drive with the given velocity - we cannot match the specified arrival speed + WRITE_ERROR("Vehicle '" + aVehicle->getID() + "' will not be able to depart using given velocity!"); + MSNet::getInstance()->getInsertionControl().descheduleDeparture(aVehicle); + return false; + } + } + } } else { - nextInternal = true; + // lane does not continue + SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, seen, 0, 0); + if (nspeed < speed) { + if (patchSpeed) { + speed = MIN2(nspeed, speed); + dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); + } else { + // we may not drive with the given velocity - we cannot stop at the junction + WRITE_ERROR("Vehicle '" + aVehicle->getID() + "' will not be able to depart using given velocity!"); + MSNet::getInstance()->getInsertionControl().descheduleDeparture(aVehicle); + return false; + } + } } -#else - nextLane = (*link)->getLane(); -#endif - } else { break; } + if (!(*link)->opened(arrivalTime, speed, speed, aVehicle->getVehicleType().getLength())) { + // have to stop at junction + SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, seen, 0, 0); + if (nspeed < speed) { + if (patchSpeed) { + speed = MIN2(nspeed, speed); + dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); + } else { + // we may not drive with the given velocity - we cannot stop at the junction in time (try again later) + return false; + } + } + break; + } + // get the next used lane (including internal) + nextLane = (*link)->getViaLaneOrLane(); // check how next lane effects the journey if (nextLane != 0) { arrivalTime += TIME2STEPS(nextLane->getLength() / speed); @@ -466,7 +496,7 @@ if (nspeed < speed) { if (patchSpeed) { speed = MIN2(nspeed, speed); - dist = cfModel.brakeGap(speed); + dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); } else { // we may not drive with the given velocity - we crash into the leader return false; @@ -474,65 +504,46 @@ } } // check next lane's maximum velocity - const SUMOReal nspeed = nextLane->getMaxSpeed(); + const SUMOReal nspeed = nextLane->getVehicleMaxSpeed(aVehicle); if (nspeed < speed) { // patch speed if needed if (patchSpeed) { speed = MIN2(cfModel.freeSpeed(aVehicle, speed, seen, nspeed), speed); - dist = cfModel.brakeGap(speed); + 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 given velocity!"); + MSNet::getInstance()->getInsertionControl().descheduleDeparture(aVehicle); return false; } } - // check traffic on next junctions + // check traffic on next junction + // we cannot use (*link)->opened because a vehicle without priority + // may already be comitted to blocking the link and unable to stop const SUMOTime arrivalTime = MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(seen / speed); -#ifdef HAVE_INTERNAL_LANES - const SUMOTime leaveTime = (*link)->getViaLane() == 0 ? arrivalTime + TIME2STEPS((*link)->getLength() * speed) : arrivalTime + TIME2STEPS((*link)->getViaLane()->getLength() * speed); -#else const SUMOTime leaveTime = arrivalTime + TIME2STEPS((*link)->getLength() * speed); -#endif - if ((*link)->hasApproachingFoe(arrivalTime, leaveTime)) { + if ((*link)->hasApproachingFoe(arrivalTime, leaveTime, speed)) { SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, seen, 0, 0); if (nspeed < speed) { if (patchSpeed) { speed = MIN2(nspeed, speed); - dist = cfModel.brakeGap(speed); + dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); } else { - // we may not drive with the given velocity - we crash into the leader - return false; - } - } - } else { - // we can only drive to the end of the current lane... - SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, seen, 0, 0); - if (nspeed < speed) { - if (patchSpeed) { - speed = MIN2(nspeed, speed); - dist = cfModel.brakeGap(speed); - } else { - // we may not drive with the given velocity - we crash into the leader + // we may not drive with the given velocity - we crash at the junction return false; } } } seen += nextLane->getLength(); - ++ce; - ++ri; currentLane = nextLane; - } - } - if (seen < dist) { - SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, seen, 0, 0); - if (nspeed < speed) { - if (patchSpeed) { - speed = MIN2(nspeed, speed); - dist = cfModel.brakeGap(speed); - } else { - // we may not drive with the given velocity - we crash into the leader - WRITE_ERROR("Vehicle '" + aVehicle->getID() + "' will not be able to depart using given velocity!"); - // !!! we probably should do something else... - return false; +#ifdef HAVE_INTERNAL_LANES + if ((*link)->getViaLane() == 0) { +#else + if (true) { +#endif + nRouteSuccs++; + ++ce; + ++ri; } } } @@ -561,19 +572,21 @@ return false; } } else { - // check approaching vehicle (consecutive follower) - SUMOReal lspeed = getMaxSpeed(); - // in order to look back, we'd need the minimum braking ability of vehicles in the net... - // we'll assume it to be 4m/s^2 - // !!!revisit - SUMOReal dist = lspeed * lspeed / (2.*4.) + SPEED2DIST(lspeed); - std::pair approaching = getFollowerOnConsecutive(dist, 0, speed, pos - aVehicle->getVehicleType().getLengthWithGap(), 4.5); - if (approaching.first != 0) { - const MSVehicle* const follower = approaching.first; - SUMOReal backGapNeeded = follower->getCarFollowModel().getSecureGap(follower->getSpeed(), aVehicle->getSpeed(), cfModel.getMaxDecel()); - SUMOReal gap = approaching.second -approaching.first->getVehicleType().getMinGap() - pos - aVehicle->getVehicleType().getLength(); - if (gap < backGapNeeded) { - // too close to the consecutive follower + // check approaching vehicles to prevent rear-end collisions + // to compute an uper bound on the look-back distance we need + // the chosenSpeedFactor, minGap and maxDeceleration of approaching vehicles + // since we do not know these we use the values from the vehicle to be inserted + // and add a safety factor + const SUMOReal dist = 2 * (aVehicle->getCarFollowModel().brakeGap(myMaxSpeed) + aVehicle->getVehicleType().getMinGap()); + const SUMOReal backOffset = pos - aVehicle->getVehicleType().getLength(); + const SUMOReal missingRearGap = getMissingRearGap(dist, backOffset, speed, aVehicle->getCarFollowModel().getMaxDecel()); + if (missingRearGap > 0) { + // too close to a followers + const SUMOReal neededStartPos = pos + missingRearGap; + if (myVehicles.size() == 0 && notification == MSMoveReminder::NOTIFICATION_TELEPORT && neededStartPos <= myLength) { + // shift starting positiong as needed entering from teleport + pos = neededStartPos; + } else { return false; } } @@ -652,27 +665,15 @@ VehCont::iterator lastBeforeEnd = myVehicles.end() - 1; VehCont::iterator veh; // Move all next vehicles beside the first - for (veh = myVehicles.begin(); veh != lastBeforeEnd;) { + for (veh = myVehicles.begin(); veh != lastBeforeEnd; ++veh) { myLeftVehLength -= (*veh)->getVehicleType().getLengthWithGap(); VehCont::const_iterator pred(veh + 1); - if ((*veh)->moveRegardingCritical(t, this, *pred, 0, myLeftVehLength)) { - collisions.push_back(*veh); - } - ++veh; + (*veh)->move(t, this, *pred, 0, myLeftVehLength); } myLeftVehLength -= (*veh)->getVehicleType().getLengthWithGap(); - if ((*veh)->moveRegardingCritical(t, this, 0, 0, myLeftVehLength)) { - collisions.push_back(*veh); - } + (*veh)->move(t, this, 0, 0, myLeftVehLength); assert((*veh)->getPositionOnLane() <= myLength); assert((*veh)->getLane() == this); - // deal with collisions - for (std::vector::iterator i = collisions.begin(); i != collisions.end(); ++i) { - WRITE_WARNING("Teleporting vehicle '" + (*i)->getID() + "'; collision, lane='" + getID() + "', time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); - myVehicleLengthSum -= (*i)->getVehicleType().getLengthWithGap(); - myVehicles.erase(find(myVehicles.begin(), myVehicles.end(), *i)); - MSVehicleTransfer::getInstance()->addVeh(t, *i); - } return myVehicles.size() == 0; } @@ -689,7 +690,10 @@ SUMOReal gap = (*pred)->getPositionOnLane() - (*pred)->getVehicleType().getLength() - (*veh)->getPositionOnLane() - (*veh)->getVehicleType().getMinGap(); if (gap < 0) { MSVehicle* vehV = *veh; - WRITE_WARNING("Teleporting vehicle '" + vehV->getID() + "'; collision, lane='" + getID() + "', time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + WRITE_WARNING("Teleporting vehicle '" + vehV->getID() + "'; collision with '" + + (*pred)->getID() + "', lane='" + getID() + "', gap=" + toString(gap) + + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + MSNet::getInstance()->getVehicleControl().registerCollision(); myVehicleLengthSum -= vehV->getVehicleType().getLengthWithGap(); MSVehicleTransfer::getInstance()->addVeh(timestep, vehV); veh = myVehicles.erase(veh); // remove current vehicle @@ -715,23 +719,23 @@ while (seen < dist && next != veh.getRoute().end() - 1) { ++next; MSLane* nextLane = (*next)->getLanes()[0]; - tspeed = MIN2(cfModel.freeSpeed(&veh, tspeed, seen, nextLane->getMaxSpeed()), nextLane->getMaxSpeed()); + tspeed = MIN2(cfModel.freeSpeed(&veh, tspeed, seen, nextLane->getVehicleMaxSpeed(&veh)), nextLane->getVehicleMaxSpeed(&veh)); dist = SPEED2DIST(tspeed) + cfModel.brakeGap(tspeed); - seen += nextLane->getMaxSpeed(); + seen += nextLane->getLength(); } return tspeed; } bool -MSLane::setCritical(SUMOTime t, std::vector &into) { +MSLane::setCritical(SUMOTime t, std::vector& into) { // move critical vehicles for (VehCont::iterator i = myVehicles.begin(); i != myVehicles.end();) { MSVehicle* veh = *i; bool moved = veh->moveChecked(); MSLane* target = veh->getLane(); SUMOReal length = veh->getVehicleType().getLengthWithGap(); - if (veh->ends()) { + if (veh->hasArrived()) { // vehicle has reached its arrival position veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_ARRIVED); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); @@ -755,6 +759,7 @@ } else if (veh->getPositionOnLane() > getLength()) { // for any reasons the vehicle is beyond its lane... error WRITE_WARNING("Teleporting vehicle '" + veh->getID() + "'; beyond lane (2), targetLane='" + getID() + "', time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + MSNet::getInstance()->getVehicleControl().registerTeleport(); MSVehicleTransfer::getInstance()->addVeh(t, veh); } else { ++i; @@ -771,6 +776,7 @@ myVehicleLengthSum -= veh->getVehicleType().getLengthWithGap(); myVehicles.erase(myVehicles.end() - 1); WRITE_WARNING("Teleporting vehicle '" + veh->getID() + "'; waited too long, lane='" + getID() + "', time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + MSNet::getInstance()->getVehicleControl().registerTeleport(); MSVehicleTransfer::getInstance()->addVeh(t, veh); } } @@ -811,7 +817,7 @@ void -MSLane::insertIDs(std::vector &into) { +MSLane::insertIDs(std::vector& into) { for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) { into.push_back((*i).first); } @@ -874,7 +880,7 @@ MSLinkCont::const_iterator MSLane::succLinkSec(const SUMOVehicle& veh, unsigned int nRouteSuccs, - const MSLane& succLinkSource, const std::vector &conts) const { + const MSLane& succLinkSource, const std::vector& conts) const { const MSEdge* nRouteEdge = veh.succEdge(nRouteSuccs); // check whether the vehicle tried to look beyond its route if (nRouteEdge == 0) { @@ -889,12 +895,12 @@ // at first, we'll assume we have the continuations of our route in "conts" (built in "getBestLanes") // "conts" stores the best continuations of our current lane MSLinkCont::const_iterator link; - if (nRouteSuccs > 0 && conts.size() >= nRouteSuccs && nRouteSuccs > 0) { + if (nRouteSuccs < conts.size()) { // we go through the links in our list and return the matching one - for (link = succLinkSource.myLinks.begin(); link != succLinkSource.myLinks.end() ; ++link) { + for (link = succLinkSource.myLinks.begin(); link != succLinkSource.myLinks.end(); ++link) { if ((*link)->getLane() != 0 && (*link)->getLane()->myEdge == nRouteEdge && (*link)->getLane()->allowsVehicleClass(veh.getVehicleType().getVehicleClass())) { // we should use the link if it connects us to the best lane - if ((*link)->getLane() == conts[nRouteSuccs - 1]) { + if ((*link)->getLane() == conts[nRouteSuccs]) { return link; } } @@ -905,7 +911,7 @@ // we will now collect allowed links, at first // collect allowed links std::vector valid; - for (link = succLinkSource.myLinks.begin(); link != succLinkSource.myLinks.end() ; ++link) { + for (link = succLinkSource.myLinks.begin(); link != succLinkSource.myLinks.end(); ++link) { if ((*link)->getLane() != 0 && (*link)->getLane()->myEdge == nRouteEdge && (*link)->getLane()->allowsVehicleClass(veh.getVehicleType().getVehicleClass())) { valid.push_back(link); } @@ -922,7 +928,7 @@ // if the next edge is the route end, then we may return an arbitary link // also, if there is no allowed lane on the edge following the current one (recheck?) const MSEdge* nRouteEdge2 = veh.succEdge(nRouteSuccs + 1); - const std::vector *next_allowed = nRouteEdge->allowedLanes(*nRouteEdge2, veh.getVehicleType().getVehicleClass()); + const std::vector* next_allowed = nRouteEdge->allowedLanes(*nRouteEdge2, veh.getVehicleType().getVehicleClass()); if (nRouteEdge2 == 0 || next_allowed == 0) { return *(valid.begin()); } @@ -962,7 +968,7 @@ MSVehicle* MSLane::removeVehicle(MSVehicle* remVehicle) { for (MSLane::VehCont::iterator it = myVehicles.begin(); it < myVehicles.end(); it++) { - if (remVehicle->getID() == (*it)->getID()) { + if (remVehicle == *it) { remVehicle->leaveLane(MSMoveReminder::NOTIFICATION_ARRIVED); myVehicles.erase(it); myVehicleLengthSum -= remVehicle->getVehicleType().getLengthWithGap(); @@ -1017,18 +1023,59 @@ if (i == myApproachingLanes.end()) { return false; } - const std::vector &lanes = (*i).second; + const std::vector& lanes = (*i).second; return find(lanes.begin(), lanes.end(), lane) != lanes.end(); } class by_second_sorter { public: - inline int operator()(const std::pair &p1, const std::pair &p2) const { + inline int operator()(const std::pair& p1, const std::pair& p2) const { return p1.second < p2.second; } }; + +SUMOReal MSLane::getMissingRearGap( + SUMOReal dist, SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const { + // this follows the same logic as getFollowerOnConsecutive. we do a tree + // search until dist and check for the vehicle with the largest missing rear gap + SUMOReal result = 0; + std::set visited; + std::vector newFound; + std::vector toExamine = myIncomingLanes; + while (toExamine.size() != 0) { + for (std::vector::iterator i = toExamine.begin(); i != toExamine.end(); ++i) { + MSLane* next = (*i).lane; + if (next->getFirstVehicle() != 0) { + MSVehicle* v = (MSVehicle*) next->getFirstVehicle(); + const SUMOReal agap = (*i).length - v->getPositionOnLane() + backOffset - v->getVehicleType().getMinGap(); + const SUMOReal missingRearGap = v->getCarFollowModel().getSecureGap( + v->getCarFollowModel().maxNextSpeed(v->getSpeed()), leaderSpeed, leaderMaxDecel) - agap; + result = MAX2(result, missingRearGap); + } else { + if ((*i).length < dist) { + const std::vector& followers = next->getIncomingLanes(); + for (std::vector::const_iterator j = followers.begin(); j != followers.end(); ++j) { + if (visited.find((*j).lane) == visited.end()) { + visited.insert((*j).lane); + MSLane::IncomingLaneInfo ili; + ili.lane = (*j).lane; + ili.length = (*j).length + (*i).length; + ili.viaLink = (*j).viaLink; + newFound.push_back(ili); + } + } + } + } + } + toExamine.clear(); + swap(newFound, toExamine); + } + return result; +} + + std::pair MSLane::getFollowerOnConsecutive(SUMOReal dist, SUMOReal seen, SUMOReal leaderSpeed, SUMOReal backOffset, SUMOReal predMaxDecel) const { @@ -1048,13 +1095,13 @@ MSLane* next = (*i).lane; if (next->getFirstVehicle() != 0) { MSVehicle* v = (MSVehicle*) next->getFirstVehicle(); - SUMOReal agap = (*i).length - v->getPositionOnLane() + backOffset; + SUMOReal agap = (*i).length - v->getPositionOnLane() + backOffset - v->getVehicleType().getMinGap(); if (agap <= v->getCarFollowModel().getSecureGap(v->getCarFollowModel().maxNextSpeed(v->getSpeed()), leaderSpeed, predMaxDecel)) { - possible.push_back(std::make_pair(v, (*i).length - v->getPositionOnLane() - v->getVehicleType().getMinGap()+ seen)); + possible.push_back(std::make_pair(v, agap)); } } else { if ((*i).length + seen < dist) { - const std::vector &followers = next->getIncomingLanes(); + const std::vector& followers = next->getIncomingLanes(); for (std::vector::const_iterator j = followers.begin(); j != followers.end(); ++j) { if (visited.find((*j).lane) == visited.end()) { visited.insert((*j).lane); @@ -1072,7 +1119,7 @@ swap(newFound, toExamine); } if (possible.size() == 0) { - return std::pair(static_cast(0), -1); + return std::pair(static_cast(0), -1); } sort(possible.begin(), possible.end(), by_second_sorter()); return *(possible.begin()); @@ -1081,56 +1128,46 @@ std::pair MSLane::getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh, - const std::vector &bestLaneConts) const { + const std::vector& bestLaneConts) const { if (seen > dist) { - return std::pair(static_cast(0), -1); + return std::pair(static_cast(0), -1); } unsigned int view = 1; // loop over following lanes const MSLane* targetLane = this; MSVehicle* leader = targetLane->getPartialOccupator(); if (leader != 0) { - return std::pair(leader, seen - targetLane->getPartialOccupatorEnd()); + return std::pair(leader, seen - targetLane->getPartialOccupatorEnd() - veh.getVehicleType().getMinGap()); } const MSLane* nextLane = targetLane; SUMOTime arrivalTime = MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(seen / speed); - while (true) { + do { // get the next link used MSLinkCont::const_iterator link = targetLane->succLinkSec(veh, view, *nextLane, bestLaneConts); - if (nextLane->isLinkEnd(link) || !(*link)->opened(arrivalTime, speed, veh.getVehicleType().getLength()) || (*link)->getState() == LINKSTATE_TL_RED) { - return std::pair(static_cast(0), -1); + if (nextLane->isLinkEnd(link) || !(*link)->opened(arrivalTime, speed, speed, veh.getVehicleType().getLength()) || (*link)->getState() == LINKSTATE_TL_RED) { + break; } #ifdef HAVE_INTERNAL_LANES - bool nextInternal = false; - nextLane = (*link)->getViaLane(); - if (nextLane == 0) { - nextLane = (*link)->getLane(); - } else { - nextInternal = true; - } -#else - nextLane = (*link)->getLane(); + bool nextInternal = (*link)->getViaLane() != 0; #endif + nextLane = (*link)->getViaLaneOrLane(); if (nextLane == 0) { - return std::pair(static_cast(0), -1); + break; } arrivalTime += TIME2STEPS(nextLane->getLength() / speed); MSVehicle* leader = nextLane->getLastVehicle(); if (leader != 0) { - return std::pair(leader, seen + leader->getPositionOnLane() - leader->getVehicleType().getLength()); + return std::pair(leader, seen + leader->getPositionOnLane() - leader->getVehicleType().getLength() - veh.getVehicleType().getMinGap()); } else { leader = nextLane->getPartialOccupator(); if (leader != 0) { - return std::pair(leader, seen + nextLane->getPartialOccupatorEnd()); + return std::pair(leader, seen + nextLane->getPartialOccupatorEnd() - veh.getVehicleType().getMinGap()); } } - if (nextLane->getMaxSpeed() < speed) { - dist = veh.getCarFollowModel().brakeGap(nextLane->getMaxSpeed()); + if (nextLane->getVehicleMaxSpeed(&veh) < speed) { + dist = veh.getCarFollowModel().brakeGap(nextLane->getVehicleMaxSpeed(&veh)); } seen += nextLane->getLength(); - if (seen > dist) { - return std::pair(static_cast(0), -1); - } #ifdef HAVE_INTERNAL_LANES if (!nextInternal) { view++; @@ -1138,7 +1175,8 @@ #else view++; #endif - } + } while (seen <= dist); + return std::pair(static_cast(0), -1); } @@ -1306,18 +1344,18 @@ } -int +int MSLane::vehicle_position_sorter::operator()(MSVehicle* v1, MSVehicle* v2) const { return v1->getPositionOnLane() > v2->getPositionOnLane(); } -MSLane::by_connections_to_sorter::by_connections_to_sorter(const MSEdge* const e) : - myEdge(e), - myLaneDir(e->getLanes()[0]->getShape().getBegLine().atan2PositiveAngle()) +MSLane::by_connections_to_sorter::by_connections_to_sorter(const MSEdge* const e) : + myEdge(e), + myLaneDir(e->getLanes()[0]->getShape().getBegLine().atan2PositiveAngle()) { } -int +int MSLane::by_connections_to_sorter::operator()(const MSEdge* const e1, const MSEdge* const e2) const { const std::vector* ae1 = e1->allowedLanes(*myEdge); const std::vector* ae2 = e2->allowedLanes(*myEdge); diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLane.h sumo-0.16.0~dfsg/src/microsim/MSLane.h --- sumo-0.15.0~dfsg/src/microsim/MSLane.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLane.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,8 +6,9 @@ /// @author Christoph Sommer /// @author Tino Morenz /// @author Michael Behrisch +/// @author Mario Krumnow /// @date Mon, 12 Mar 2001 -/// @version $Id: MSLane.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: MSLane.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a lane in the micro simulation /****************************************************************************/ @@ -39,7 +40,9 @@ #include #include #include +#include #include +#include #include #include "MSLinkCont.h" #include "MSMoveReminder.h" @@ -67,15 +70,18 @@ * Class which represents a single lane. Somekind of the main class of the * simulation. Allows moving vehicles. */ -class MSLane : public Named { +class MSLane : public Named, public Parameterised { public: - /// needs access to myTmpVehicles (this maybe should be done via SUMOReal-buffering!!!) + /// needs access to myTmpVehicles (this maybe should be done via double-buffering!!!) friend class MSLaneChanger; friend class GUILaneWrapper; friend class MSXMLRawOut; + friend class MSQueueExport; + + /** Function-object in order to find the vehicle, that has just passed the detector. */ struct VehPosition : public std::binary_function < const MSVehicle*, SUMOReal, bool > { @@ -102,23 +108,13 @@ /// @brief Destructor - virtual ~MSLane() ; + virtual ~MSLane(); /// @name Additional initialisation /// @{ - /** @brief Delayed initialization (deprecated) - * - * Not all lane-members are known at the time the lane is born, above all the pointers - * to other lanes, so we have to initialize later. - * - * @param[in] succs The list of (outgoing) links - * @todo Why are succs not const? - */ - void initialize(MSLinkCont* succs); - /** @brief Delayed initialization * * Not all lane-members are known at the time the lane is born, above all the pointers @@ -140,13 +136,13 @@ * * @param[in] rem The move reminder to add */ - virtual void addMoveReminder(MSMoveReminder* rem) ; + virtual void addMoveReminder(MSMoveReminder* rem); /** @brief Return the list of this lane's move reminders * @return Previously added move reminder */ - inline const std::vector< MSMoveReminder* > &getMoveReminders() const { + inline const std::vector< MSMoveReminder* >& getMoveReminders() const { return myMoveReminders; } ///@} @@ -171,7 +167,7 @@ * @see MSVehicle::getDepartureDefinition * @see MSVehicle::DepartArrivalDefinition */ - bool insertVehicle(MSVehicle& v) ; + bool insertVehicle(MSVehicle& v); /** @brief Tries to insert the given vehicle with the given state (speed and pos) @@ -193,11 +189,11 @@ */ virtual bool isInsertionSuccess(MSVehicle* vehicle, SUMOReal speed, SUMOReal pos, bool recheckNextLanes, - MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ; + MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); - bool pWagGenericInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos) ; - bool pWagSimpleInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos) ; - bool maxSpeedGapInsertion(MSVehicle& veh, SUMOReal mspeed) ; + bool pWagGenericInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos); + bool pWagSimpleInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos); + bool maxSpeedGapInsertion(MSVehicle& veh, SUMOReal mspeed); /** @brief Tries to insert the given vehicle on any place * @@ -207,7 +203,7 @@ * @return Whether the vehicle could be inserted */ bool freeInsertion(MSVehicle& veh, SUMOReal speed, - MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ; + MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); /** @brief Inserts the given vehicle at the given position @@ -217,7 +213,7 @@ * @param[in] veh The vehicle to insert * @param[in] pos The position at which the vehicle shall be inserted */ - void forceVehicleInsertion(MSVehicle* veh, SUMOReal pos) ; + void forceVehicleInsertion(MSVehicle* veh, SUMOReal pos); /// @} @@ -236,13 +232,13 @@ * @param[in] leftVehicleLength The distance the vehicle laps into this lane * @return This lane's length */ - SUMOReal setPartialOccupation(MSVehicle* v, SUMOReal leftVehicleLength) ; + SUMOReal setPartialOccupation(MSVehicle* v, SUMOReal leftVehicleLength); /** @brief Removes the information about a vehicle lapping into this lane * @param[in] v The vehicle which laps into this lane */ - void resetPartialOccupation(MSVehicle* v) ; + void resetPartialOccupation(MSVehicle* v); /** @brief Returns the vehicle which laps into this lane @@ -269,7 +265,7 @@ * returned member is 0. * @return Information about the last vehicle and it's back position */ - std::pair getLastVehicleInformation() const ; + std::pair getLastVehicleInformation() const; /// @} @@ -291,7 +287,7 @@ * afterwards using "releaseVehicles". * @return The vehicles on this lane */ - virtual const std::deque< MSVehicle* > &getVehiclesSecure() const { + virtual const std::deque< MSVehicle* >& getVehiclesSecure() const { return myVehicles; } @@ -322,11 +318,31 @@ return myShape; } + /* @brief fit the given lane position to a visibly suitable geometry position + * (lane length might differ from geomety length */ + inline SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const { + return lanePos * myLengthGeometryFactor; + } - /** @brief Returns the lane's maximum speed - * @return This lane's maximum speed + /* @brief fit the given geomtry position to a valid lane position + * (lane length might differ from geomety length */ + inline SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const { + return geometryPos / myLengthGeometryFactor; + } + + /** @brief Returns the lane's maximum speed, given a vehicle's speed limit adaptation + * @param[in] The vehicle to return the adapted speed limit for + * @return This lane's resulting max. speed + */ + SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const { + return myMaxSpeed * veh->getChosenSpeedFactor(); + } + + + /** @brief Returns the lane's maximum allowed speed + * @return This lane's maximum allowed speed */ - SUMOReal getMaxSpeed() const { + SUMOReal getSpeedLimit() const { return myMaxSpeed; } @@ -342,7 +358,7 @@ /** @brief Returns the vehicle class permissions for this lane * @return This lane's allowed vehicle classes */ - inline SVCPermissions getPermissions() { + inline SVCPermissions getPermissions() const { return myPermissions; } @@ -364,7 +380,7 @@ /** Moves the critical vehicles This step is done after the responds have been set */ - virtual bool setCritical(SUMOTime t, std::vector &into); + virtual bool setCritical(SUMOTime t, std::vector& into); /// Insert buffered vehicle into the real lane. virtual bool integrateNewVehicle(SUMOTime t); @@ -423,7 +439,7 @@ return myDict.size(); } - static void insertIDs(std::vector &into) ; + static void insertIDs(std::vector& into); /// Container for vehicles. typedef std::deque< MSVehicle* > VehCont; @@ -435,7 +451,7 @@ virtual MSLinkCont::const_iterator succLinkSec(const SUMOVehicle& veh, unsigned int nRouteSuccs, const MSLane& succLinkSource, - const std::vector &conts) const; + const std::vector& conts) const; /** Returns the information whether the given link shows at the end @@ -488,7 +504,7 @@ MSLink* viaLink; }; - const std::vector &getIncomingLanes() const { + const std::vector& getIncomingLanes() const { return myIncomingLanes; } @@ -503,6 +519,11 @@ SUMOReal leaderSpeed, SUMOReal backOffset, SUMOReal predMaxDecel) const; + /// @brief return by how much further the leader must be inserted to avoid rear end collisions + SUMOReal getMissingRearGap(SUMOReal dist, SUMOReal backOffset, + SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const; + + /** @brief Returns the leader and the distance to him * * Goes along the vehicle's estimated used lanes (bestLaneConts). For each link, @@ -526,10 +547,10 @@ * @return */ std::pair getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen, - SUMOReal speed, const MSVehicle& veh, const std::vector &bestLaneConts) const ; + SUMOReal speed, const MSVehicle& veh, const std::vector& bestLaneConts) const; - MSLane* getLogicalPredecessorLane() const ; + MSLane* getLogicalPredecessorLane() const; /// @name Current state retrieval @@ -538,61 +559,61 @@ /** @brief Returns the mean speed on this lane * @return The average speed of vehicles during the last step; default speed if no vehicle was on this lane */ - SUMOReal getMeanSpeed() const ; + SUMOReal getMeanSpeed() const; /** @brief Returns the occupancy of this lane during the last step * @return The occupancy during the last step */ - SUMOReal getOccupancy() const ; + SUMOReal getOccupancy() const; /** @brief Returns the sum of lengths of vehicles which were on the lane during the last step * @return The sum of vehicle lengths of vehicles in the last step */ - SUMOReal getVehLenSum() const ; + SUMOReal getVehLenSum() const; /** @brief Returns the sum of last step CO2 emissions * @return CO2 emissions of vehicles on this lane during the last step */ - SUMOReal getHBEFA_CO2Emissions() const ; + SUMOReal getHBEFA_CO2Emissions() const; /** @brief Returns the sum of last step CO emissions * @return CO emissions of vehicles on this lane during the last step */ - SUMOReal getHBEFA_COEmissions() const ; + SUMOReal getHBEFA_COEmissions() const; /** @brief Returns the sum of last step PMx emissions * @return PMx emissions of vehicles on this lane during the last step */ - SUMOReal getHBEFA_PMxEmissions() const ; + SUMOReal getHBEFA_PMxEmissions() const; /** @brief Returns the sum of last step NOx emissions * @return NOx emissions of vehicles on this lane during the last step */ - SUMOReal getHBEFA_NOxEmissions() const ; + SUMOReal getHBEFA_NOxEmissions() const; /** @brief Returns the sum of last step HC emissions * @return HC emissions of vehicles on this lane during the last step */ - SUMOReal getHBEFA_HCEmissions() const ; + SUMOReal getHBEFA_HCEmissions() const; /** @brief Returns the sum of last step fuel consumption * @return fuel consumption of vehicles on this lane during the last step */ - SUMOReal getHBEFA_FuelConsumption() const ; + SUMOReal getHBEFA_FuelConsumption() const; /** @brief Returns the sum of last step noise emissions * @return noise emissions of vehicles on this lane during the last step */ - SUMOReal getHarmonoise_NoiseEmissions() const ; + SUMOReal getHarmonoise_NoiseEmissions() const; /// @} @@ -612,7 +633,7 @@ */ virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator& at, - MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ; + MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); protected: @@ -677,7 +698,8 @@ std::map > myApproachingLanes; - + // precomputed myShape.length / myLength + const SUMOReal myLengthGeometryFactor; /// definition of the tatic dictionary type typedef std::map< std::string, MSLane* > DictType; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLaneChanger.cpp sumo-0.16.0~dfsg/src/microsim/MSLaneChanger.cpp --- sumo-0.15.0~dfsg/src/microsim/MSLaneChanger.cpp 2012-02-15 00:02:44.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLaneChanger.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Fri, 01 Feb 2002 -/// @version $Id: MSLaneChanger.cpp 11889 2012-02-14 12:28:58Z dkrajzew $ +/// @version $Id: MSLaneChanger.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Performs lane changing of vehicles /****************************************************************************/ @@ -137,7 +137,7 @@ int bla = 0; } #endif - const std::vector &preb = vehicle->getBestLanes(); + const std::vector& preb = vehicle->getBestLanes(); assert(preb.size() == myChanger.size()); for (int i = 0; i < (int) myChanger.size(); ++i) { ((std::vector&) preb)[i].occupation = myChanger[i].dens + preb[i].nextOccupation; @@ -223,16 +223,13 @@ if (myAllowsSwap && ((state1 & (LCA_URGENT)) != 0 || (state2 & (LCA_URGENT)) != 0)) { // get the direction ... ChangerIt target; - int dir; if ((state1 & (LCA_URGENT)) != 0) { // ... wants to go right target = myCandi - 1; - dir = -1; } if ((state2 & (LCA_URGENT)) != 0) { // ... wants to go left target = myCandi + 1; - dir = 1; } MSVehicle* prohibitor = target->lead; if (target->hoppedVeh != 0) { @@ -309,7 +306,7 @@ if (predP != 0) { return std::pair(predP, targetLane->getPartialOccupatorEnd() - veh(myCandi)->getPositionOnLane()); } - const std::vector &bestLaneConts = veh(myCandi)->getBestLanesContinuation(); + const std::vector& bestLaneConts = veh(myCandi)->getBestLanesContinuation(); MSLinkCont::const_iterator link = targetLane->succLinkSec(*veh(myCandi), 1, *targetLane, bestLaneConts); if (targetLane->isLinkEnd(link)) { return std::pair(static_cast(0), -1); @@ -326,11 +323,11 @@ leader->getPositionOnLane() - leader->getVehicleType().getLength() + (myCandi->lane->getLength() - veh(myCandi)->getPositionOnLane() - veh(myCandi)->getVehicleType().getMinGap()); // !!! recheck - return std::pair(leader, MAX2((SUMOReal) 0, gap)); + return std::pair(leader, MAX2((SUMOReal) 0, gap)); } else { MSVehicle* candi = veh(myCandi); SUMOReal gap = leader->getPositionOnLane() - leader->getVehicleType().getLength() - candi->getPositionOnLane() - candi->getVehicleType().getMinGap(); - return std::pair(leader, MAX2((SUMOReal) 0, gap)); + return std::pair(leader, MAX2((SUMOReal) 0, gap)); } } @@ -352,17 +349,17 @@ if (predP != 0) { return std::pair(predP, targetLane->getPartialOccupatorEnd() - veh(myCandi)->getPositionOnLane() - veh(myCandi)->getVehicleType().getMinGap()); } - const std::vector &bestLaneConts = veh(myCandi)->getBestLanesContinuation(myCandi->lane); + const std::vector& bestLaneConts = veh(myCandi)->getBestLanesContinuation(myCandi->lane); SUMOReal seen = myCandi->lane->getLength() - veh(myCandi)->getPositionOnLane(); SUMOReal speed = veh(myCandi)->getSpeed(); - SUMOReal dist = veh(myCandi)->getCarFollowModel().brakeGap(speed); + SUMOReal dist = veh(myCandi)->getCarFollowModel().brakeGap(speed) + veh(myCandi)->getVehicleType().getMinGap(); if (seen > dist) { - return std::pair(static_cast(0), -1); + return std::pair(static_cast(0), -1); } return target->lane->getLeaderOnConsecutive(dist, seen, speed, *veh(myCandi), bestLaneConts); } else { MSVehicle* candi = veh(myCandi); - return std::pair(neighLead, neighLead->getPositionOnLane() - neighLead->getVehicleType().getLength() - candi->getPositionOnLane() - candi->getVehicleType().getMinGap()); + return std::pair(neighLead, neighLead->getPositionOnLane() - neighLead->getVehicleType().getLength() - candi->getPositionOnLane() - candi->getVehicleType().getMinGap()); } } @@ -378,7 +375,7 @@ } } if (neighFollow == 0) { - SUMOReal speed = target->lane->getMaxSpeed(); + SUMOReal speed = target->lane->getSpeedLimit(); // in order to look back, we'd need the minimum braking ability of vehicles in the net... // we'll assume it to be 4m/s^2 // !!!revisit @@ -389,7 +386,7 @@ return target->lane->getFollowerOnConsecutive(dist, seen, candi->getSpeed(), candi->getPositionOnLane() - candi->getVehicleType().getLength(), 4.5);//!!! recheck } else { MSVehicle* candi = veh(myCandi); - return std::pair(neighFollow, candi->getPositionOnLane() - candi->getVehicleType().getLength() - neighFollow->getPositionOnLane() - neighFollow->getVehicleType().getMinGap()); + return std::pair(neighFollow, candi->getPositionOnLane() - candi->getVehicleType().getLength() - neighFollow->getPositionOnLane() - neighFollow->getVehicleType().getMinGap()); } } @@ -416,7 +413,7 @@ if (myCandi->veh + 1 == myCandi->lane->myVehicles.rend()) { myCandi->follow = 0; } else { - myCandi->follow = *(myCandi->veh + 1) ; + myCandi->follow = *(myCandi->veh + 1); } return; } @@ -466,10 +463,10 @@ int -MSLaneChanger::change2right(const std::pair &leader, - const std::pair &rLead, - const std::pair &rFollow, - const std::vector &preb) const { +MSLaneChanger::change2right(const std::pair& leader, + const std::pair& rLead, + const std::pair& rFollow, + const std::vector& preb) const { ChangerIt target = myCandi - 1; int blocked = overlapWithHopped(target) ? target->hoppedVeh->getPositionOnLane() < veh(myCandi)->getPositionOnLane() @@ -506,10 +503,10 @@ int -MSLaneChanger::change2left(const std::pair &leader, - const std::pair &rLead, - const std::pair &rFollow, - const std::vector &preb) const { +MSLaneChanger::change2left(const std::pair& leader, + const std::pair& rLead, + const std::pair& rFollow, + const std::vector& preb) const { ChangerIt target = myCandi + 1; int blocked = overlapWithHopped(target) ? target->hoppedVeh->getPositionOnLane() < veh(myCandi)->getPositionOnLane() diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLaneChanger.h sumo-0.16.0~dfsg/src/microsim/MSLaneChanger.h --- sumo-0.15.0~dfsg/src/microsim/MSLaneChanger.h 2012-02-16 15:57:40.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLaneChanger.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 01 Feb 2002 -/// @version $Id: MSLaneChanger.h 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSLaneChanger.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Performs lane changing of vehicles /****************************************************************************/ @@ -140,16 +140,16 @@ ChangerIt findCandidate(); int change2right( - const std::pair &leader, - const std::pair &rLead, - const std::pair &rFollow, - const std::vector &preb) const ; + const std::pair& leader, + const std::pair& rLead, + const std::pair& rFollow, + const std::vector& preb) const; int change2left( - const std::pair &leader, - const std::pair &rLead, - const std::pair &rFollow, - const std::vector &preb) const ; + const std::pair& leader, + const std::pair& rLead, + const std::pair& rFollow, + const std::vector& preb) const; @@ -165,11 +165,11 @@ return false; } - std::pair getRealThisLeader(const ChangerIt& target) const ; + std::pair getRealThisLeader(const ChangerIt& target) const; - std::pair getRealFollower(const ChangerIt& target) const ; + std::pair getRealFollower(const ChangerIt& target) const; - std::pair getRealLeader(const ChangerIt& target) const ; + std::pair getRealLeader(const ChangerIt& target) const; protected: /// Container for ChangeElemements, one for every lane in the edge. diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLink.cpp sumo-0.16.0~dfsg/src/microsim/MSLink.cpp --- sumo-0.15.0~dfsg/src/microsim/MSLink.cpp 2012-03-08 00:03:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLink.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: MSLink.cpp 12033 2012-03-07 10:59:40Z dkrajzew $ +/// @version $Id: MSLink.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A connnection between lanes /****************************************************************************/ @@ -31,7 +31,6 @@ #endif #include -#include #include "MSLink.h" #include "MSLane.h" #include "MSGlobals.h" @@ -75,8 +74,8 @@ void MSLink::setRequestInformation(unsigned int requestIdx, unsigned int respondIdx, bool isCrossing, bool isCont, - const std::vector &foeLinks, - const std::vector &foeLanes) { + const std::vector& foeLinks, + const std::vector& foeLanes) { myRequestIdx = requestIdx; myRespondIdx = respondIdx; myIsCrossing = isCrossing; @@ -126,28 +125,23 @@ bool -MSLink::opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal vehicleLength) const { +MSLink::opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength) const { if (myState == LINKSTATE_TL_RED) { return false; } if (myAmCont) { return true; } -#ifdef HAVE_INTERNAL_LANES - const SUMOReal length = myJunctionInlane == 0 ? getLength() : myJunctionInlane->getLength(); -#else - const SUMOReal length = getLength(); -#endif - const SUMOTime leaveTime = arrivalTime + TIME2STEPS((length + vehicleLength) / arrivalSpeed); + const SUMOTime leaveTime = arrivalTime + TIME2STEPS((getLength() + vehicleLength) / (0.5 * (arrivalSpeed + leaveSpeed))); for (std::vector::const_iterator i = myFoeLinks.begin(); i != myFoeLinks.end(); ++i) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { if ((*i)->getState() == LINKSTATE_TL_RED) { continue; } } #endif - if ((*i)->blockedAtTime(arrivalTime, leaveTime)) { + if ((*i)->blockedAtTime(arrivalTime, leaveTime, leaveSpeed)) { return false; } } @@ -161,12 +155,23 @@ bool -MSLink::blockedAtTime(SUMOTime arrivalTime, SUMOTime leaveTime) const { +MSLink::blockedAtTime(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed) const { for (LinkApproachingVehicles::const_iterator i = myApproachingVehicles.begin(); i != myApproachingVehicles.end(); ++i) { if (!(*i).willPass) { continue; } - if (!(((*i).leavingTime + myLookaheadTime < arrivalTime) || ((*i).arrivalTime - myLookaheadTime > leaveTime))) { + if ((*i).leavingTime < arrivalTime) { + // ego wants to be follower + if ((*i).leavingTime + safeHeadwayTime(i->vehicle->getSpeed(), speed) >= arrivalTime) { + return true; + } + } else if ((*i).arrivalTime > leaveTime) { + // ego wants to be leader + if ((*i).arrivalTime - safeHeadwayTime(speed, i->vehicle->getSpeed()) <= leaveTime) { + return true; + } + } else { + // even without considering safeHeadwayTime there is already a conflict return true; } } @@ -174,10 +179,36 @@ } +SUMOTime +MSLink::safeHeadwayTime(SUMOReal leaderSpeed, SUMOReal followerSpeed) { + // v: leader speed + // u: follower speed + // a: leader decel + // b: follower decel + // g: follower min gap + // h: save headway time (result) + const SUMOReal v = leaderSpeed; + const SUMOReal u = followerSpeed; + // XXX use cfmodel values of possible + const SUMOReal a = DEFAULT_VEH_DECEL; + const SUMOReal b = DEFAULT_VEH_DECEL; + const SUMOReal g = DEFAULT_VEH_MINGAP; + // breaking distance ~ (v^2 - a*v)/(2*a) + if (v < a) { + // leader may break in one timestep (need different formula) + // u*h > g + (u^2 - b*u)/(2*b) + 0.5 + return TIME2STEPS((g + 0.5) / u + (u / b - 1.0) * 0.5); + } else { + // u*h + (v^2 - a*v)/(2*a) > g + (u^2 - b*u)/(2*b) + 0.5 + return TIME2STEPS((g + (1.0 + v - v * v / a) * 0.5) / u + (u / b - 1.0) * 0.5); + } +} + + bool -MSLink::hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime) const { +MSLink::hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed) const { for (std::vector::const_iterator i = myFoeLinks.begin(); i != myFoeLinks.end(); ++i) { - if ((*i)->blockedAtTime(arrivalTime, leaveTime)) { + if ((*i)->blockedAtTime(arrivalTime, leaveTime, speed)) { return true; } } @@ -216,6 +247,20 @@ #endif +MSLane* +MSLink::getViaLaneOrLane() const { +#ifdef HAVE_INTERNAL_LANES + if (myJunctionInlane != 0) { + return myJunctionInlane; + } else { + return myLane; + } +#else + return myLane; +#endif +} + + unsigned int MSLink::getRespondIndex() const { return myRespondIdx; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLink.h sumo-0.16.0~dfsg/src/microsim/MSLink.h --- sumo-0.15.0~dfsg/src/microsim/MSLink.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLink.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSLink.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSLink.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A connnection between lanes /****************************************************************************/ @@ -70,6 +70,25 @@ */ class MSLink { public: + /** @struct ApproachingVehicleInformation + * @brief A structure holding the information about vehicles approaching a link + */ + struct ApproachingVehicleInformation { + /// @brief Constructor + ApproachingVehicleInformation(const SUMOTime _arrivalTime, const SUMOTime _leavingTime, SUMOVehicle* _vehicle, const bool _willPass) + : arrivalTime(_arrivalTime), leavingTime(_leavingTime), vehicle(_vehicle), willPass(_willPass) {} + + /// @brief The time the vehicle's front arrives at the link + SUMOTime arrivalTime; + /// @brief The estimated time at which the vehicle leaves the link + SUMOTime leavingTime; + /// @brief The vehicle + SUMOVehicle* vehicle; + /// @brief Whether the vehicle wants to pass the link (@todo: check semantics) + bool willPass; + }; + + #ifndef HAVE_INTERNAL_LANES /** @brief Constructor for simulation not using internal lanes * @@ -78,8 +97,7 @@ * @param[in] state The state of this link * @param[in] length The length of this link */ - MSLink(MSLane* succLane, - LinkDirection dir, LinkState state, SUMOReal length) ; + MSLink(MSLane* succLane, LinkDirection dir, LinkState state, SUMOReal length); #else /** @brief Constructor for simulation which uses internal lanes * @@ -89,13 +107,12 @@ * @param[in] state The state of this link * @param[in] length The length of this link */ - MSLink(MSLane* succLane, MSLane* via, - LinkDirection dir, LinkState state, - SUMOReal length) ; + MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state, SUMOReal length); #endif + /// @brief Destructor - ~MSLink() ; + ~MSLink(); /** @brief Sets the request information @@ -103,30 +120,28 @@ * Because traffic lights and junction logics are loaded after links, * we have to assign the information about the right-of-way * requests and responses after the initialisation. - * - * @param[in] requestIdx This link's index within this request - * @param[in] respondIdx This link's index within this respond - * @param[in] foes This link's foes * @todo Unsecure! */ void setRequestInformation(unsigned int requestIdx, unsigned int respondIdx, bool isCrossing, bool isCont, - const std::vector &foeLinks, const std::vector &foeLanes) ; + const std::vector& foeLinks, const std::vector& foeLanes); /** @brief Sets the information about an approaching vehicle * * The information is stored in myApproachingVehicles. - * - * @param[in] approaching The approaching vehicle */ - void setApproaching(SUMOVehicle* approaching, SUMOTime arrivalTime, SUMOReal speed, bool setRequest) ; + void setApproaching(SUMOVehicle* approaching, SUMOTime arrivalTime, SUMOReal speed, bool setRequest); - void addBlockedLink(MSLink* link) ; + void addBlockedLink(MSLink* link); + - void removeApproaching(SUMOVehicle* veh); + void removeApproaching(SUMOVehicle* veh); + const std::vector& getApproaching() const { + return myApproachingVehicles; + } /** @brief Returns the information whether the link may be passed @@ -135,24 +150,34 @@ * * @return Whether this link may be passed. */ - bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal vehicleLength) const ; + bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength) const; + + /** @brief Returns the information whether this link is blocked + * Valid after the vehicles have set their requests + * @param[in] arrivalTime The arrivalTime of the vehicle who checks for an approaching foe + * @param[in] leaveTime The leaveTime of the vehicle who checks for an approaching foe + * @param[in] speed The speed with which the checking vehicle plans to leave the link + * @return Whether this link is blocked + */ + bool blockedAtTime(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed) const; - bool blockedAtTime(SUMOTime arrivalTime, SUMOTime leaveTime) const ; bool isBlockingAnyone() const { return myApproachingVehicles.size() != 0; } - bool willHaveBlockedFoe() const ; + bool willHaveBlockedFoe() const; /** @brief Returns the information whether a vehicle is approaching on one of the link's foe streams * * Valid after the vehicles have set their requests - * + * @param[in] arrivalTime The arrivalTime of the vehicle who checks for an approaching foe + * @param[in] leaveTime The leaveTime of the vehicle who checks for an approaching foe + * @param[in] speed The speed with which the checking vehicle plans to leave the link * @return Whether a foe of this link is approaching */ - bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime) const ; + bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed) const; /** @brief Returns the current state of the link @@ -168,28 +193,28 @@ * * @return The direction of this link */ - LinkDirection getDirection() const ; + LinkDirection getDirection() const; /** @brief Sets the current tl-state * * @param[in] state The current state of the link */ - void setTLState(LinkState state, SUMOTime t) ; + void setTLState(LinkState state, SUMOTime t); /** @brief Returns the connected lane * * @return The lane approached by this link */ - MSLane* getLane() const ; + MSLane* getLane() const; /** @brief Returns the respond index (for visualization) * * @return The respond index for this link */ - unsigned int getRespondIndex() const ; + unsigned int getRespondIndex() const; /** @brief Returns whether this link is a major link @@ -226,19 +251,13 @@ * * @return The inner lane to use to cross the junction */ - MSLane* getViaLane() const ; + MSLane* getViaLane() const; #endif -private: - struct ApproachingVehicleInformation { - ApproachingVehicleInformation(const SUMOTime _arrivalTime, const SUMOTime _leavingTime, SUMOVehicle* _vehicle, const bool _willPass) - : arrivalTime(_arrivalTime), leavingTime(_leavingTime), vehicle(_vehicle), willPass(_willPass) {} - SUMOTime arrivalTime; - SUMOTime leavingTime; - SUMOVehicle* vehicle; - bool willPass; - }; + /// @brief return the via lane if it exists and the lane otherwise + MSLane* getViaLaneOrLane() const; +private: typedef std::vector LinkApproachingVehicles; class vehicle_in_request_finder { @@ -254,6 +273,8 @@ }; + static SUMOTime safeHeadwayTime(SUMOReal leaderSpeed, SUMOReal followerSpeed); + private: /// @brief The lane approached by this link diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLinkCont.cpp sumo-0.16.0~dfsg/src/microsim/MSLinkCont.cpp --- sumo-0.15.0~dfsg/src/microsim/MSLinkCont.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLinkCont.cpp 2012-10-11 23:02:41.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MSLinkCont.cpp /// @author Daniel Krajzewicz /// @date 15 Feb 2004 -/// @version $Id: MSLinkCont.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSLinkCont.cpp 12830 2012-10-11 13:44:57Z namdre $ /// // Helpers for link vector /****************************************************************************/ @@ -42,13 +42,17 @@ #ifdef HAVE_INTERNAL_LANES const MSEdge* MSLinkContHelper::getInternalFollowingEdge(MSLane* fromLane, - MSEdge* followerAfterInternal) { + const MSEdge* followerAfterInternal) { //@todo to be optimized const MSLinkCont& lc = fromLane->getLinkCont(); for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); j++) { MSLink* link = *j; if (&link->getLane()->getEdge() == followerAfterInternal) { - return &link->getViaLane()->getEdge(); + if (link->getViaLane() != 0) { + return &link->getViaLane()->getEdge(); + } else { + return 0; // network without internal links + } } } return 0; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLinkCont.h sumo-0.16.0~dfsg/src/microsim/MSLinkCont.h --- sumo-0.15.0~dfsg/src/microsim/MSLinkCont.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLinkCont.h 2012-10-05 23:02:19.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MSLinkCont.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: MSLinkCont.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSLinkCont.h 12791 2012-10-05 13:32:47Z namdre $ /// // A vector of links /****************************************************************************/ @@ -61,7 +61,7 @@ /** @brief Returns the internal lane that must be passed in order to get to the desired edge Returns 0 if no such edge exists */ static const MSEdge* getInternalFollowingEdge(MSLane* fromLane, - MSEdge* followerAfterInternal); + const MSEdge* followerAfterInternal); #endif /** @brief Returns the link connecting both lanes diff -Nru sumo-0.15.0~dfsg/src/microsim/MSLogicJunction.h sumo-0.16.0~dfsg/src/microsim/MSLogicJunction.h --- sumo-0.15.0~dfsg/src/microsim/MSLogicJunction.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSLogicJunction.h 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSLogicJunction.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSLogicJunction.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // with one ore more logics. /****************************************************************************/ @@ -69,7 +69,7 @@ typedef std::bitset<64> InnerState; /// initialises the junction after the whole net has been loaded - virtual void postloadInit() ; + virtual void postloadInit(); protected: /** @brief Constructor @@ -85,7 +85,7 @@ #ifdef HAVE_INTERNAL_LANES , std::vector internal #endif - ) ; + ); protected: /// list of incoming lanes diff -Nru sumo-0.15.0~dfsg/src/microsim/MSMoveReminder.cpp sumo-0.16.0~dfsg/src/microsim/MSMoveReminder.cpp --- sumo-0.15.0~dfsg/src/microsim/MSMoveReminder.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSMoveReminder.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2008-10-27 -/// @version $Id: MSMoveReminder.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSMoveReminder.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Something on a lane to be noticed about vehicle movement /****************************************************************************/ @@ -29,7 +29,6 @@ #endif #include -#include #include "MSLane.h" #include "MSMoveReminder.h" @@ -46,21 +45,44 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL void MSMoveReminder::updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime) { + // each vehicle is tracked linearly across its segment. For each vehicle, + // the time and position of the previous call are maintained and only + // the increments are sent to notifyMoveInternal + if (entryTime > currentTime) { + return; // calibrator may insert vehicles a tiny bit into the future; ignore those + } std::map >::iterator j = myLastVehicleUpdateValues.find(&veh); if (j != myLastVehicleUpdateValues.end()) { // the vehicle already has reported its values before; use these - entryTime = (*j).second.first; - entryPos = (*j).second.second; + // however, if this was called from prepareDetectorForWriting the time + // only has a resolution of DELTA_T and might be invalid + const SUMOTime previousEntryTime = j->second.first; + if (previousEntryTime <= currentTime) { + entryTime = previousEntryTime; + entryPos = j->second.second; + } myLastVehicleUpdateValues.erase(j); } - const SUMOReal timeOnLane = STEPS2TIME(currentTime - entryTime); - const SUMOReal speed = (leavePos - entryPos) / STEPS2TIME(leaveTime - entryTime); - myLastVehicleUpdateValues[&veh] = std::pair(currentTime, entryPos + speed * timeOnLane); - notifyMoveInternal(veh, timeOnLane, speed); + assert(entryTime <= currentTime); + if ((entryTime < leaveTime) && (entryPos < leavePos)) { + const SUMOReal timeOnLane = STEPS2TIME(currentTime - entryTime); + const SUMOReal speed = (leavePos - entryPos) / STEPS2TIME(leaveTime - entryTime); + myLastVehicleUpdateValues[&veh] = std::pair(currentTime, entryPos + speed * timeOnLane); + assert(timeOnLane >= 0); + assert(speed >= 0); + notifyMoveInternal(veh, timeOnLane, speed); + } else { + // it would be natrual to + // assert(entryTime == leaveTime); + // assert(entryPos == leavePos); + // However, in the presence of calibrators, vehicles may jump a bit + myLastVehicleUpdateValues[&veh] = std::pair(leaveTime, leavePos); + } + } #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSMoveReminder.h sumo-0.16.0~dfsg/src/microsim/MSMoveReminder.h --- sumo-0.15.0~dfsg/src/microsim/MSMoveReminder.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSMoveReminder.h 2012-09-25 22:01:39.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2003-05-21 -/// @version $Id: MSMoveReminder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSMoveReminder.h 12167 2012-03-23 08:37:12Z behrisch $ /// // Something on a lane to be noticed about vehicle movement /****************************************************************************/ @@ -72,7 +72,7 @@ * @param[in] lane Lane on which the reminder will work. * @param[in] doAdd whether to add the reminder to the lane */ - MSMoveReminder(MSLane* const lane = 0, const bool doAdd = true) ; + MSMoveReminder(MSLane* const lane = 0, const bool doAdd = true); /** @brief Destructor @@ -179,9 +179,9 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos, - SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime) ; + SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime); #endif /// @} @@ -215,7 +215,7 @@ MSLane* const myLane; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL std::map > myLastVehicleUpdateValues; #endif diff -Nru sumo-0.15.0~dfsg/src/microsim/MSNet.cpp sumo-0.16.0~dfsg/src/microsim/MSNet.cpp --- sumo-0.15.0~dfsg/src/microsim/MSNet.cpp 2012-02-29 00:03:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSNet.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,9 +5,10 @@ /// @author Jakob Erdmann /// @author Clemens Honomichl /// @author Eric Nicolay +/// @author Mario Krumnow /// @author Michael Behrisch /// @date Tue, 06 Mar 2001 -/// @version $Id: MSNet.cpp 11974 2012-02-28 22:27:05Z behrisch $ +/// @version $Id: MSNet.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The simulated network and simulation perfomer /****************************************************************************/ @@ -37,13 +38,13 @@ #include #endif +#include #include #include #include #include #include #include -#include #include #include "MSNet.h" #include "MSPersonControl.h" @@ -58,15 +59,25 @@ #include "MSVehicleTransfer.h" #include "MSRoute.h" #include "MSRouteLoaderControl.h" +#include "trigger/MSTrigger.h" #include "traffic_lights/MSTLLogicControl.h" #include "MSVehicleControl.h" #include #include #include #include +#include +#include #include "traffic_lights/MSTrafficLightLogic.h" #include #include + +#include +#include "output/MSFCDExport.h" +#include "output/MSEmissionExport.h" +#include "output/MSFullExport.h" +#include "output/MSQueueExport.h" +#include "output/MSVTKExport.h" #include "output/MSXMLRawOut.h" #include #include @@ -83,7 +94,7 @@ #include "MSMessageEmitter.h" #endif -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #endif @@ -106,18 +117,14 @@ // =========================================================================== // member method definitions // =========================================================================== -// --------------------------------------------------------------------------- -// MSNet::EdgeWeightsProxi - methods -// --------------------------------------------------------------------------- SUMOReal -MSNet::EdgeWeightsProxi::getEffort(const MSEdge* const e, - const SUMOVehicle* const v, - SUMOReal t) const { +MSNet::getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t) { SUMOReal value; - if (myVehicleKnowledge.retrieveExistingEffort(e, v, t, value)) { + const MSVehicle* const veh = dynamic_cast(v); + if (veh != 0 && veh->getWeightsStorage().retrieveExistingEffort(e, v, t, value)) { return value; } - if (myNetKnowledge.retrieveExistingEffort(e, v, t, value)) { + if (getInstance()->getWeightsStorage().retrieveExistingEffort(e, v, t, value)) { return value; } return 0; @@ -125,18 +132,16 @@ SUMOReal -MSNet::EdgeWeightsProxi::getTravelTime(const MSEdge* const e, - const SUMOVehicle* const v, - SUMOReal t) const { +MSNet::getTravelTime(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t) { SUMOReal value; - if (myVehicleKnowledge.retrieveExistingTravelTime(e, v, t, value)) { + const MSVehicle* const veh = dynamic_cast(v); + if (veh != 0 && veh->getWeightsStorage().retrieveExistingTravelTime(e, v, t, value)) { return value; } - if (myNetKnowledge.retrieveExistingTravelTime(e, v, t, value)) { + if (getInstance()->getWeightsStorage().retrieveExistingTravelTime(e, v, t, value)) { return value; } - const MSLane* const l = e->getLanes()[0]; - return l->getLength() / l->getMaxSpeed(); + return e->getMinimumTravelTime(v); } @@ -155,7 +160,12 @@ MSNet::MSNet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents, MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents, - ShapeContainer* shapeCont) { + ShapeContainer* shapeCont): + myVehiclesMoved(0), + myRouterTTInitialized(false), + myRouterTTDijkstra(0), + myRouterTTAStar(0), + myRouterEffort(0) { if (myInstance != 0) { throw ProcessError("A network was already constructed."); } @@ -179,7 +189,7 @@ myEndOfTimestepEvents = endOfTimestepEvents; myInsertionEvents = insertionEvents; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MSGlobals::gMesoNet = new MELoop(string2time(oc.getString("meso-recheck"))); } @@ -237,7 +247,10 @@ msgEmitVec.clear(); #endif delete myEdgeWeights; -#ifdef HAVE_MESOSIM + delete myRouterTTDijkstra; + delete myRouterTTAStar; + delete myRouterEffort; +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { delete MSGlobals::gMesoNet; } @@ -301,17 +314,29 @@ msg << " Real time factor: " << (STEPS2TIME(myStep - start) * 1000. / (SUMOReal)duration) << "\n"; msg.setf(std::ios::fixed , std::ios::floatfield); // use decimal format msg.setf(std::ios::showpoint); // print decimal point - msg << " UPS: " << ((SUMOReal) myVehiclesMoved * 1000. / (SUMOReal) duration) << "\n"; + msg << " UPS: " << ((SUMOReal)myVehiclesMoved / ((SUMOReal)duration / 1000)) << "\n"; } - const std::string scaleNotice = ((myVehicleControl->getLoadedVehicleNo() != myVehicleControl->getDepartedVehicleNo()) ? - " (Loaded: " + toString(myVehicleControl->getLoadedVehicleNo()) + ")" : ""); + // prepare optional statistics + const std::string discardNotice = ((myVehicleControl->getLoadedVehicleNo() != myVehicleControl->getDepartedVehicleNo()) ? + " (Loaded: " + toString(myVehicleControl->getLoadedVehicleNo()) + ")" : ""); + const std::string collisionNotice = ( + myVehicleControl->getCollisionCount() > 0 ? + " (Collisions: " + toString(myVehicleControl->getCollisionCount()) + ")" : ""); + const std::string teleportNotice = ( + myVehicleControl->getTeleportCount() > 0 ? + "Teleports: " + toString(myVehicleControl->getTeleportCount()) + collisionNotice + "\n" : ""); + // print statistics msg << "Vehicles: " << "\n" - << " Emitted: " << myVehicleControl->getDepartedVehicleNo() << scaleNotice << "\n" + << " Emitted: " << myVehicleControl->getDepartedVehicleNo() << discardNotice << "\n" << " Running: " << myVehicleControl->getRunningVehicleNo() << "\n" - << " Waiting: " << myInserter->getWaitingVehicleNo() << "\n"; + << " Waiting: " << myInserter->getWaitingVehicleNo() << "\n" + << teleportNotice; WRITE_MESSAGE(msg.str()); } myDetectorControl->close(myStep); + if (OptionsCont::getOptions().getBool("vehroute-output.write-unfinished")) { + MSDevice_Vehroutes::generateOutputForUnfinished(); + } #ifndef NO_TRACI traci::TraCIServer::close(); #endif @@ -327,7 +352,7 @@ if (myLogExecutionTime) { mySimStepBegin = SysUtils::getCurrentMillis(); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL // netstate output std::vector::iterator timeIt = find(myStateDumpTimes.begin(), myStateDumpTimes.end(), myStep); if (timeIt != myStateDumpTimes.end()) { @@ -345,7 +370,7 @@ // set the signals myLogics->setTrafficLightSignals(myStep); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MSGlobals::gMesoNet->simulate(myStep); } else { @@ -372,7 +397,7 @@ if (MSGlobals::gCheck4Accidents) { myEdges->detectCollisions(myStep); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif // load routes @@ -380,7 +405,7 @@ // persons if (myPersonControl != 0) { - myPersonControl->checkArrivedPersons(this, myStep); + myPersonControl->checkWaitingPersons(this, myStep); } // emit Vehicles myInsertionEvents->execute(myStep); @@ -421,7 +446,7 @@ if (myInsertionEvents->isEmpty() && (myVehicleControl->getActiveVehicleCount() == 0) && (myInserter->getPendingFlowCount() == 0) - && (myPersonControl == 0 || !myPersonControl->hasPedestrians())) { + && (myPersonControl == 0 || !myPersonControl->hasNonWaiting())) { if (myPersonControl) { myPersonControl->abortWaiting(); } @@ -464,6 +489,8 @@ MSLane::clear(); MSRoute::clear(); delete MSVehicleTransfer::getInstance(); + MSDevice_Routing::cleanup(); + MSTrigger::cleanup(); } @@ -477,13 +504,53 @@ MSNet::writeOutput() { // update detector values myDetectorControl->updateDetectors(myStep); + // check state dumps if (OptionsCont::getOptions().isSet("netstate-dump")) { MSXMLRawOut::write(OutputDevice::getDeviceByOption("netstate-dump"), *myEdges, myStep); } + + // check fcd dumps + if (OptionsCont::getOptions().isSet("fcd-output")) { + MSFCDExport::write(OutputDevice::getDeviceByOption("fcd-output"), myStep); + } + + // check emission dumps + if (OptionsCont::getOptions().isSet("emission-output")) { + MSEmissionExport::write(OutputDevice::getDeviceByOption("emission-output"), myStep); + } + + // check full dumps + if (OptionsCont::getOptions().isSet("full-output")) { + MSFullExport::write(OutputDevice::getDeviceByOption("full-output"), myStep); + } + + // check queue dumps + if (OptionsCont::getOptions().isSet("queue-output")) { + MSQueueExport::write(OutputDevice::getDeviceByOption("queue-output"), myStep); + } + + // check vtk dumps + if (OptionsCont::getOptions().isSet("vtk-output")) { + + if (MSNet::getInstance()->getVehicleControl().getRunningVehicleNo() > 0) { + std::string timestep = time2string(myStep); + timestep = timestep.substr(0, timestep.length() - 3); + std::string output = OptionsCont::getOptions().getString("vtk-output"); + std::string filename = output + "_" + timestep + ".vtp"; + + OutputDevice_File dev = OutputDevice_File(filename, false); + + //build a huge mass of xml files + MSVTKExport::write(dev, myStep); + + } + + } + // emission output if (OptionsCont::getOptions().isSet("summary-output")) { - OutputDevice& od = OutputDevice::getDeviceByOption("summary"); + OutputDevice& od = OutputDevice::getDeviceByOption("summary-output"); od << " getLoadedVehicleNo() << "\" " << "emitted=\"" << myVehicleControl->getDepartedVehicleNo() << "\" " @@ -511,14 +578,14 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL void MSNet::saveState(std::ostream& os) { FileHelpers::writeString(os, VERSION_STRING); FileHelpers::writeUInt(os, sizeof(size_t)); FileHelpers::writeUInt(os, sizeof(SUMOReal)); FileHelpers::writeUInt(os, MSEdge::dictSize()); - FileHelpers::writeUInt(os, myStep); + FileHelpers::writeTime(os, myStep); MSRoute::dict_saveState(os); myVehicleControl->saveState(os); if (MSGlobals::gUseMesoSim) { @@ -527,10 +594,11 @@ } -unsigned int +SUMOTime MSNet::loadState(BinaryInputDevice& bis) { std::string version; - unsigned int sizeT, fpSize, numEdges, step; + unsigned int sizeT, fpSize, numEdges; + SUMOTime step; bis >> version; bis >> sizeT; bis >> fpSize; @@ -649,7 +717,7 @@ std::string MSNet::getBusStopID(const MSLane* lane, const SUMOReal pos) const { - const std::map &vals = myBusStopDict.getMyMap(); + const std::map& vals = myBusStopDict.getMyMap(); for (std::map::const_iterator it = vals.begin(); it != vals.end(); ++it) { MSBusStop* stop = it->second; if (&stop->getLane() == lane && fabs(stop->getEndLanePosition() - pos) < POSITION_EPS) { @@ -660,20 +728,56 @@ } +SUMOAbstractRouter& +MSNet::getRouterTT(const std::vector& prohibited) const { + if (!myRouterTTInitialized) { + myRouterTTInitialized = true; + const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm"); + if (routingAlgorithm == "dijkstra") { + myRouterTTDijkstra = new DijkstraRouterTT_ByProxi >( + MSEdge::numericalDictSize(), true, &MSNet::getTravelTime); + } else { + if (routingAlgorithm != "astar") { + WRITE_WARNING("TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm + "'. using 'astar' instead."); + } + myRouterTTAStar = new AStarRouterTT_ByProxi >( + MSEdge::numericalDictSize(), true, &MSNet::getTravelTime); + } + } + if (myRouterTTDijkstra != 0) { + myRouterTTDijkstra->prohibit(prohibited); + return *myRouterTTDijkstra; + } else { + assert(myRouterTTAStar != 0); + myRouterTTAStar->prohibit(prohibited); + return *myRouterTTAStar; + } +} + + +SUMOAbstractRouter& +MSNet::getRouterEffort(const std::vector& prohibited) const { + if (myRouterEffort == 0) { + myRouterEffort = new DijkstraRouterEffort_ByProxi >( + MSEdge::numericalDictSize(), true, &MSNet::getEffort, &MSNet::getTravelTime); + } + myRouterEffort->prohibit(prohibited); + return *myRouterEffort; +} + + + #ifdef _MESSAGES MSMessageEmitter* MSNet::getMsgEmitter(const std::string& whatemit) { msgEmitVec.clear(); msgEmitVec = myMsgEmitter.buildAndGetStaticVector(); - MSMessageEmitter* msgEmitter = 0; - for (int i = 0; i < msgEmitVec.size(); ++i) { - if (msgEmitVec.at(i)->getEventsEnabled(whatemit)) { - msgEmitter = msgEmitVec.at(i); - break; + for (std::vector::iterator it = msgEmitVec.begin(); it != msgEmitVec.end(); ++it) { + if ((*it)->getEventsEnabled(whatemit)) { + return *it; } } - // returns 0 if the requested MessageEmitter is not in the map - return msgEmitter; + return 0; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSNet.h sumo-0.16.0~dfsg/src/microsim/MSNet.h --- sumo-0.15.0~dfsg/src/microsim/MSNet.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSNet.h 2012-12-02 13:57:49.000000000 +0000 @@ -8,7 +8,7 @@ /// @author Clemens Honomichl /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSNet.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSNet.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The simulated network and simulation perfomer /****************************************************************************/ @@ -52,6 +52,10 @@ #include #include #include +#include +#include +#include +#include // =========================================================================== // class declarations @@ -110,7 +114,7 @@ * @return Pointer to the unique MSNet-instance * @exception ProcessError If a network was not yet constructed */ - static MSNet* getInstance() ; + static MSNet* getInstance(); /** @brief Constructor @@ -129,11 +133,11 @@ */ MSNet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents, MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents, - ShapeContainer* shapeCont = 0) ; + ShapeContainer* shapeCont = 0); /// @brief Destructor - virtual ~MSNet() ; + virtual ~MSNet(); /** @brief Closes the network's building process @@ -149,7 +153,7 @@ */ void closeBuilding(MSEdgeControl* edges, MSJunctionControl* junctions, MSRouteLoaderControl* routeLoaders, MSTLLogicControl* tlc, - std::vector stateDumpTimes, std::vector stateDumpFiles) ; + std::vector stateDumpTimes, std::vector stateDumpFiles); /** @brief Clears all dictionaries @@ -189,13 +193,13 @@ * @return The current simulation state * @see SimulationState */ - SimulationState simulationState(SUMOTime stopTime) const ; + SimulationState simulationState(SUMOTime stopTime) const; /** @brief Returns the message to show if a certain state occurs * @return Readable description of the state */ - static std::string getStateMessage(SimulationState state) ; + static std::string getStateMessage(SimulationState state); /** @brief Returns the current simulation step (in s) @@ -204,7 +208,7 @@ SUMOTime getCurrentTimeStep() const; - /** @brief Write netstate, emission and detector output + /** @brief Write netstate, summary and detector output * @todo Which exceptions may occur? */ void writeOutput(); @@ -213,7 +217,7 @@ /** @brief Returns whether duration shall be logged * @return Whether duration shall be logged */ - bool logSimulationDuration() const ; + bool logSimulationDuration() const; /// @name Output during the simulation @@ -223,19 +227,19 @@ * * Called on the begin of a simulation step */ - void preSimStepOutput() const ; + void preSimStepOutput() const; /** @brief Prints the statistics of the step at its end * * Called on the end of a simulation step */ - void postSimStepOutput() const ; + void postSimStepOutput() const; //} -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /// @name State I/O (mesosim only) /// @{ @@ -243,14 +247,14 @@ * * @param[in] os The stream to write the state into (binary) */ - void saveState(std::ostream& os) ; + void saveState(std::ostream& os); /** @brief Loads the network state * * @param[in] bis The input to read the state from (binary) */ - unsigned int loadState(BinaryInputDevice& bis) ; + SUMOTime loadState(BinaryInputDevice& bis); /// @} #endif @@ -275,7 +279,7 @@ * @see MSPersonControl * @see myPersonControl */ - MSPersonControl& getPersonControl() ; + virtual MSPersonControl& getPersonControl(); /** @brief Returns the edge control @@ -373,7 +377,7 @@ * If the net does not have such a container, it is built. * @return The net's knowledge about edge weights */ - MSEdgeWeightsStorage& getWeightsStorage() ; + MSEdgeWeightsStorage& getWeightsStorage(); /// @} @@ -458,13 +462,13 @@ /** @brief Adds a vehicle states listener * @param[in] listener The listener to add */ - void addVehicleStateListener(VehicleStateListener* listener) ; + void addVehicleStateListener(VehicleStateListener* listener); /** @brief Removes a vehicle states listener * @param[in] listener The listener to remove */ - void removeVehicleStateListener(VehicleStateListener* listener) ; + void removeVehicleStateListener(VehicleStateListener* listener); /** @brief Informs all added listeners about a vehicle's state change @@ -472,64 +476,37 @@ * @param[in] to The state the vehicle has changed to * @see VehicleStateListener:vehicleStateChanged */ - void informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState to) ; + void informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState to); /// @} - /** @class EdgeWeightsProxi - * @brief A proxi for edge weights known by a vehicle/known globally - * - * Both getter methods try to return the vehicle's knowledge about the edge/time, first. - * If not existing,they try to retrieve it from the global knowledge. If not existing, - * the travel time retrieval method returns the edges' length divided by the maximum speed - * (information from the first lane is used). The default value for the effort is 0. - * @see MSEdgeWeightsStorage + /** @brief Returns the travel time to pass an edge + * @param[in] e The edge for which the travel time to be passed shall be returned + * @param[in] v The vehicle that is rerouted + * @param[in] t The time for which the travel time shall be returned [s] + * @return The travel time for an edge + * @see DijkstraRouterTT_ByProxi */ - class EdgeWeightsProxi { - public: - /** @brief Constructor - * @param[in] vehKnowledge The vehicle's edge weights knowledge - * @param[in] netKnowledge The global edge weights knowledge - */ - EdgeWeightsProxi(const MSEdgeWeightsStorage& vehKnowledge, - const MSEdgeWeightsStorage& netKnowledge) - : myVehicleKnowledge(vehKnowledge), myNetKnowledge(netKnowledge) {} - - - /// @brief Destructor - ~EdgeWeightsProxi() {} - - - /** @brief Returns the travel time to pass an edge - * @param[in] e The edge for which the travel time to be passed shall be returned - * @param[in] v The vehicle that is rerouted - * @param[in] t The time for which the travel time shall be returned [s] - * @return The travel time for an edge - * @see DijkstraRouterTT_ByProxi - */ - SUMOReal getTravelTime(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t) const; - - - /** @brief Returns the effort to pass an edge - * @param[in] e The edge for which the effort to be passed shall be returned - * @param[in] v The vehicle that is rerouted - * @param[in] t The time for which the effort shall be returned [s] - * @return The effort (abstract) for an edge - * @see DijkstraRouterTT_ByProxi - */ - SUMOReal getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t) const; + static SUMOReal getTravelTime(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t); - private: - EdgeWeightsProxi& operator=(const EdgeWeightsProxi&); // just to avoid a compiler warning - private: - /// @brief The vehicle's knownledge - const MSEdgeWeightsStorage& myVehicleKnowledge; + /** @brief Returns the effort to pass an edge + * @param[in] e The edge for which the effort to be passed shall be returned + * @param[in] v The vehicle that is rerouted + * @param[in] t The time for which the effort shall be returned [s] + * @return The effort (abstract) for an edge + * @see DijkstraRouterTT_ByProxi + */ + static SUMOReal getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t); - /// @brief The global knownledge - const MSEdgeWeightsStorage& myNetKnowledge; - }; + /* @brief get the router, initialize on first use + * @param[in] prohibited The vector of forbidden edges (optional) + */ + SUMOAbstractRouter& getRouterTT( + const std::vector& prohibited = std::vector()) const; + SUMOAbstractRouter& getRouterEffort( + const std::vector& prohibited = std::vector()) const; #ifdef _MESSAGES @@ -618,7 +595,7 @@ long mySimBeginMillis; /// @brief The overall number of vehicle movements - long myVehiclesMoved; + SUMOLong myVehiclesMoved; //} @@ -652,6 +629,15 @@ std::vector msgEmitVec; #endif + /* @brief The router instance for routing by trigger and by traci + * @note MSDevice_Routing has its own instance since it uses a different weight function + * @note we provide one member for every switchable router type + * because the class structure makes it inconvenient to use a superclass*/ + mutable bool myRouterTTInitialized; + mutable DijkstraRouterTT_ByProxi >* myRouterTTDijkstra; + mutable AStarRouterTT_ByProxi >* myRouterTTAStar; + mutable DijkstraRouterEffort_ByProxi >* myRouterEffort; + private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.15.0~dfsg/src/microsim/MSNoLogicJunction.h sumo-0.16.0~dfsg/src/microsim/MSNoLogicJunction.h --- sumo-0.15.0~dfsg/src/microsim/MSNoLogicJunction.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSNoLogicJunction.h 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSNoLogicJunction.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSNoLogicJunction.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // logic, e.g. for exits. /****************************************************************************/ @@ -70,10 +70,10 @@ #ifdef HAVE_INTERNAL_LANES , std::vector internal #endif - ) ; + ); /** Initialises the junction after the net was completely loaded */ - void postloadInit() ; + void postloadInit(); private: /** Lanes incoming to the junction */ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSPerson.cpp sumo-0.16.0~dfsg/src/microsim/MSPerson.cpp --- sumo-0.15.0~dfsg/src/microsim/MSPerson.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSPerson.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 9 Jul 2001 -/// @version $Id: MSPerson.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSPerson.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The class for modelling person-movements /****************************************************************************/ @@ -33,6 +33,9 @@ #include #include +#include +#include +#include #include "MSNet.h" #include "MSEdge.h" #include "MSLane.h" @@ -40,12 +43,15 @@ #include "MSPersonControl.h" #include "MSInsertionControl.h" #include "MSVehicle.h" -#include #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS +/* ------------------------------------------------------------------------- + * static member definitions + * ----------------------------------------------------------------------- */ +const SUMOReal MSPerson::SIDEWALK_OFFSET(3); // =========================================================================== // method definitions @@ -53,8 +59,8 @@ /* ------------------------------------------------------------------------- * MSPerson::MSPersonStage - methods * ----------------------------------------------------------------------- */ -MSPerson::MSPersonStage::MSPersonStage(const MSEdge& destination) - : myDestination(destination), myDeparted(-1), myArrived(-1) {} +MSPerson::MSPersonStage::MSPersonStage(const MSEdge& destination, StageType type) + : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {} MSPerson::MSPersonStage::~MSPersonStage() {} @@ -85,17 +91,47 @@ return false; } + +Position +MSPerson::MSPersonStage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const { + // @todo: well, definitely not the nicest way... Should be precomputed + const MSLane* lane = e->getLanes()[0]; + PositionVector shp = lane->getShape(); + shp.move2side(offset); + return shp.positionAtLengthPosition(lane->interpolateLanePosToGeometryPos(at)); +} + + +SUMOReal +MSPerson::MSPersonStage::getEdgeAngle(const MSEdge* e, SUMOReal at) const { + // @todo: well, definitely not the nicest way... Should be precomputed + PositionVector shp = e->getLanes()[0]->getShape(); + return shp.rotationDegreeAtLengthPosition(at); +} + + /* ------------------------------------------------------------------------- * MSPerson::MSPersonStage_Walking - methods * ----------------------------------------------------------------------- */ -MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(MSEdgeVector route, SUMOTime walkingTime, SUMOReal speed) - : MSPersonStage(*route.back()), myWalkingTime(walkingTime) { - if (speed > 0) { - SUMOReal time = 0; - for (MSEdgeVector::const_iterator it = route.begin(); it != route.end(); ++it) { - time += ((*it)->getLanes())[0]->getLength() / speed; +MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(const std::vector& route, + MSBusStop* toBS, + SUMOTime walkingTime, SUMOReal speed, + SUMOReal departPos, SUMOReal arrivalPos) : + MSPersonStage(*route.back(), WALKING), myWalkingTime(walkingTime), myRoute(route), + myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS), + mySpeed(speed) { + myDepartPos = SUMOVehicleParameter::interpretEdgePos( + myDepartPos, myRoute.front()->getLength(), SUMO_ATTR_DEPARTPOS, "person walking from " + myRoute.front()->getID()); + myArrivalPos = SUMOVehicleParameter::interpretEdgePos( + myArrivalPos, myRoute.back()->getLength(), SUMO_ATTR_ARRIVALPOS, "person walking to " + myRoute.back()->getID()); + if (walkingTime > 0) { + SUMOReal length = 0; + for (std::vector::const_iterator i = route.begin(); i != route.end(); ++i) { + length += (*i)->getLength(); } - myWalkingTime = MAX2(walkingTime, TIME2STEPS(time)); + length -= myDepartPos; + length -= route.back()->getLength() - myArrivalPos; + mySpeed = length / STEPS2TIME(walkingTime); } } @@ -103,11 +139,89 @@ MSPerson::MSPersonStage_Walking::~MSPersonStage_Walking() {} +const MSEdge* +MSPerson::MSPersonStage_Walking::getEdge(SUMOTime /* now */) const { + return *myRouteStep; +} + + +const MSEdge* +MSPerson::MSPersonStage_Walking::getFromEdge() const { + return myRoute.front(); +} + + +SUMOReal +MSPerson::MSPersonStage_Walking::getEdgePos(SUMOTime now) const { + SUMOReal off = STEPS2TIME(now - myLastEntryTime); + return myCurrentBeginPos + myCurrentLength / myCurrentDuration * off; +} + + +Position +MSPerson::MSPersonStage_Walking::getPosition(SUMOTime now) const { + const MSEdge* e = getEdge(now); + SUMOReal off = STEPS2TIME(now - myLastEntryTime); + return getEdgePosition(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off, SIDEWALK_OFFSET); +} + + +SUMOReal +MSPerson::MSPersonStage_Walking::getAngle(SUMOTime now) const { + const MSEdge* e = getEdge(now); + SUMOReal off = STEPS2TIME(now - myLastEntryTime); + return getEdgeAngle(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off) + 90; +} + + +bool +MSPerson::MSPersonStage_Walking::checkNoDuration(MSNet* /* net */, MSPerson* /* person */, SUMOTime duration, SUMOTime /* now */) { + if (duration == 0) { + + return true; + } + return false; +} + + void -MSPerson::MSPersonStage_Walking::proceed(MSNet* net, - MSPerson* person, SUMOTime now, - const MSEdge& /*previousEdge*/) { - net->getPersonControl().setArrival(MAX2(now, now + myWalkingTime), person); +MSPerson::MSPersonStage_Walking::proceed(MSNet* net, MSPerson* person, SUMOTime now, + MSEdge* previousEdge, const SUMOReal at) { + previousEdge->removePerson(person); + myRouteStep = myRoute.begin(); + myLastEntryTime = now; + if (myWalkingTime == 0) { + if (!person->proceed(net, now)) { + MSNet::getInstance()->getPersonControl().erase(person); + }; + return; + } + MSNet::getInstance()->getPersonControl().setWalking(person); + if (at >= 0) { + myDepartPos = at; + } + ((MSEdge*) *myRouteStep)->addPerson(person); + myRoute.size() == 1 + ? computeWalkingTime(*myRouteStep, myDepartPos, myArrivalPos, myDestinationBusStop) + : computeWalkingTime(*myRouteStep, myDepartPos, -1, 0); + net->getBeginOfTimestepEvents().addEvent(new MoveToNextEdge(person, *this), now + TIME2STEPS(myCurrentDuration), MSEventControl::ADAPT_AFTER_EXECUTION); +} + + +void +MSPerson::MSPersonStage_Walking::computeWalkingTime(const MSEdge* const e, SUMOReal fromPos, SUMOReal toPos, MSBusStop* bs) { + if (bs != 0) { + toPos = bs->getEndLanePosition(); + } else if (toPos < 0) { + toPos = e->getLanes()[0]->getLength(); + } + if (fromPos < 0) { + fromPos = 0; + } + myCurrentBeginPos = fromPos; + myCurrentLength = toPos - fromPos; + assert(myCurrentLength >= 0); + myCurrentDuration = MAX2(myCurrentLength, (SUMOReal)1.0) / mySpeed; } @@ -119,30 +233,130 @@ } +void +MSPerson::MSPersonStage_Walking::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + (os.openTag("event") << + " time=\"" << time2string(t) << + "\" type=\"departure" << + "\" agent=\"" << p.getID() << + "\" link=\"" << myRoute.front()->getID() << + "\"").closeTag(true); +} + + +void +MSPerson::MSPersonStage_Walking::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + (os.openTag("event") << + " time=\"" << time2string(t) << + "\" type=\"arrival" << + "\" agent=\"" << p.getID() << + "\" link=\"" << myRoute.back()->getID() << + "\"").closeTag(true); +} + + +SUMOTime +MSPerson::MSPersonStage_Walking::moveToNextEdge(MSPerson* person, SUMOTime currentTime) { + ((MSEdge*) *myRouteStep)->removePerson(person); + if (myRouteStep == myRoute.end() - 1) { + MSNet::getInstance()->getPersonControl().unsetWalking(person); + if (myDestinationBusStop != 0) { + myDestinationBusStop->addPerson(person); + } + if (!person->proceed(MSNet::getInstance(), currentTime)) { + MSNet::getInstance()->getPersonControl().erase(person); + } + return 0; + } else { + ++myRouteStep; + myRouteStep == myRoute.end() - 1 + ? computeWalkingTime(*myRouteStep, 0, myArrivalPos, myDestinationBusStop) + : computeWalkingTime(*myRouteStep, 0, -1, 0); + ((MSEdge*) *myRouteStep)->addPerson(person); + myLastEntryTime = currentTime; + return TIME2STEPS(myCurrentDuration); + } +} + + /* ------------------------------------------------------------------------- * MSPerson::MSPersonStage_Driving - methods * ----------------------------------------------------------------------- */ MSPerson::MSPersonStage_Driving::MSPersonStage_Driving(const MSEdge& destination, - const std::vector &lines) - : MSPersonStage(destination), myLines(lines.begin(), lines.end()) {} + MSBusStop* toBS, const std::vector& lines) + : MSPersonStage(destination, DRIVING), myLines(lines.begin(), lines.end()), + myVehicle(0), myDestinationBusStop(toBS) {} MSPerson::MSPersonStage_Driving::~MSPersonStage_Driving() {} +const MSEdge* +MSPerson::MSPersonStage_Driving::getEdge(SUMOTime /* now */) const { + if (myVehicle != 0) { + return myVehicle->getEdge(); + } + return myWaitingEdge; +} + + +const MSEdge* +MSPerson::MSPersonStage_Driving::getFromEdge() const { + return myWaitingEdge; +} + + +SUMOReal +MSPerson::MSPersonStage_Driving::getEdgePos(SUMOTime now) const { + if (myVehicle != 0) { + // vehicle may already have passed the lane (check whether this is correct) + return MIN2(myVehicle->getPositionOnLane(), getEdge(now)->getLength()); + } + return myWaitingPos; +} + + +Position +MSPerson::MSPersonStage_Driving::getPosition(SUMOTime /* now */) const { + if (myVehicle != 0) { + /// @bug this fails while vehicle is driving across a junction + return myVehicle->getEdge()->getLanes()[0]->getShape().positionAtLengthPosition(myVehicle->getPositionOnLane()); + } + return getEdgePosition(myWaitingEdge, myWaitingPos, SIDEWALK_OFFSET); +} + + +SUMOReal +MSPerson::MSPersonStage_Driving::getAngle(SUMOTime /* now */) const { + if (myVehicle != 0) { + MSVehicle* veh = dynamic_cast(myVehicle); + if (veh != 0) { + return veh->getAngle() + 90; + } else { + return 0; + } + } + return getEdgeAngle(myWaitingEdge, myWaitingPos); +} + + + void -MSPerson::MSPersonStage_Driving::proceed(MSNet* net, - MSPerson* person, SUMOTime /*now*/, - const MSEdge& previousEdge) { - SUMOVehicle* v = net->getVehicleControl().getWaitingVehicle(&previousEdge, myLines); - if (v != 0 && v->getParameter().departProcedure == DEPART_TRIGGERED) { - v->addPerson(person); - net->getInsertionControl().add(v); - net->getVehicleControl().removeWaiting(&previousEdge, v); +MSPerson::MSPersonStage_Driving::proceed(MSNet* net, MSPerson* person, SUMOTime /* now */, + MSEdge* previousEdge, const SUMOReal at) { + myWaitingEdge = previousEdge; + myWaitingPos = at; + myVehicle = net->getVehicleControl().getWaitingVehicle(previousEdge, myLines); + if (myVehicle != 0 && myVehicle->getParameter().departProcedure == DEPART_TRIGGERED) { + previousEdge->removePerson(person); + myVehicle->addPerson(person); + net->getInsertionControl().add(myVehicle); + net->getVehicleControl().removeWaiting(previousEdge, myVehicle); net->getVehicleControl().unregisterOneWaitingForPerson(); } else { - net->getPersonControl().addWaiting(&previousEdge, person); + net->getPersonControl().addWaiting(previousEdge, person); + previousEdge->addPerson(person); } } @@ -153,6 +367,18 @@ } +bool +MSPerson::MSPersonStage_Driving::isWaiting4Vehicle() const { + return myVehicle == 0; +} + + +std::string +MSPerson::MSPersonStage_Driving::getStageTypeName() const { + return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "driving"; +} + + void MSPerson::MSPersonStage_Driving::tripInfoOutput(OutputDevice& os) const { (os.openTag("ride") << @@ -162,23 +388,81 @@ } +void +MSPerson::MSPersonStage_Driving::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + (os.openTag("event") << + " time=\"" << time2string(t) << + "\" type=\"arrival" << + "\" agent=\"" << p.getID() << + "\" link=\"" << getEdge(t)->getID() << + "\"").closeTag(true); +} + + +void +MSPerson::MSPersonStage_Driving::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + (os.openTag("event") << + " time=\"" << time2string(t) << + "\" type=\"arrival" << + "\" agent=\"" << p.getID() << + "\" link=\"" << getEdge(t)->getID() << + "\"").closeTag(true); +} + + /* ------------------------------------------------------------------------- * MSPerson::MSPersonStage_Waiting - methods * ----------------------------------------------------------------------- */ MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(const MSEdge& destination, - SUMOTime duration, SUMOTime until) - : MSPersonStage(destination), myWaitingDuration(duration), myWaitingUntil(until) {} + SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType) : + MSPersonStage(destination, WAITING), + myWaitingDuration(duration), + myWaitingUntil(until), + myActType(actType), + myStartPos(pos) { + myStartPos = SUMOVehicleParameter::interpretEdgePos( + myStartPos, myDestination.getLength(), SUMO_ATTR_DEPARTPOS, "person stopping at " + myDestination.getID()); +} MSPerson::MSPersonStage_Waiting::~MSPersonStage_Waiting() {} +const MSEdge* +MSPerson::MSPersonStage_Waiting::getEdge(SUMOTime /* now */) const { + return &myDestination; +} + + +const MSEdge* +MSPerson::MSPersonStage_Waiting::getFromEdge() const { + return &myDestination; +} + + +SUMOReal +MSPerson::MSPersonStage_Waiting::getEdgePos(SUMOTime /* now */) const { + return myStartPos; +} + +Position +MSPerson::MSPersonStage_Waiting::getPosition(SUMOTime /* now */) const { + return getEdgePosition(&myDestination, myStartPos, SIDEWALK_OFFSET); +} + + +SUMOReal +MSPerson::MSPersonStage_Waiting::getAngle(SUMOTime /* now */) const { + return getEdgeAngle(&myDestination, myStartPos) + 45; +} + + void -MSPerson::MSPersonStage_Waiting::proceed(MSNet* net, - MSPerson* person, SUMOTime now, - const MSEdge& /*previousEdge*/) { +MSPerson::MSPersonStage_Waiting::proceed(MSNet* net, MSPerson* person, SUMOTime now, + MSEdge* previousEdge, const SUMOReal /* at */) { + previousEdge->addPerson(person); const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil); - net->getPersonControl().setArrival(until, person); + net->getPersonControl().setWaitEnd(until, person); } @@ -190,11 +474,32 @@ } +void +MSPerson::MSPersonStage_Waiting::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + (os.openTag("event") << + " time=\"" << time2string(t) << + "\" type=\"actstart " << myActType << + "\" agent=\"" << p.getID() << + "\" link=\"" << getEdge(t)->getID() << + "\"").closeTag(true); +} + + +void +MSPerson::MSPersonStage_Waiting::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + (os.openTag("event") << + " time=\"" << time2string(t) << + "\" type=\"actend " << myActType << + "\" agent=\"" << p.getID() << + "\" link=\"" << getEdge(t)->getID() << + "\"").closeTag(true); +} + /* ------------------------------------------------------------------------- * MSPerson - methods * ----------------------------------------------------------------------- */ -MSPerson::MSPerson(const SUMOVehicleParameter* pars, MSPersonPlan* plan) - : myParameter(pars), myPlan(plan) { +MSPerson::MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan) + : myParameter(pars), myVType(vtype), myPlan(plan) { myStep = myPlan->begin(); } @@ -214,15 +519,30 @@ } -void +bool MSPerson::proceed(MSNet* net, SUMOTime time) { - const MSEdge& arrivedAt = (*myStep)->getDestination(); + MSEdge* arrivedAt = (MSEdge*)(*myStep)->getEdge(time); + SUMOReal atPos = (*myStep)->getEdgePos(time); + //MSPersonPlan::iterator prior = myStep; (*myStep)->setArrived(time); + /* + if(myWriteEvents) { + (*myStep)->endEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output")); + } + */ + Position pos = (*myStep)->getPosition(time); myStep++; if (myStep != myPlan->end()) { - (*myStep)->proceed(net, this, time, arrivedAt); + (*myStep)->proceed(net, this, time, arrivedAt, atPos); + /* + if(myWriteEvents) { + (*myStep)->beginEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output")); + } + */ + return true; } else { - net->getPersonControl().erase(this); + arrivedAt->removePerson(this); + return false; } } @@ -239,12 +559,6 @@ } -const MSEdge& -MSPerson::getDestination() const { - return (*myStep)->getDestination(); -} - - void MSPerson::tripInfoOutput(OutputDevice& os) const { for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { @@ -253,11 +567,5 @@ } -bool -MSPerson::isWaitingFor(const std::string& line) const { - return (*myStep)->isWaitingFor(line); -} - - /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSPerson.h sumo-0.16.0~dfsg/src/microsim/MSPerson.h --- sumo-0.15.0~dfsg/src/microsim/MSPerson.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSPerson.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSPerson.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSPerson.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The class for modelling person-movements /****************************************************************************/ @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include // =========================================================================== @@ -45,6 +48,9 @@ class MSEdge; class OutputDevice; class SUMOVehicleParameter; +class MSBusStop; +class SUMOVehicle; +class MSVehicleType; typedef std::vector MSEdgeVector; @@ -59,6 +65,13 @@ */ class MSPerson { public: + enum StageType { + WALKING, + DRIVING, + WAITING + }; + + /** * The "abstract" class for a single stage of a persons movement * Contains the destination of the current movement step @@ -66,7 +79,7 @@ class MSPersonStage { public: /// constructor - MSPersonStage(const MSEdge& destination); + MSPersonStage(const MSEdge& destination, StageType type); /// destructor virtual ~MSPersonStage(); @@ -74,8 +87,25 @@ /// returns the destination edge const MSEdge& getDestination() const; + /// Returns the current edge + virtual const MSEdge* getEdge(SUMOTime now) const = 0; + virtual const MSEdge* getFromEdge() const = 0; + virtual SUMOReal getEdgePos(SUMOTime now) const = 0; + + /// + virtual Position getPosition(SUMOTime now) const = 0; + virtual SUMOReal getAngle(SUMOTime now) const = 0; + + /// + StageType getStageType() const { + return myType; + } + + /// @brief return string representation of the current stage + virtual std::string getStageTypeName() const = 0; + /// proceeds to the next step - virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, const MSEdge& previousEdge) = 0; + virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0; /// logs end of the step void setDeparted(SUMOTime now); @@ -86,13 +116,34 @@ /// Whether the person waits for a vehicle of the line specified. virtual bool isWaitingFor(const std::string& line) const; + /// @brief Whether the person waits for a vehicle + virtual bool isWaiting4Vehicle() const { + return false; + } + + /// @brief get position on edge e at length at with orthogonal offset + Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const; + + SUMOReal getEdgeAngle(const MSEdge* e, SUMOReal at) const; + /** @brief Called on writing tripinfo output - * * @param[in] os The stream to write the information into * @exception IOError not yet implemented */ virtual void tripInfoOutput(OutputDevice& os) const = 0; + /** @brief Called for writing the events output (begin of an action) + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const = 0; + + /** @brief Called for writing the events output (end of an action) + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const = 0; + protected: /// the next edge to reach (either by walking or driving) @@ -104,6 +155,9 @@ /// the time at which this stage ended SUMOTime myArrived; + /// The type of this stage + StageType myType; + private: /// @brief Invalidated copy constructor. MSPersonStage(const MSPersonStage&); @@ -121,25 +175,109 @@ class MSPersonStage_Walking : public MSPersonStage { public: /// constructor - MSPersonStage_Walking(MSEdgeVector route, SUMOTime walkingTime, SUMOReal speed); + MSPersonStage_Walking(const std::vector& route, MSBusStop* toBS, SUMOTime walkingTime, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos); /// destructor ~MSPersonStage_Walking(); /// proceeds to the next step - virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, const MSEdge& previousEdge); + virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); + + /// Returns the current edge + const MSEdge* getEdge(SUMOTime now) const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + + /// + Position getPosition(SUMOTime now) const; + + SUMOReal getAngle(SUMOTime now) const; + + std::string getStageTypeName() const { + return "walking"; + } /** @brief Called on writing tripinfo output - * * @param[in] os The stream to write the information into * @exception IOError not yet implemented */ virtual void tripInfoOutput(OutputDevice& os) const; + /** @brief Called for writing the events output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const; + + /** @brief Called for writing the events output (end of an action) + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const; + + SUMOTime moveToNextEdge(MSPerson* person, SUMOTime currentTime); + + + class MoveToNextEdge : public Command { + public: + MoveToNextEdge(MSPerson* person, MSPersonStage_Walking& walk) : myParent(walk), myPerson(person) {} + ~MoveToNextEdge() {} + SUMOTime execute(SUMOTime currentTime) { + return myParent.moveToNextEdge(myPerson, currentTime); + } + private: + MSPersonStage_Walking& myParent; + MSPerson* myPerson; + private: + /// @brief Invalidated assignment operator. + MoveToNextEdge& operator=(const MoveToNextEdge&); + + }; + + + private: + void computeWalkingTime(const MSEdge* const e, SUMOReal fromPos, SUMOReal toPos, MSBusStop* bs); + bool checkNoDuration(MSNet* net, MSPerson* person, SUMOTime duration, SUMOTime now); + + private: /// the time the person is walking SUMOTime myWalkingTime; + /// @brief The route of the person + std::vector myRoute; + + + std::vector::iterator myRouteStep; + + /// @brief A vector of computed times an edge is reached + //std::vector myArrivalTimes; + + SUMOReal myDepartPos; + SUMOReal myArrivalPos; + MSBusStop* myDestinationBusStop; + SUMOTime myLastEntryTime; + SUMOReal mySpeed; + + SUMOReal myCurrentBeginPos, myCurrentLength, myCurrentDuration; + //bool myDurationWasGiven; + //SUMOReal myOverallLength; + + class arrival_finder { + public: + /// constructor + explicit arrival_finder(SUMOTime time) : myTime(time) {} + + /// comparison operator + bool operator()(SUMOReal t) const { + return myTime > t; + } + + private: + /// the searched arrival time + SUMOTime myTime; + }; + private: /// @brief Invalidated copy constructor. MSPersonStage_Walking(const MSPersonStage_Walking&); @@ -156,18 +294,37 @@ class MSPersonStage_Driving : public MSPersonStage { public: /// constructor - MSPersonStage_Driving(const MSEdge& destination, - const std::vector &lines); + MSPersonStage_Driving(const MSEdge& destination, MSBusStop* toBS, + const std::vector& lines); /// destructor ~MSPersonStage_Driving(); /// proceeds to the next step - virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, const MSEdge& previousEdge); + virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); + + /// Returns the current edge + const MSEdge* getEdge(SUMOTime now) const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + + /// + Position getPosition(SUMOTime now) const; + + SUMOReal getAngle(SUMOTime now) const; + + std::string getStageTypeName() const; /// Whether the person waits for a vehicle of the line specified. bool isWaitingFor(const std::string& line) const; + /// Whether the person waits for a vehicle + bool isWaiting4Vehicle() const; + + void setVehicle(SUMOVehicle* v) { + myVehicle = v; + } + /** @brief Called on writing tripinfo output * * @param[in] os The stream to write the information into @@ -175,10 +332,30 @@ */ virtual void tripInfoOutput(OutputDevice& os) const; + /** @brief Called for writing the events output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const; + + /** @brief Called for writing the events output (end of an action) + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const; + private: /// the lines to choose from const std::set myLines; + /// @brief The taken vehicle + SUMOVehicle* myVehicle; + + MSBusStop* myDestinationBusStop; + //Position myWaitingPos; + SUMOReal myWaitingPos; + const MSEdge* myWaitingEdge; + private: /// @brief Invalidated copy constructor. MSPersonStage_Driving(const MSPersonStage_Driving&); @@ -194,13 +371,28 @@ class MSPersonStage_Waiting : public MSPersonStage { public: /// constructor - MSPersonStage_Waiting(const MSEdge& destination, SUMOTime duration, SUMOTime until); + MSPersonStage_Waiting(const MSEdge& destination, + SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType); /// destructor ~MSPersonStage_Waiting(); + /// Returns the current edge + const MSEdge* getEdge(SUMOTime now) const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + + /// + Position getPosition(SUMOTime now) const; + + SUMOReal getAngle(SUMOTime now) const; + + std::string getStageTypeName() const { + return "waiting (" + myActType + ")"; + } + /// proceeds to the next step - virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, const MSEdge& previousEdge); + virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); /** @brief Called on writing tripinfo output * @@ -209,6 +401,18 @@ */ virtual void tripInfoOutput(OutputDevice& os) const; + /** @brief Called for writing the events output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const; + + /** @brief Called for writing the events output (end of an action) + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const; + private: /// the time the person is waiting SUMOTime myWaitingDuration; @@ -216,6 +420,12 @@ /// the time until the person is waiting SUMOTime myWaitingUntil; + /// @brief The type of activity + std::string myActType; + + SUMOReal myStartPos; + + private: /// @brief Invalidated copy constructor. MSPersonStage_Waiting(const MSPersonStage_Waiting&); @@ -229,37 +439,84 @@ /// the structure holding the plan of a person typedef std::vector MSPersonPlan; -private: +protected: /// the plan of the person const SUMOVehicleParameter* myParameter; + /// @brief This Persons's type. (mainly used for drawing related information + const MSVehicleType* myVType; + /// the plan of the person MSPersonPlan* myPlan; /// the iterator over the route MSPersonPlan::iterator myStep; + /// @brief Whether events shall be written + bool myWriteEvents; + public: /// constructor - MSPerson(const SUMOVehicleParameter* pars, MSPersonPlan* plan); + MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan); /// destructor - ~MSPerson(); + virtual ~MSPerson(); /// returns the person id - const std::string& getID() const ; + const std::string& getID() const; - /// proceeds to the next step of the route - void proceed(MSNet* net, SUMOTime time); + /* @brief proceeds to the next step of the route, + * @return Whether the persons plan continues */ + bool proceed(MSNet* net, SUMOTime time); /// Returns the desired departure time. - SUMOTime getDesiredDepart() const ; + SUMOTime getDesiredDepart() const; /// logs end of the step void setDeparted(SUMOTime now); /// Returns the current destination. - const MSEdge& getDestination() const; + const MSEdge& getDestination() const { + return (*myStep)->getDestination(); + } + + /// @brief Returns the current edge + const MSEdge* getEdge(SUMOTime now) const { + return (*myStep)->getEdge(now); + } + + /// @brief Returns the departure edge + const MSEdge* getFromEdge() const { + return (*myStep)->getFromEdge(); + } + + SUMOReal getEdgePos(SUMOTime now) const { + return (*myStep)->getEdgePos(now); + } + + /// + virtual Position getPosition(SUMOTime now) const { + return (*myStep)->getPosition(now); + } + + + SUMOReal getAngle(SUMOTime now) const { + return (*myStep)->getAngle(now); + } + + /// + StageType getCurrentStageType() const { + return (*myStep)->getStageType(); + } + + + std::string getCurrentStageTypeName() const { + return (*myStep)->getStageTypeName(); + } + + MSPersonStage* getCurrentStage() const { + return *myStep; + } /** @brief Called on writing tripinfo output * @@ -269,7 +526,27 @@ void tripInfoOutput(OutputDevice& os) const; /// Whether the person waits for a vehicle of the line specified. - bool isWaitingFor(const std::string& line) const; + bool isWaitingFor(const std::string& line) const { + return (*myStep)->isWaitingFor(line); + } + + /// Whether the person waits for a vehicle of the line specified. + bool isWaiting4Vehicle() const { + return (*myStep)->isWaiting4Vehicle(); + } + + const SUMOVehicleParameter& getParameter() const { + return *myParameter; + } + + + inline const MSVehicleType& getVehicleType() const { + return *myVType; + } + + + /// @brief the offset for computing person positions when walking + static const SUMOReal SIDEWALK_OFFSET; private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.15.0~dfsg/src/microsim/MSPersonControl.cpp sumo-0.16.0~dfsg/src/microsim/MSPersonControl.cpp --- sumo-0.15.0~dfsg/src/microsim/MSPersonControl.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSPersonControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSPersonControl.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSPersonControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Stores all persons in the net and handles their waiting for cars. /****************************************************************************/ @@ -34,6 +34,7 @@ #include #include #include "MSNet.h" +#include "MSEdge.h" #include "MSPerson.h" #include "MSVehicle.h" #include "MSPersonControl.h" @@ -56,7 +57,7 @@ delete(*i).second; } myPersons.clear(); - myWaiting.clear(); + myWaiting4Vehicle.clear(); } @@ -96,53 +97,87 @@ } } + +void +MSPersonControl::setDeparture(const SUMOTime time, MSPerson* person) { + const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T; + if (myWaiting4Departure.find(step) == myWaiting4Departure.end()) { + myWaiting4Departure[step] = PersonVector(); + } + myWaiting4Departure[step].push_back(person); +} + + void -MSPersonControl::setArrival(const SUMOTime time, MSPerson* person) { +MSPersonControl::setWaitEnd(const SUMOTime time, MSPerson* person) { const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T; - if (myArrivals.find(step) == myArrivals.end()) { - myArrivals[step] = PersonVector(); + if (myWaitingUntil.find(step) == myWaitingUntil.end()) { + myWaitingUntil[step] = PersonVector(); } - myArrivals[step].push_back(person); + myWaitingUntil[step].push_back(person); } void -MSPersonControl::checkArrivedPersons(MSNet* net, const SUMOTime time) { - while (myArrivals.find(time) != myArrivals.end()) { - const PersonVector& persons = myArrivals[time]; +MSPersonControl::checkWaitingPersons(MSNet* net, const SUMOTime time) { + while (myWaiting4Departure.find(time) != myWaiting4Departure.end()) { + const PersonVector& persons = myWaiting4Departure[time]; + // we cannot use an iterator here because there might be additions to the vector while proceeding + for (size_t i = 0; i < persons.size(); ++i) { + if (!persons[i]->proceed(net, time)) { + erase(persons[i]); + } + } + myWaiting4Departure.erase(time); + } + while (myWaitingUntil.find(time) != myWaitingUntil.end()) { + const PersonVector& persons = myWaitingUntil[time]; // we cannot use an iterator here because there might be additions to the vector while proceeding for (size_t i = 0; i < persons.size(); ++i) { - persons[i]->proceed(net, time); + if (!persons[i]->proceed(net, time)) { + erase(persons[i]); + } } - myArrivals.erase(time); + myWaitingUntil.erase(time); } } void MSPersonControl::addWaiting(const MSEdge* const edge, MSPerson* person) { - if (myWaiting.find(edge) == myWaiting.end()) { - myWaiting[edge] = std::vector(); + if (myWaiting4Vehicle.find(edge) == myWaiting4Vehicle.end()) { + myWaiting4Vehicle[edge] = std::vector(); } - myWaiting[edge].push_back(person); + myWaiting4Vehicle[edge].push_back(person); } bool -MSPersonControl::boardAnyWaiting(const MSEdge* const edge, MSVehicle* vehicle) { +MSPersonControl::isWaiting4Vehicle(const MSEdge* const edge, MSPerson* /* p */) const { + return myWaiting4Vehicle.find(edge) != myWaiting4Vehicle.end(); +} + + +bool +MSPersonControl::boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle) { bool ret = false; - if (myWaiting.find(edge) != myWaiting.end()) { - PersonVector& waitPersons = myWaiting[edge]; + if (myWaiting4Vehicle.find(edge) != myWaiting4Vehicle.end()) { + PersonVector& waitPersons = myWaiting4Vehicle[edge]; for (PersonVector::iterator i = waitPersons.begin(); i != waitPersons.end();) { const std::string& line = vehicle->getParameter().line == "" ? vehicle->getParameter().id : vehicle->getParameter().line; if ((*i)->isWaitingFor(line)) { + edge->removePerson(*i); vehicle->addPerson(*i); + static_cast((*i)->getCurrentStage())->setVehicle(vehicle); i = waitPersons.erase(i); ret = true; } else { ++i; } } + if (waitPersons.size() == 0) { + myWaiting4Vehicle.erase(myWaiting4Vehicle.find(edge)); + } } return ret; } @@ -155,18 +190,44 @@ bool -MSPersonControl::hasPedestrians() const { - return !myArrivals.empty(); +MSPersonControl::hasNonWaiting() const { + return !myWaiting4Departure.empty() || !myWaitingUntil.empty() || !myWalking.empty(); +} + + +void +MSPersonControl::setWalking(MSPerson* p) { + myWalking[p->getID()] = p; +} + + +void +MSPersonControl::unsetWalking(MSPerson* p) { + std::map::iterator i = myWalking.find(p->getID()); + if (i != myWalking.end()) { + myWalking.erase(i); + } } void MSPersonControl::abortWaiting() { - while (!myPersons.empty()) { - std::map::iterator i = myPersons.begin(); - WRITE_WARNING("Person " + i->first + " aborted waiting for a ride that will never come."); - erase(i->second); + for (std::map::const_iterator i = myWaiting4Vehicle.begin(); i != myWaiting4Vehicle.end(); ++i) { + const MSEdge* edge = (*i).first; + const PersonVector& pv = (*i).second; + for (PersonVector::const_iterator j = pv.begin(); j != pv.end(); ++j) { + MSPerson* p = (*j); + edge->removePerson(p); + WRITE_WARNING("Person " + p->getID() + " aborted waiting for a ride that will never come."); + erase(p); + } } } + +MSPerson* +MSPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const { + return new MSPerson(pars, vtype, plan); +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/MSPersonControl.h sumo-0.16.0~dfsg/src/microsim/MSPersonControl.h --- sumo-0.15.0~dfsg/src/microsim/MSPersonControl.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSPersonControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSPersonControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSPersonControl.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Stores all persons in the net and handles their waiting for cars. /****************************************************************************/ @@ -34,13 +34,15 @@ #endif #include +#include +#include "MSPerson.h" // =========================================================================== // class declarations // =========================================================================== -class MSPerson; class MSNet; +class MSVehicle; // =========================================================================== @@ -62,22 +64,25 @@ MSPersonControl(); /// destructor - ~MSPersonControl(); + virtual ~MSPersonControl(); - /// adds a single person, returns false iff an id clash occured + /// adds a single person, returns false if an id clash occured bool add(const std::string& id, MSPerson* person); /// removes a single person - void erase(MSPerson* person); + virtual void erase(MSPerson* person); /// sets the arrival time for a waiting or walking person - void setArrival(SUMOTime time, MSPerson* person); + void setDeparture(SUMOTime time, MSPerson* person); + + /// sets the arrival time for a waiting or walking person + void setWaitEnd(SUMOTime time, MSPerson* person); /// checks whether any persons waiting or walking time is over - void checkArrivedPersons(MSNet* net, const SUMOTime time); + void checkWaitingPersons(MSNet* net, const SUMOTime time); /// adds a person to the list of persons waiting for a vehicle on the specified edge - void addWaiting(const MSEdge* edge, MSPerson* person) ; + void addWaiting(const MSEdge* edge, MSPerson* person); /** @brief board any applicable persons * Boards any people who wait on that edge for the given vehicle and removes them from myWaiting @@ -85,26 +90,46 @@ * @param[in] the vehicle which is taking on passengers * @return Whether any persons have been boarded */ - bool boardAnyWaiting(const MSEdge* edge, MSVehicle* vehicle) ; + bool boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle); /// checks whether any person waits to finish her plan - bool hasPersons() const ; + bool hasPersons() const; /// checks whether any person is still engaged in walking / stopping - bool hasPedestrians() const ; + bool hasNonWaiting() const; /// aborts the plan for any person that is still waiting for a ride - void abortWaiting() ; + void abortWaiting(); + + + /** @brief Builds a new person + * @param[in] pars The parameter + * @param[in] vtype The type (reusing vehicle type container here) + * @param[in] plan This person's plan + */ + virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const; + + void setWalking(MSPerson* p); + void unsetWalking(MSPerson* p); + + /// @brief returns whether the the given person is waiting for a vehicle on the given edge + bool isWaiting4Vehicle(const MSEdge* const edge, MSPerson* p) const; private: /// all persons by id std::map myPersons; + /// all persons by id + std::map myWalking; + + /// @brief Persons waiting for departure + std::map myWaiting4Departure; + /// the lists of walking / stopping persons - std::map myArrivals; + std::map myWaitingUntil; /// the lists of waiting persons - std::map myWaiting; + std::map myWaiting4Vehicle; }; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRightOfWayJunction.cpp sumo-0.16.0~dfsg/src/microsim/MSRightOfWayJunction.cpp --- sumo-0.15.0~dfsg/src/microsim/MSRightOfWayJunction.cpp 2012-02-11 00:02:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRightOfWayJunction.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSRightOfWayJunction.cpp 11868 2012-02-10 11:49:38Z dkrajzew $ +/// @version $Id: MSRightOfWayJunction.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // junction. /****************************************************************************/ @@ -100,7 +100,7 @@ throw ProcessError("Found invalid logic position of a link (network error)"); } const MSLogicJunction::LinkFoes& foeLinks = myLogic->getFoesFor(requestPos); - const std::bitset<64> &internalFoes = myLogic->getInternalFoesFor(requestPos); + const std::bitset<64>& internalFoes = myLogic->getInternalFoesFor(requestPos); bool cont = myLogic->getIsCont(requestPos); myLinkFoeLinks[*j] = std::vector(); for (unsigned int c = 0; c < maxNo; ++c) { @@ -138,9 +138,9 @@ } if (internalFoes.test(c)) { myLinkFoeInternalLanes[*j].push_back(myInternalLanes[li]); - if(foeLinks.test(c)) { - const std::vector &l = myInternalLanes[li]->getIncomingLanes(); - if(l.size()==1&&l[0].lane->getEdge().getPurpose()==MSEdge::EDGEFUNCTION_INTERNAL) { + if (foeLinks.test(c)) { + const std::vector& l = myInternalLanes[li]->getIncomingLanes(); + if (l.size() == 1 && l[0].lane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { myLinkFoeInternalLanes[*j].push_back(l[0].lane); } } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRightOfWayJunction.h sumo-0.16.0~dfsg/src/microsim/MSRightOfWayJunction.h --- sumo-0.15.0~dfsg/src/microsim/MSRightOfWayJunction.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRightOfWayJunction.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSRightOfWayJunction.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSRightOfWayJunction.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A junction with right-of-way - rules /****************************************************************************/ @@ -72,18 +72,18 @@ #ifdef HAVE_INTERNAL_LANES std::vector internal, #endif - MSJunctionLogic* logic) ; + MSJunctionLogic* logic); /// Destructor. virtual ~MSRightOfWayJunction(); - void postloadInit() ; + void postloadInit(); - const std::vector &getFoeLinks(const MSLink* const srcLink) const { + const std::vector& getFoeLinks(const MSLink* const srcLink) const { return myLinkFoeLinks.find((MSLink*) srcLink)->second; } - const std::vector &getFoeInternalLanes(const MSLink* const srcLink) const { + const std::vector& getFoeInternalLanes(const MSLink* const srcLink) const { return myLinkFoeInternalLanes.find((MSLink*) srcLink)->second; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRoute.cpp sumo-0.16.0~dfsg/src/microsim/MSRoute.cpp --- sumo-0.15.0~dfsg/src/microsim/MSRoute.cpp 2012-02-16 15:57:40.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRoute.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Friedemann Wesner /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSRoute.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSRoute.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A vehicle route /****************************************************************************/ @@ -51,6 +51,7 @@ // =========================================================================== MSRoute::RouteDict MSRoute::myDict; MSRoute::RouteDistDict MSRoute::myDistDict; +unsigned int MSRoute::MaxRouteDistSize = std::numeric_limits::max(); // =========================================================================== @@ -58,25 +59,30 @@ // =========================================================================== MSRoute::MSRoute(const std::string& id, const MSEdgeVector& edges, - unsigned int references, const RGBColor& c, - const std::vector &stops) + unsigned int references, const RGBColor* const c, + const std::vector& stops) : Named(id), myEdges(edges), myReferenceCounter(references), myColor(c), myStops(stops) {} -MSRoute::~MSRoute() {} +MSRoute::~MSRoute() { + delete myColor; +} + MSRouteIterator MSRoute::begin() const { return myEdges.begin(); } + MSRouteIterator MSRoute::end() const { return myEdges.end(); } + unsigned MSRoute::size() const { return (unsigned) myEdges.size(); @@ -140,7 +146,7 @@ } -RandomDistributor * +RandomDistributor* MSRoute::distDictionary(const std::string& id) { RouteDistDict::iterator it2 = myDistDict.find(id); if (it2 == myDistDict.end()) { @@ -164,7 +170,7 @@ void -MSRoute::insertIDs(std::vector &into) { +MSRoute::insertIDs(std::vector& into) { into.reserve(myDict.size() + myDistDict.size() + into.size()); for (RouteDict::const_iterator i = myDict.begin(); i != myDict.end(); ++i) { into.push_back((*i).first); @@ -175,26 +181,29 @@ } -void +int MSRoute::writeEdgeIDs(OutputDevice& os, const MSEdge* const from, const MSEdge* const upTo) const { + int numWritten = 0; MSEdgeVector::const_iterator i = myEdges.begin(); if (from != 0) { i = std::find(myEdges.begin(), myEdges.end(), from); } for (; i != myEdges.end(); ++i) { if ((*i) == upTo) { - return; + return numWritten; } os << (*i)->getID(); + numWritten++; if (upTo || i != myEdges.end() - 1) { os << ' '; } } + return numWritten; } bool -MSRoute::containsAnyOf(const std::vector &edgelist) const { +MSRoute::containsAnyOf(const std::vector& edgelist) const { std::vector::const_iterator i = edgelist.begin(); for (; i != edgelist.end(); ++i) { if (contains(*i)) { @@ -211,64 +220,14 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL void MSRoute::dict_saveState(std::ostream& os) { FileHelpers::writeUInt(os, (unsigned int) myDict.size()); for (RouteDict::iterator it = myDict.begin(); it != myDict.end(); ++it) { FileHelpers::writeString(os, (*it).second->getID()); - const MSEdgeVector& edges = (*it).second->myEdges; - FileHelpers::writeUInt(os, (unsigned int)edges.size()); FileHelpers::writeUInt(os, (*it).second->myReferenceCounter); - std::vector follow; - unsigned int maxFollow = 0; - const MSEdge* prev = edges.front(); - for (MSEdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); ++i) { - unsigned int idx = 0; - for (; idx < prev->getNoFollowing(); ++idx) { - if (idx > 15) { - break; - } - if (prev->getFollower(idx) == (*i)) { - follow.push_back(idx); - if (idx > maxFollow) { - maxFollow = idx; - } - break; - } - } - if (idx > 15 || idx == prev->getNoFollowing()) { - follow.clear(); - break; - } - prev = *i; - } - if (follow.empty()) { - for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { - FileHelpers::writeInt(os, (*i)->getNumericalID()); - } - } else { - const unsigned int bits = maxFollow > 3 ? 4 : 2; - const unsigned int numFields = 8 * sizeof(unsigned int) / bits; - FileHelpers::writeInt(os, -bits); - FileHelpers::writeUInt(os, edges.front()->getNumericalID()); - unsigned int data = 0; - unsigned int field = 0; - for (std::vector::const_iterator i = follow.begin(); i != follow.end(); ++i) { - data |= *i; - field++; - if (field == numFields) { - FileHelpers::writeUInt(os, data); - data = 0; - field = 0; - } else { - data <<= bits; - } - } - if (field > 0) { - FileHelpers::writeUInt(os, data << ((numFields - field - 1) * bits)); - } - } + FileHelpers::writeEdgeVector(os, (*it).second->myEdges); } FileHelpers::writeUInt(os, (unsigned int) myDistDict.size()); for (RouteDistDict::iterator it = myDistDict.begin(); it != myDistDict.end(); ++it) { @@ -290,69 +249,14 @@ for (; numRoutes > 0; numRoutes--) { std::string id; bis >> id; - unsigned int numEdges; - bis >> numEdges; unsigned int references; bis >> references; - int first; - bis >> first; - if (first < 0) { - const unsigned int bits = -first; - const unsigned int numFields = 8 * sizeof(unsigned int) / bits; - if (dictionary(id) == 0) { - const unsigned int mask = (1 << bits) - 1; - MSEdgeVector edges; - edges.reserve(numEdges); - unsigned int edgeID; - bis >> edgeID; - const MSEdge* prev = MSEdge::dictionary(edgeID); - assert(prev != 0); - edges.push_back(prev); - numEdges--; - unsigned int data; - unsigned int field = numFields; - for (; numEdges > 0; numEdges--) { - if (field == numFields) { - bis >> data; - field = 0; - } - unsigned int followIndex = (data >> ((numFields - field - 1) * bits)) & mask; - prev = prev->getFollower(followIndex); - edges.push_back(prev); - field++; - } - MSRoute* r = new MSRoute(id, edges, references, - RGBColor::DEFAULT_COLOR, std::vector()); - dictionary(id, r); - } else { - unsigned int data; - bis >> data; // first edge id - for (int numFollows = numEdges - 1; numFollows > 0; numFollows -= numFields) { - bis >> data; - } - } - } else { - if (dictionary(id) == 0) { - MSEdgeVector edges; - edges.reserve(numEdges); - edges.push_back(MSEdge::dictionary(first)); - numEdges--; - for (; numEdges > 0; numEdges--) { - unsigned int edgeID; - bis >> edgeID; - assert(MSEdge::dictionary(edgeID) != 0); - edges.push_back(MSEdge::dictionary(edgeID)); - } - MSRoute* r = new MSRoute(id, edges, references, - RGBColor::DEFAULT_COLOR, std::vector()); - dictionary(id, r); - } else { - numEdges--; - for (; numEdges > 0; numEdges--) { - unsigned int edgeID; - bis >> edgeID; - } - } + MSEdgeVector edges; + FileHelpers::readEdgeVector(bis.getIStream(), edges, id); + if (dictionary(id) == 0) { + MSRoute* r = new MSRoute(id, edges, references, + 0, std::vector()); + dictionary(id, r); } } unsigned int numRouteDists; @@ -363,7 +267,7 @@ unsigned int no; bis >> no; if (dictionary(id) == 0) { - RandomDistributor *dist = new RandomDistributor(); + RandomDistributor* dist = new RandomDistributor(getMaxRouteDistSize(), &releaseRoute); for (; no > 0; no--) { std::string routeID; bis >> routeID; @@ -383,6 +287,8 @@ } } } + WRITE_MESSAGE(" " + toString(myDict.size()) + " routes"); + WRITE_MESSAGE(" " + toString(myDistDict.size()) + " route distributions"); } #endif @@ -442,11 +348,14 @@ const RGBColor& MSRoute::getColor() const { - return myColor; + if (myColor == 0) { + return RGBColor::DEFAULT_COLOR; + } + return *myColor; } -const std::vector & +const std::vector& MSRoute::getStops() const { return myStops; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRoute.h sumo-0.16.0~dfsg/src/microsim/MSRoute.h --- sumo-0.15.0~dfsg/src/microsim/MSRoute.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRoute.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSRoute.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSRoute.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A vehicle route /****************************************************************************/ @@ -65,11 +65,11 @@ public: /// Constructor MSRoute(const std::string& id, const MSEdgeVector& edges, - unsigned int references, const RGBColor& c, - const std::vector &stops) ; + unsigned int references, const RGBColor* const c, + const std::vector& stops); /// Destructor - virtual ~MSRoute() ; + virtual ~MSRoute(); /// Returns the begin of the list of edges to pass MSRouteIterator begin() const; @@ -89,18 +89,23 @@ /** @brief deletes the route if there are no further references to it*/ void release() const; - /// output the edge ids up to but not including the id of the given edge - void writeEdgeIDs(OutputDevice& os, const MSEdge* const from, const MSEdge* const upTo = 0) const; + /** @brief Output the edge ids up to but not including the id of the given edge + * @param[in] os The stream to write the routes into (binary) + * @param[in] from The first edge to be written + * @param[in] upTo The first edge that shall not be written + * @return The number of edges written + */ + int writeEdgeIDs(OutputDevice& os, const MSEdge* const from, const MSEdge* const upTo = 0) const; bool contains(const MSEdge* const edge) const { return std::find(myEdges.begin(), myEdges.end(), edge) != myEdges.end(); } - bool containsAnyOf(const std::vector &edgelist) const; + bool containsAnyOf(const std::vector& edgelist) const; const MSEdge* operator[](unsigned index) const; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /// @name State I/O (mesosim only) /// @{ @@ -108,14 +113,14 @@ * * @param[in] os The stream to write the routes into (binary) */ - static void dict_saveState(std::ostream& os) ; + static void dict_saveState(std::ostream& os); /** @brief Loads routes from the state. * * @param[in] bis The input to read the routes from (binary) */ - static void dict_loadState(BinaryInputDevice& bis) ; + static void dict_loadState(BinaryInputDevice& bis); /// @} #endif @@ -139,7 +144,7 @@ const RGBColor& getColor() const; /// Returns the stops - const std::vector &getStops() const; + const std::vector& getStops() const; public: /** @brief Adds a route to the dictionary. @@ -162,7 +167,7 @@ * @param[in] route pointer to the distribution object * @return whether adding was successful */ - static bool dictionary(const std::string& id, RandomDistributor *routeDist); + static bool dictionary(const std::string& id, RandomDistributor* routeDist); /** @brief Returns the named route or a sample from the named distribution. * @@ -181,13 +186,25 @@ * @param[in] id the id of the route distribution * @return the route distribution */ - static RandomDistributor *distDictionary(const std::string& id); + static RandomDistributor* distDictionary(const std::string& id); /// Clears the dictionary (delete all known routes, too) static void clear(); - static void insertIDs(std::vector &into); + static void insertIDs(std::vector& into); + + /// @brief release the route (to be used as function pointer with RandomDistributor) + static void releaseRoute(const MSRoute* route) { + route->release(); + } + + static void setMaxRouteDistSize(unsigned int size) { + MaxRouteDistSize = size; + } + static unsigned int getMaxRouteDistSize() { + return MaxRouteDistSize; + } private: /// The list of edges to pass @@ -197,7 +214,7 @@ mutable unsigned int myReferenceCounter; /// The color - RGBColor myColor; + const RGBColor* const myColor; /// @brief List of the stops on the parsed route std::vector myStops; @@ -215,6 +232,13 @@ /// The dictionary container static RouteDistDict myDistDict; + /// @brief the maximum size for each routeDistribution + static unsigned int MaxRouteDistSize; + +private: + /** invalid assignment operator */ + MSRoute& operator=(const MSRoute& s); + }; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRouteHandler.cpp sumo-0.16.0~dfsg/src/microsim/MSRouteHandler.cpp --- sumo-0.15.0~dfsg/src/microsim/MSRouteHandler.cpp 2012-03-08 00:03:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRouteHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSRouteHandler.cpp 12030 2012-03-07 10:04:10Z behrisch $ +/// @version $Id: MSRouteHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Parser and container for routes during their loading /****************************************************************************/ @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -47,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -70,15 +70,7 @@ myActivePlan(0), myAddVehiclesDirectly(addVehiclesDirectly), myCurrentVTypeDistribution(0), - myCurrentRouteDistribution(0), - myScale(-1.) { - OptionsCont& oc = OptionsCont::getOptions(); - if (oc.isSet("incremental-dua-step")) { - myScale = oc.getInt("incremental-dua-step") / static_cast(oc.getInt("incremental-dua-base")); - } - if (oc.isSet("scale")) { - myScale = oc.getFloat("scale"); - } + myCurrentRouteDistribution(0) { myActiveRoute.reserve(100); } @@ -99,6 +91,18 @@ const std::string pid = myVehicleParameter->id; bool ok = true; MSEdge* from = 0; + SUMOReal departPos = 0; + const std::string desc = attrs.getStringReporting(SUMO_ATTR_LINES, pid.c_str(), ok); + StringTokenizer st(desc); + std::string bsID = attrs.getOptStringReporting(SUMO_ATTR_BUS_STOP, 0, ok, ""); + MSBusStop* bs = 0; + if (bsID != "") { + bs = MSNet::getInstance()->getBusStop(bsID); + if (bs == 0) { + throw ProcessError("Unknown bus stop '" + bsID + "' for person '" + myVehicleParameter->id + "'."); + } + departPos = bs->getBeginLanePosition(); + } if (attrs.hasAttribute(SUMO_ATTR_FROM)) { const std::string fromID = attrs.getStringReporting(SUMO_ATTR_FROM, pid.c_str(), ok); from = MSEdge::dictionary(fromID); @@ -109,35 +113,69 @@ throw ProcessError("Disconnected plan for person '" + myVehicleParameter->id + "' (" + fromID + "!=" + myActivePlan->back()->getDestination().getID() + ")."); } if (myActivePlan->empty()) { - myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting(*from, -1, myVehicleParameter->depart)); + myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting( + *from, -1, myVehicleParameter->depart, myVehicleParameter->departPos, "start")); } + } else if (myActivePlan->empty()) { + throw ProcessError("The start edge within for person '" + pid + "' is not known."); } const std::string toID = attrs.getStringReporting(SUMO_ATTR_TO, pid.c_str(), ok); MSEdge* to = MSEdge::dictionary(toID); if (to == 0) { throw ProcessError("The to edge '" + toID + "' within a ride of person '" + pid + "' is not known."); } - const std::string desc = attrs.getStringReporting(SUMO_ATTR_LINES, pid.c_str(), ok); - StringTokenizer st(desc); - myActivePlan->push_back(new MSPerson::MSPersonStage_Driving(*to, st.getVector())); + myActivePlan->push_back(new MSPerson::MSPersonStage_Driving(*to, bs, st.getVector())); break; } case SUMO_TAG_WALK: { myActiveRoute.clear(); bool ok = true; - MSEdge::parseEdgesList(attrs.getStringReporting(SUMO_ATTR_EDGES, myVehicleParameter->id.c_str(), ok), myActiveRoute, myActiveRouteID); + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + MSEdge::parseEdgesList(attrs.getStringReporting(SUMO_ATTR_EDGES, myVehicleParameter->id.c_str(), ok), myActiveRoute, myActiveRouteID); + } else { + if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { + const std::string fromID = attrs.getStringReporting(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok); + MSEdge* from = MSEdge::dictionary(fromID); + if (from == 0) { + throw ProcessError("The from edge '" + fromID + "' within a walk of person '" + myVehicleParameter->id + "' is not known."); + } + const std::string toID = attrs.getStringReporting(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok); + MSEdge* to = MSEdge::dictionary(toID); + if (to == 0) { + throw ProcessError("The to edge '" + toID + "' within a walk of person '" + myVehicleParameter->id + "' is not known."); + } + MSNet::getInstance()->getRouterTT().compute(from, to, 0, 0, myActiveRoute); // @todo: only footways, current time? + } + } if (myActiveRoute.empty()) { throw ProcessError("No edges to walk for person '" + myVehicleParameter->id + "'."); } if (!myActivePlan->empty() && &myActivePlan->back()->getDestination() != myActiveRoute.front()) { throw ProcessError("Disconnected plan for person '" + myVehicleParameter->id + "' (" + myActiveRoute.front()->getID() + "!=" + myActivePlan->back()->getDestination().getID() + ")."); } + SUMOReal departPos = attrs.getOptSUMORealReporting(SUMO_ATTR_DEPARTPOS, myVehicleParameter->id.c_str(), ok, 0); + SUMOReal arrivalPos = attrs.getOptSUMORealReporting(SUMO_ATTR_ARRIVALPOS, myVehicleParameter->id.c_str(), ok, -1); + const SUMOTime duration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_DURATION, 0, ok, -1); + SUMOReal speed = DEFAULT_PERSON_SPEED; + if (attrs.hasAttribute(SUMO_ATTR_SPEED)) { + speed = attrs.getOptSUMORealReporting(SUMO_ATTR_SPEED, 0, ok, speed); + if (speed < 0) { + throw ProcessError("Negative walking speed for '" + myVehicleParameter->id + "'."); + } + } + std::string bsID = attrs.getOptStringReporting(SUMO_ATTR_BUS_STOP, 0, ok, ""); + MSBusStop* bs = 0; + if (bsID != "") { + bs = MSNet::getInstance()->getBusStop(bsID); + if (bs == 0) { + throw ProcessError("Unknown bus stop '" + bsID + "' for person '" + myVehicleParameter->id + "'."); + } + } if (myActivePlan->empty()) { - myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting(*myActiveRoute.front(), -1, myVehicleParameter->depart)); + myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting( + *myActiveRoute.front(), -1, myVehicleParameter->depart, departPos, "start")); } - const SUMOTime duration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_DURATION, 0, ok, -1); - const SUMOReal speed = attrs.getOptSUMORealReporting(SUMO_ATTR_SPEED, 0, ok, -1); - myActivePlan->push_back(new MSPerson::MSPersonStage_Walking(myActiveRoute, duration, speed)); + myActivePlan->push_back(new MSPerson::MSPersonStage_Walking(myActiveRoute, bs, duration, speed, departPos, arrivalPos)); myActiveRoute.clear(); break; } @@ -152,7 +190,6 @@ closeRoute(); } break; - case SUMO_TAG_TRIP__DEPRECATED: case SUMO_TAG_TRIP: { bool ok = true; if (attrs.hasAttribute(SUMO_ATTR_FROM) || !myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) { @@ -178,7 +215,7 @@ break; } // parse embedded vtype information - if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE && element != SUMO_TAG_VTYPE__DEPRECATED) { + if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE) { SUMOVehicleParserHelper::parseVTypeEmbedded(*myCurrentVType, element, attrs); return; } @@ -191,7 +228,7 @@ myCurrentVTypeDistributionID = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); if (ok) { myCurrentVTypeDistribution = new RandomDistributor(); - if (attrs.hasAttribute(SUMO_ATTR_VTYPES) || attrs.hasAttribute(SUMO_ATTR_VTYPES__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_VTYPES)) { const std::string vTypes = attrs.getStringReporting(SUMO_ATTR_VTYPES, myCurrentVTypeDistributionID.c_str(), ok); StringTokenizer st(vTypes); while (st.hasNext()) { @@ -256,7 +293,7 @@ WRITE_ERROR("Invalid reference to route '" + myActiveRouteRefID + "' in route " + rid + "."); } myActiveRouteProbability = attrs.getOptSUMORealReporting(SUMO_ATTR_PROB, myActiveRouteID.c_str(), ok, DEFAULT_VEH_PROB); - myActiveRouteColor = attrs.hasAttribute(SUMO_ATTR_COLOR) ? RGBColor::parseColorReporting(attrs.getString(SUMO_ATTR_COLOR), attrs.getObjectType(), myActiveRouteID.c_str(), true, ok) : RGBColor::getDefaultColor(); + myActiveRouteColor = attrs.hasAttribute(SUMO_ATTR_COLOR) ? new RGBColor(attrs.getColorReporting(myActiveRouteID.c_str(), ok)) : 0; } @@ -271,11 +308,11 @@ if (!MSNet::getInstance()->getVehicleControl().addVType(vehType)) { const std::string id = vehType->getID(); delete vehType; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (!MSGlobals::gStateLoaded) { #endif throw ProcessError("Another vehicle type (or distribution) with the id '" + id + "' exists."); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif } else { @@ -294,6 +331,8 @@ void MSRouteHandler::closeRoute() { if (myActiveRoute.size() == 0) { + delete myActiveRouteColor; + myActiveRouteColor = 0; if (myActiveRouteRefID != "" && myCurrentRouteDistribution != 0) { myCurrentRouteDistribution->add(myActiveRouteProbability, MSRoute::dictionary(myActiveRouteRefID)); myActiveRouteID = ""; @@ -312,7 +351,7 @@ myActiveRoute.clear(); if (!MSRoute::dictionary(myActiveRouteID, route)) { delete route; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (!MSGlobals::gStateLoaded) { #endif if (myVehicleParameter != 0) { @@ -324,7 +363,7 @@ } else { throw ProcessError("Another route (or distribution) with the id '" + myActiveRouteID + "' exists."); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif } else { @@ -333,6 +372,7 @@ } } myActiveRouteID = ""; + myActiveRouteColor = 0; myActiveRouteStops.clear(); } @@ -351,17 +391,32 @@ return; } } - myCurrentRouteDistribution = new RandomDistributor(); + myCurrentRouteDistribution = new RandomDistributor(MSRoute::getMaxRouteDistSize(), &MSRoute::releaseRoute); + std::vector probs; + if (attrs.hasAttribute(SUMO_ATTR_PROBS)) { + bool ok = true; + StringTokenizer st(attrs.getStringReporting(SUMO_ATTR_PROBS, myCurrentRouteDistributionID.c_str(), ok)); + while (st.hasNext()) { + probs.push_back(TplConvert::_2SUMORealSec(st.next().c_str(), 1.0)); + } + } if (attrs.hasAttribute(SUMO_ATTR_ROUTES)) { bool ok = true; StringTokenizer st(attrs.getStringReporting(SUMO_ATTR_ROUTES, myCurrentRouteDistributionID.c_str(), ok)); + size_t probIndex = 0; while (st.hasNext()) { std::string routeID = st.next(); const MSRoute* route = MSRoute::dictionary(routeID); if (route == 0) { throw ProcessError("Unknown route '" + routeID + "' in distribution '" + myCurrentRouteDistributionID + "'."); } - myCurrentRouteDistribution->add(1., route, false); + const SUMOReal prob = (probs.size() > probIndex ? probs[probIndex] : 1.0); + myCurrentRouteDistribution->add(prob, route, false); + probIndex++; + } + if (probs.size() > 0 && probIndex != probs.size()) { + WRITE_WARNING("Got " + toString(probs.size()) + " probabilities for " + toString(probIndex) + + " routes in routeDistribution '" + myCurrentRouteDistributionID + "'"); } } } @@ -427,7 +482,7 @@ if (vehControl.getVehicle(myVehicleParameter->id) == 0) { vehicle = vehControl.buildVehicle(myVehicleParameter, route, vtype); // maybe we do not want this vehicle to be inserted due to scaling - if (myScale < 0 || vehControl.isInQuota(myScale)) { + if (vehControl.isInQuota()) { // add the vehicle to the vehicle control vehControl.addVehicle(myVehicleParameter->id, vehicle); if (myVehicleParameter->departProcedure == DEPART_TRIGGERED) { @@ -443,13 +498,13 @@ } } else { // strange: another vehicle with the same id already exists -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (!MSGlobals::gStateLoaded) { #endif // and was not loaded while loading a simulation state // -> error throw ProcessError("Another vehicle with the id '" + myVehicleParameter->id + "' exists."); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } else { // ok, it seems to be loaded previously while loading a simulation state vehicle = 0; @@ -471,10 +526,14 @@ if (myActivePlan->size() == 0) { throw ProcessError("Person '" + myVehicleParameter->id + "' has no plan."); } - MSPerson* person = new MSPerson(myVehicleParameter, myActivePlan); + MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid); + if (type == 0) { + throw ProcessError("The type '" + myVehicleParameter->vtypeid + "' for person '" + myVehicleParameter->id + "' is not known."); + } + MSPerson* person = MSNet::getInstance()->getPersonControl().buildPerson(myVehicleParameter, type, myActivePlan); // @todo: consider myScale? if ((myAddVehiclesDirectly || checkLastDepart()) && MSNet::getInstance()->getPersonControl().add(myVehicleParameter->id, person)) { - MSNet::getInstance()->getPersonControl().setArrival(myVehicleParameter->depart, person); + MSNet::getInstance()->getPersonControl().setDeparture(myVehicleParameter->depart, person); registerLastDepart(); } else { delete person; @@ -486,7 +545,6 @@ void MSRouteHandler::closeFlow() { - // @todo: consider myScale? // let's check whether vehicles had to depart before the simulation starts myVehicleParameter->repetitionsDone = 0; SUMOTime offsetToBegin = string2time(OptionsCont::getOptions().getString("begin")) - myVehicleParameter->depart; @@ -567,15 +625,19 @@ &myActivePlan->back()->getDestination() != &MSLane::dictionary(stop.lane)->getEdge()) { throw ProcessError("Disconnected plan for person '" + myVehicleParameter->id + "' (" + MSLane::dictionary(stop.lane)->getEdge().getID() + "!=" + myActivePlan->back()->getDestination().getID() + ")."); } + if (myActivePlan && myActivePlan->empty()) { + myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting( + MSLane::dictionary(stop.lane)->getEdge(), -1, myVehicleParameter->depart, myVehicleParameter->departPos, "start")); + } stop.endPos = attrs.getOptSUMORealReporting(SUMO_ATTR_ENDPOS, 0, ok, MSLane::dictionary(stop.lane)->getLength()); if (attrs.hasAttribute(SUMO_ATTR_POSITION)) { WRITE_WARNING("Deprecated attribute 'pos' in description of stop" + errorSuffix); stop.endPos = attrs.getOptSUMORealReporting(SUMO_ATTR_POSITION, 0, ok, stop.endPos); } - stop.startPos = attrs.getOptSUMORealReporting(SUMO_ATTR_STARTPOS, 0, ok, stop.endPos - 2 * POSITION_EPS); + stop.startPos = attrs.getOptSUMORealReporting(SUMO_ATTR_STARTPOS, 0, ok, MAX2(0., stop.endPos - 2 * POSITION_EPS)); const bool friendlyPos = attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, 0, ok, false); if (!ok || !checkStopPos(stop.startPos, stop.endPos, MSLane::dictionary(stop.lane)->getLength(), POSITION_EPS, friendlyPos)) { - WRITE_ERROR("Invalid start or end position for stop" + errorSuffix); + WRITE_ERROR("Invalid start or end position for stop on lane '" + stop.lane + "'" + errorSuffix); return; } } @@ -589,14 +651,14 @@ stop.duration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_DURATION, 0, ok, -1); stop.until = attrs.getOptSUMOTimeReporting(SUMO_ATTR_UNTIL, 0, ok, -1); if (!ok || (stop.duration < 0 && stop.until < 0)) { - WRITE_ERROR("Invalid duration or end time is given for a stop" + errorSuffix); + WRITE_ERROR("Invalid duration or end time is given for a stop on lane '" + stop.lane + "'" + errorSuffix); return; } stop.triggered = attrs.getOptBoolReporting(SUMO_ATTR_TRIGGERED, 0, ok, false); } stop.parking = attrs.getOptBoolReporting(SUMO_ATTR_PARKING, 0, ok, stop.triggered); if (!ok) { - WRITE_ERROR("Invalid bool for 'triggered' or 'parking' for stop" + errorSuffix); + WRITE_ERROR("Invalid bool for 'triggered' or 'parking' for stop on lane '" + stop.lane + "'" + errorSuffix); return; } const std::string idx = attrs.getOptStringReporting(SUMO_ATTR_INDEX, 0, ok, "end"); @@ -607,14 +669,16 @@ } else { stop.index = attrs.getIntReporting(SUMO_ATTR_INDEX, 0, ok); if (!ok || stop.index < 0) { - WRITE_ERROR("Invalid 'index' for stop" + errorSuffix); + WRITE_ERROR("Invalid 'index' for stop on lane '" + stop.lane + "'" + errorSuffix); return; } } if (myActiveRouteID != "") { myActiveRouteStops.push_back(stop); } else if (myActivePlan) { - myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting(MSLane::dictionary(stop.lane)->getEdge(), stop.duration, stop.until)); + std::string actType = attrs.getOptStringReporting(SUMO_ATTR_ACTTYPE, 0, ok, "waiting"); + myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting( + MSLane::dictionary(stop.lane)->getEdge(), stop.duration, stop.until, stop.startPos, actType)); } else { myVehicleParameter->stops.push_back(stop); } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRouteHandler.h sumo-0.16.0~dfsg/src/microsim/MSRouteHandler.h --- sumo-0.15.0~dfsg/src/microsim/MSRouteHandler.h 2012-03-07 00:02:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRouteHandler.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSRouteHandler.h 12019 2012-03-06 11:31:59Z behrisch $ +/// @version $Id: MSRouteHandler.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Parser and container for routes during their loading /****************************************************************************/ @@ -64,7 +64,7 @@ bool addVehiclesDirectly); /// standard destructor - virtual ~MSRouteHandler() ; + virtual ~MSRouteHandler(); protected: /// @name inherited from GenericSAXHandler @@ -78,7 +78,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -87,7 +87,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - virtual void myEndElement(int element) ; + virtual void myEndElement(int element); //@} @@ -105,7 +105,7 @@ this method may throw exceptions when a) the route is empty or b) another route with the same id already exists */ - void closeRoute() ; + void closeRoute(); /** opens a route distribution for reading */ void openRouteDistribution(const SUMOSAXAttributes& attrs); @@ -114,16 +114,16 @@ void closeRouteDistribution(); /// Ends the processing of a vehicle - void closeVehicle() ; + void closeVehicle(); /// Ends the processing of a person - void closePerson() ; + void closePerson(); /// Ends the processing of a flow - void closeFlow() ; + void closeFlow(); /// Processing of a stop - void addStop(const SUMOSAXAttributes& attrs) ; + void addStop(const SUMOSAXAttributes& attrs); protected: /// @brief The current route @@ -136,20 +136,17 @@ bool myAddVehiclesDirectly; /// @brief The currently parsed distribution of vehicle types (probability->vehicle type) - RandomDistributor *myCurrentVTypeDistribution; + RandomDistributor* myCurrentVTypeDistribution; /// @brief The id of the currently parsed vehicle type distribution std::string myCurrentVTypeDistributionID; /// @brief The currently parsed distribution of routes (probability->route) - RandomDistributor *myCurrentRouteDistribution; + RandomDistributor* myCurrentRouteDistribution; /// @brief The id of the currently parsed route distribution std::string myCurrentRouteDistributionID; - /// @brief The scaling factor (especially for inc-dua) - SUMOReal myScale; - private: /// @brief Invalidated copy constructor MSRouteHandler(const MSRouteHandler& s); diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRouteLoader.cpp sumo-0.16.0~dfsg/src/microsim/MSRouteLoader.cpp --- sumo-0.15.0~dfsg/src/microsim/MSRouteLoader.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRouteLoader.cpp 2012-11-05 00:02:22.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 6 Nov 2002 -/// @version $Id: MSRouteLoader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSRouteLoader.cpp 12927 2012-11-04 06:47:13Z behrisch $ /// // A class that performs the loading of routes /****************************************************************************/ @@ -60,7 +60,7 @@ void MSRouteLoader::init() { myMoreAvailable = true; - if (!myParser->parseFirst(myHandler->getFileName().c_str(), myToken)) { + if (!myParser->parseFirst(myHandler->getFileName())) { throw ProcessError("Can not read XML-file '" + myHandler->getFileName() + "'."); } } @@ -77,7 +77,7 @@ // read vehicles until specified time or the period to read vehicles // until is reached - while (myParser->parseNext(myToken)) { + while (myParser->parseNext()) { // return when the last read vehicle is beyond the period if (time <= myHandler->getLastDepart()) { return; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRouteLoader.h sumo-0.16.0~dfsg/src/microsim/MSRouteLoader.h --- sumo-0.15.0~dfsg/src/microsim/MSRouteLoader.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRouteLoader.h 2012-11-05 00:02:22.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 6 Nov 2002 -/// @version $Id: MSRouteLoader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSRouteLoader.h 12927 2012-11-04 06:47:13Z behrisch $ /// // A class that performs the loading of routes /****************************************************************************/ @@ -31,10 +31,9 @@ #include #endif -#include #include +#include #include -#include "MSVehicleContainer.h" #include "MSRouteHandler.h" @@ -64,10 +63,7 @@ bool moreAvailable() const; private: /// the used SAX2XMLReader - SAX2XMLReader* myParser; - - /// the token for saving the current position - XMLPScanToken myToken; + SUMOSAXReader* myParser; /// information whether more vehicles should be available bool myMoreAvailable; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRouteLoaderControl.cpp sumo-0.16.0~dfsg/src/microsim/MSRouteLoaderControl.cpp --- sumo-0.15.0~dfsg/src/microsim/MSRouteLoaderControl.cpp 2012-01-21 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRouteLoaderControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 06 Nov 2002 -/// @version $Id: MSRouteLoaderControl.cpp 11755 2012-01-20 13:01:25Z namdre $ +/// @version $Id: MSRouteLoaderControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Class responsible for loading of routes from some files /****************************************************************************/ @@ -41,12 +41,11 @@ // =========================================================================== // method definitions // =========================================================================== -MSRouteLoaderControl::MSRouteLoaderControl(MSNet&, SUMOTime inAdvanceStepNo, LoaderVector loader): +MSRouteLoaderControl::MSRouteLoaderControl(MSNet&, SUMOTime inAdvanceStepNo, LoaderVector loader): myLastLoadTime(-inAdvanceStepNo), myInAdvanceStepNo(inAdvanceStepNo), myRouteLoaders(loader), - myAllLoaded(false) -{ + myAllLoaded(false) { myLoadAll = myInAdvanceStepNo <= 0; myAllLoaded = false; myLastLoadTime = -1 * (int) myInAdvanceStepNo; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSRouteLoaderControl.h sumo-0.16.0~dfsg/src/microsim/MSRouteLoaderControl.h --- sumo-0.15.0~dfsg/src/microsim/MSRouteLoaderControl.h 2012-01-21 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSRouteLoaderControl.h 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Wed, 06 Nov 2002 -/// @version $Id: MSRouteLoaderControl.h 11755 2012-01-20 13:01:25Z namdre $ +/// @version $Id: MSRouteLoaderControl.h 12392 2012-06-15 08:54:23Z dkrajzew $ /// // Class responsible for loading of routes from some files /****************************************************************************/ @@ -33,7 +33,6 @@ #endif #include -#include "MSVehicleContainer.h" #include "MSNet.h" diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicle.cpp sumo-0.16.0~dfsg/src/microsim/MSVehicle.cpp --- sumo-0.15.0~dfsg/src/microsim/MSVehicle.cpp 2012-03-10 00:03:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicle.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -12,7 +12,7 @@ /// @author Axel Wegener /// @author Christoph Sommer /// @date Mon, 05 Mar 2001 -/// @version $Id: MSVehicle.cpp 12044 2012-03-09 10:13:42Z namdre $ +/// @version $Id: MSVehicle.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a vehicle in the micro simulation /****************************************************************************/ @@ -75,7 +75,7 @@ #include "MSMessageEmitter.h" #endif -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #include "MSGlobals.h" @@ -152,14 +152,14 @@ void -MSVehicle::Influencer::setSpeedTimeLine(const std::vector > &speedTimeLine) { +MSVehicle::Influencer::setSpeedTimeLine(const std::vector >& speedTimeLine) { mySpeedAdaptationStarted = true; mySpeedTimeLine = speedTimeLine; } void -MSVehicle::Influencer::setLaneTimeLine(const std::vector > &laneTimeLine) { +MSVehicle::Influencer::setLaneTimeLine(const std::vector >& laneTimeLine) { myLaneTimeLine = laneTimeLine; } @@ -269,20 +269,21 @@ MSVehicle::MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type, + SUMOReal speedFactor, int /*vehicleIndex*/) : - MSBaseVehicle(pars, route, type), + MSBaseVehicle(pars, route, type, speedFactor), myLastLaneChangeOffset(0), myWaitingTime(0), myState(0, 0), // myLane(0), myLastBestLanesEdge(0), myPersonDevice(0), - myPreDawdleAcceleration(0), + myAcceleration(0), mySignals(0), myAmOnNet(false), myAmRegisteredAsWaitingForPerson(false), - myEdgeWeights(0), - myHaveToWaitOnNextLink(false) + myHaveToWaitOnNextLink(false), + myEdgeWeights(0) #ifndef NO_TRACI , myInfluencer(0) #endif @@ -303,7 +304,7 @@ if (depLane == 0) { throw ProcessError("Invalid departlane definition for vehicle '" + pars->id + "'."); } - if (pars->departSpeedProcedure == DEPART_SPEED_GIVEN && pars->departSpeed > depLane->getMaxSpeed()) { + if (pars->departSpeedProcedure == DEPART_SPEED_GIVEN && pars->departSpeed > depLane->getSpeedLimit()) { throw ProcessError("Departure speed for vehicle '" + pars->id + "' is too high for the departure lane '" + depLane->getID() + "'."); } @@ -335,7 +336,7 @@ // ------------ interaction with the route bool -MSVehicle::ends() const { +MSVehicle::hasArrived() const { return myCurrEdge == myRoute->end() - 1 && myState.myPos > myArrivalPos - POSITION_EPS; } @@ -384,8 +385,35 @@ } +unsigned int +MSVehicle::getRoutePosition() const { + return (unsigned int) std::distance(myRoute->begin(), myCurrEdge); +} + + +void +MSVehicle::resetRoutePosition(unsigned int index) { + myCurrEdge = myRoute->begin() + index; + // !!! hack + myArrivalPos = (*(myRoute->end() - 1))->getLanes()[0]->getLength(); +} + + + +const MSEdgeWeightsStorage& +MSVehicle::getWeightsStorage() const { + return _getWeightsStorage(); +} + + MSEdgeWeightsStorage& MSVehicle::getWeightsStorage() { + return _getWeightsStorage(); +} + + +MSEdgeWeightsStorage& +MSVehicle::_getWeightsStorage() const { if (myEdgeWeights == 0) { myEdgeWeights = new MSEdgeWeightsStorage(); } @@ -436,7 +464,7 @@ MSVehicle::getAngle() const { Position p1 = myLane->getShape().positionAtLengthPosition(myState.pos()); Position p2 = myFurtherLanes.size() > 0 - ? myFurtherLanes.front()->getShape().positionAtLengthPosition(myFurtherLanes.front()->getPartialOccupatorEnd()) + ? myFurtherLanes.back()->getShape().positionAtLengthPosition(myFurtherLanes.back()->getPartialOccupatorEnd()) : myLane->getShape().positionAtLengthPosition(myState.pos() - myType->getLength()); if (p1 != p2) { return atan2(p1.x() - p2.x(), p2.y() - p1.y()) * 180. / PI; @@ -496,7 +524,8 @@ stop.edge = find(prevStopEdge, myRoute->end(), &stop.lane->getEdge()); } } - if (stop.edge == myRoute->end() || prevStopEdge > stop.edge || prevStopEdge == stop.edge && prevStopPos > stop.endPos) { + if (stop.edge == myRoute->end() || prevStopEdge > stop.edge || + (prevStopEdge == stop.edge && prevStopPos > stop.endPos)) { return false; } if (myCurrEdge == stop.edge && myState.myPos > stop.endPos - getCarFollowModel().brakeGap(myState.mySpeed)) { @@ -531,6 +560,12 @@ // any waiting persons may board now bool boarded = MSNet::getInstance()->getPersonControl().boardAnyWaiting(&myLane->getEdge(), this); if (boarded) { + if (stop.busstop != 0) { + const std::vector& persons = myPersonDevice->getPersons(); + for (std::vector::const_iterator i = persons.begin(); i != persons.end(); ++i) { + stop.busstop->removePerson(*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) { @@ -601,11 +636,8 @@ } -bool -MSVehicle::moveRegardingCritical(SUMOTime t, const MSLane* const lane, - const MSVehicle* const pred, - const MSVehicle* const neigh, - SUMOReal lengthsInFront) { +void +MSVehicle::move(SUMOTime t, MSLane* lane, MSVehicle* pred, MSVehicle* neigh, SUMOReal lengthsInFront) { #ifdef _MESSAGES if (myHBMsgEmitter != 0) { if (isOnRoad()) { @@ -628,66 +660,151 @@ myLFLinkLanes.clear(); // const MSCFModel& cfModel = getCarFollowModel(); - SUMOReal vBeg = MIN2(cfModel.maxNextSpeed(myState.mySpeed), lane->getMaxSpeed()); - // check whether the vehicle is not on an appropriate lane - bool onAppropriateLane = myLane->appropriate(this); - if (!onAppropriateLane) { - // decelerate to lane end when yes - SUMOReal place = MIN2(myLane->getLength() - (SUMOReal)POSITION_EPS, getVehicleType().getMinGap()); - vBeg = MIN2(cfModel.stopSpeed(this, myLane->getLength() - myState.myPos - place), myLane->getMaxSpeed()); - } - if (myCurrEdge == myRoute->end() - 1) { - if (myParameter->arrivalSpeedProcedure == ARRIVAL_SPEED_GIVEN) { - vBeg = MIN2(cfModel.freeSpeed(this, getSpeed(), myArrivalPos - myState.myPos, myParameter->arrivalSpeed), myLane->getMaxSpeed()); - } else { - vBeg = myLane->getMaxSpeed(); - } + // vBeg is the initial maximum velocity of this vehicle in this step + SUMOReal v = MIN2(cfModel.maxNextSpeed(myState.mySpeed), lane->getVehicleMaxSpeed(this)); +#ifndef NO_TRACI + if (myInfluencer != 0) { + SUMOReal vMin = MAX2(SUMOReal(0), getVehicleType().getCarFollowModel().getSpeedAfterMaxDecel(myState.mySpeed)); + SUMOReal vMax = getVehicleType().getCarFollowModel().maxNextSpeed(myState.mySpeed); + v = myInfluencer->influenceSpeed(MSNet::getInstance()->getCurrentTimeStep(), v, v, vMin, vMax); + // !!! recheck - why is it done, here? } - // interaction with leader - if (pred != 0) { - // interaction with leader if one exists on same lane - SUMOReal gap = gap2pred(*pred); - if (MSGlobals::gCheck4Accidents && gap < 0) { - // collision occured! - return true; +#endif + + SUMOReal vehicleLength = getVehicleType().getLength(); + SUMOReal maxV = cfModel.maxNextSpeed(myState.mySpeed); + SUMOReal dist = SPEED2DIST(maxV) + cfModel.brakeGap(maxV); + const std::vector& bestLaneConts = getBestLanesContinuation(); +#ifdef HAVE_INTERNAL_LANES + bool hadNonInternal = false; +#else + bool hadNonInternal = true; +#endif + SUMOReal seen = lane->getLength() - myState.myPos; // the distance already "seen"; in the following always up to the end of the current "lane" + SUMOReal seenNonInternal = 0; + cfModel.leftVehicleVsafe(this, neigh, v); + unsigned int view = 0; + bool firstLane = true; + int lastLink = -1; + std::pair leaderInfo = pred != 0 ? std::pair(pred, gap2pred(*pred)) : std::pair((MSVehicle*) 0, 0); + while (true) { + SUMOReal laneStopOffset = lane->getLength() > getVehicleType().getMinGap() ? getVehicleType().getMinGap() : POSITION_EPS; + SUMOReal stopDist = MAX2(SUMOReal(0), seen - laneStopOffset); + // check leader on lane + // leader is given for the first edge only + if (!firstLane) { + leaderInfo = lane->getLastVehicleInformation(); + leaderInfo.second = leaderInfo.second + seen - lane->getLength() - getVehicleType().getMinGap(); + } else if (leaderInfo.first == 0) { + // we still have to account vehicles lapping into the lane we are currently at + if (myLane->getPartialOccupator() != 0) { + leaderInfo = std::pair(myLane->getPartialOccupator(), myLane->getPartialOccupatorEnd() - myState.myPos - getVehicleType().getMinGap()); + } + } + if (leaderInfo.first != 0) { + SUMOReal vsafeLeader = 0; + if (leaderInfo.second >= 0) { + vsafeLeader = cfModel.followSpeed(this, getSpeed(), leaderInfo.second, leaderInfo.first->getSpeed(), leaderInfo.first->getCarFollowModel().getMaxDecel()); + } else { + // the leading, in-lapping vehicle is occupying the complete next lane + // stop before entering this lane + vsafeLeader = cfModel.stopSpeed(this, seen - lane->getLength() - POSITION_EPS); + } + if (lastLink > 0) { + myLFLinkLanes[lastLink].adaptLeaveSpeed(vsafeLeader); + } + v = MIN2(v, vsafeLeader); } - vBeg = MIN2(vBeg, cfModel.followSpeed(this, getSpeed(), gap2pred(*pred), pred->getSpeed(), pred->getCarFollowModel().getMaxDecel())); - } else { - // (potential) interaction with a vehicle extending partially into this lane - MSVehicle* predP = myLane->getPartialOccupator(); - if (predP != 0 && predP != this) { - SUMOReal gap = myLane->getPartialOccupatorEnd() - myState.myPos - getVehicleType().getMinGap(); - if (MSGlobals::gCheck4Accidents && gap < 0) { - // collision occured! - return true; - } - vBeg = MIN2(vBeg, cfModel.followSpeed(this, getSpeed(), gap, predP->getSpeed(), predP->getCarFollowModel().getMaxDecel())); - } - } - // interaction with left-lane leader (do not overtake right) - cfModel.leftVehicleVsafe(this, neigh, vBeg); - // check whether the vehicle wants to stop somewhere - if (!myStops.empty() && &myStops.begin()->lane->getEdge() == &lane->getEdge()) { - const Stop& stop = *myStops.begin(); - SUMOReal stopPos = stop.busstop == 0 ? stop.endPos : stop.busstop->getLastFreePos(*this) - POSITION_EPS; - SUMOReal seen = lane->getLength() - myState.pos(); - SUMOReal vsafeStop = cfModel.stopSpeed(this, seen - (lane->getLength() - stopPos)); - vBeg = MIN2(vBeg, vsafeStop); - } - vBeg = MAX2((SUMOReal) 0, vBeg); -#ifdef _DEBUG - if (vBeg < cfModel.getSpeedAfterMaxDecel(myState.mySpeed)) { - WRITE_WARNING("Vehicle '" + getID() + "' is decelerating too much (#1; is: " + toString(myState.mySpeed - vBeg) + ", may: " + toString(cfModel.getSpeedAfterMaxDecel(myState.mySpeed)) + ")"); - } + + // process stops + if (!myStops.empty() && &myStops.begin()->lane->getEdge() == &lane->getEdge()) { + // we are approaching a stop on the edge; must not drive further + const Stop& stop = *myStops.begin(); + SUMOReal stopDist = stop.busstop == 0 ? seen + stop.endPos - lane->getLength() : seen + stop.busstop->getLastFreePos(*this) - POSITION_EPS - lane->getLength(); + SUMOReal stopSpeed = cfModel.stopSpeed(this, stopDist); + if (lastLink > 0) { + myLFLinkLanes[lastLink].adaptLeaveSpeed(stopSpeed); + } + v = MIN2(v, stopSpeed); + myLFLinkLanes.push_back(DriveProcessItem(0, v, v, false, 0, 0, stopDist)); + break; + } + + // move to next lane + // get the next link used + MSLinkCont::const_iterator link = myLane->succLinkSec(*this, view + 1, *lane, bestLaneConts); + // check whether the vehicle is on its final edge + bool onAppropriateLane = !lane->isLinkEnd(link); // !!! wird "appropriate" noch benutzt? + bool routeEnds = myCurrEdge + view + 1 == myRoute->end(); + if (routeEnds) { + const SUMOReal arrivalSpeed = (myParameter->arrivalSpeedProcedure == ARRIVAL_SPEED_GIVEN ? + myParameter->arrivalSpeed : lane->getVehicleMaxSpeed(this)); + const SUMOReal va = cfModel.freeSpeed(this, getSpeed(), seen + myArrivalPos - lane->getLength(), arrivalSpeed); + v = MIN2(v, va); + if (lastLink > 0) { + myLFLinkLanes[lastLink].adaptLeaveSpeed(va); + } + myLFLinkLanes.push_back(DriveProcessItem(0, v, v, false, 0, 0, seen)); + break; + } + // check whether the lane is a dead end + if (!onAppropriateLane) { + if (!routeEnds) { + SUMOReal va = MIN2(cfModel.stopSpeed(this, stopDist), lane->getVehicleMaxSpeed(this)); + if (lastLink > 0) { + myLFLinkLanes[lastLink].adaptLeaveSpeed(va); + } + v = MIN2(va, v); + } + myLFLinkLanes.push_back(DriveProcessItem(0, v, v, false, 0, 0, seen)); + break; + } + + bool yellow = (*link)->getState() == LINKSTATE_TL_YELLOW_MAJOR || (*link)->getState() == LINKSTATE_TL_YELLOW_MINOR; + bool red = (*link)->getState() == LINKSTATE_TL_RED; + bool setRequest = v > 0; // even if red, if we cannot break we should issue a request + SUMOReal vLinkPass = v; + SUMOReal vLinkWait = MIN2(v, cfModel.stopSpeed(this, stopDist)); + if ((yellow || red) && seen > cfModel.brakeGap(myState.mySpeed) - myState.mySpeed * cfModel.getHeadwayTime()) { + // the vehicle is able to brake in front of a yellow/red traffic light + myLFLinkLanes.push_back(DriveProcessItem(*link, vLinkWait, vLinkWait, false, t + TIME2STEPS(seen / vLinkPass), vLinkPass, stopDist)); + break; + } + SUMOReal va = firstLane ? v : lane->getVehicleMaxSpeed(this); + if (lastLink > 0) { + myLFLinkLanes[lastLink].adaptLeaveSpeed(va); + } //if(!myLFLinkLanes.empty()) { myLFLinkLanes.back().accelV = va; } + lastLink = (int)myLFLinkLanes.size(); + myLFLinkLanes.push_back(DriveProcessItem(*link, vLinkPass, vLinkWait, setRequest, t + TIME2STEPS(seen / vLinkPass), vLinkPass, stopDist)); + + // get the following lane + lane = (*link)->getViaLaneOrLane(); +#ifdef HAVE_INTERNAL_LANES + if ((*link)->getViaLane() == 0) { + hadNonInternal = true; + ++view; + } +#else + ++view; #endif - if (!onAppropriateLane) { - myLFLinkLanes.push_back(DriveProcessItem(0, vBeg, vBeg, false, 0, 0, myLane->getLength() - myState.myPos - getVehicleType().getMinGap())); - } else { - // check whether the driver wants to let someone in - vsafeCriticalCont(t, vBeg); - checkRewindLinkLanes(lengthsInFront); + // estimate leave speed for passing time computation + SUMOReal v1 = 2 * (*link)->getLength() * getVehicleType().getCarFollowModel().getMaxAccel() + vLinkPass; + SUMOReal leaveSpeed = MIN2(lane->getVehicleMaxSpeed(this), (SUMOReal)sqrt(v1)); + myLFLinkLanes[lastLink].adaptLeaveSpeed(leaveSpeed); + + firstLane = false; + if (!setRequest || ((vLinkPass <= 0 || seen > dist) && hadNonInternal && seenNonInternal > vehicleLength * 2)) { + break; + } + // the link was passed + // compute the velocity to use when the link is not blocked by other vehicles + // the vehicle shall be not faster when reaching the next lane than allowed + va = MAX2(lane->getVehicleMaxSpeed(this), cfModel.freeSpeed(this, getSpeed(), seen, lane->getVehicleMaxSpeed(this))); + v = MIN2(va, vLinkPass); + seenNonInternal += lane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL ? 0 : lane->getLength(); + seen += lane->getLength(); } - return false; + checkRewindLinkLanes(lengthsInFront); } @@ -722,7 +839,7 @@ break; } // - const bool opened = yellow || link->opened((*i).myArrivalTime, (*i).myArrivalSpeed, getVehicleType().getLengthWithGap()); + const bool opened = yellow || link->opened((*i).myArrivalTime, (*i).myArrivalSpeed, (*i).getLeaveSpeed(), getVehicleType().getLengthWithGap()); // vehicles should decelerate when approaching a minor link if (opened && !lastWasGreenCont && !link->havePriority() && (*i).myDistance > getCarFollowModel().getMaxDecel()) { vSafe = (*i).myVLinkWait; @@ -752,7 +869,6 @@ break; } } - if (braking) { myHaveToWaitOnNextLink = true; } @@ -800,6 +916,7 @@ } #endif // update position and speed + myAcceleration = vNext - myState.mySpeed; myState.myPos += SPEED2DIST(vNext); myState.mySpeed = vNext; std::vector passedLanes; @@ -809,13 +926,12 @@ if (passedLanes.size() == 0 || passedLanes.back() != myLane) { passedLanes.push_back(myLane); } - bool moved = true; + bool moved = false; // move on lane(s) if (myState.myPos <= myLane->getLength()) { // we are staying at our lane // there is no need to go over succeeding lanes workOnMoveReminders(pos, pos + SPEED2DIST(vNext), vNext); - moved = false; } else { // we are moving at least to the next lane (maybe pass even more than one) if (myCurrEdge != myRoute->end() - 1) { @@ -827,24 +943,18 @@ // check whether the vehicle was allowed to enter lane // otherwise it is decelareted and we do not need to test for it's // approach on the following lanes when a lane changing is performed - myState.myPos -= approachedLane->getLength(); - assert(myState.myPos > 0); // proceed to the next lane if (link != 0) { -#ifdef HAVE_INTERNAL_LANES - approachedLane = link->getViaLane(); - if (approachedLane == 0) { - approachedLane = link->getLane(); - } -#else - approachedLane = link->getLane(); -#endif + approachedLane = link->getViaLaneOrLane(); } else { approachedLane = 0; } if (approachedLane != myLane && approachedLane != 0) { + myState.myPos -= myLane->getLength(); + assert(myState.myPos > 0); enterLaneAtMove(approachedLane); myLane = approachedLane; + moved = true; if (approachedLane->getEdge().isVaporizing()) { break; } @@ -858,7 +968,14 @@ (*i)->resetPartialOccupation(this); } myFurtherLanes.clear(); - if (!ends()) { + if (!hasArrived() && !myLane->getEdge().isVaporizing()) { + if (myState.myPos > myLane->getLength()) { + WRITE_WARNING("Vehicle '" + getID() + "' performs emergency stop one lane '" + myLane->getID() + " at position " + + toString(myState.myPos) + " (decel=" + toString(myAcceleration - myState.mySpeed) + "), time=" + + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + myState.myPos = myLane->getLength(); + myState.mySpeed = 0; + } if (myState.myPos - getVehicleType().getLength() < 0 && passedLanes.size() > 0) { SUMOReal leftLength = getVehicleType().getLength() - myState.myPos; std::vector::reverse_iterator i = passedLanes.rbegin() + 1; @@ -985,12 +1102,12 @@ int bla = 0; } #endif - SUMOTime t = MSNet::getInstance()->getCurrentTimeStep(); for (int i = (int)(myLFLinkLanes.size() - 1); i > 0; --i) { DriveProcessItem& item = myLFLinkLanes[i - 1]; - bool opened = item.myLink != 0 && (item.myLink->havePriority() || item.myLink->opened(item.myArrivalTime, item.myArrivalSpeed,/*t, .1,*/ getVehicleType().getLengthWithGap())); - bool check1 = item.myLink == 0 || item.myLink->isCont() || !hadVehicles[i]; - bool allowsContinuation = check1 || opened; + const bool opened = item.myLink != 0 && (item.myLink->havePriority() || + item.myLink->opened(item.myArrivalTime, item.myArrivalSpeed, + item.getLeaveSpeed(), getVehicleType().getLengthWithGap())); + bool allowsContinuation = item.myLink == 0 || item.myLink->isCont() || !hadVehicles[i] || opened; if (!opened && item.myLink != 0) { if (i > 1) { DriveProcessItem& item2 = myLFLinkLanes[i - 2]; @@ -1035,13 +1152,15 @@ while (removalBegin < (int)(myLFLinkLanes.size())) { const SUMOReal brakeGap = getCarFollowModel().brakeGap(myState.mySpeed) - getCarFollowModel().getHeadwayTime() * myState.mySpeed; myLFLinkLanes[removalBegin].myVLinkPass = myLFLinkLanes[removalBegin].myVLinkWait; - if(myLFLinkLanes[removalBegin].myDistance>=brakeGap||(myLFLinkLanes[removalBegin].myDistance>0&&myState.mySpeed= brakeGap || (myLFLinkLanes[removalBegin].myDistance > 0 && myState.mySpeed < ACCEL2SPEED(getCarFollowModel().getMaxDecel()))) { myLFLinkLanes[removalBegin].mySetRequest = false; } ++removalBegin; } } } +#else + UNUSED_PARAMETER(lengthsInFront); #endif for (DriveItemVector::iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) { if ((*i).myLink != 0) { @@ -1051,179 +1170,6 @@ } - -void -MSVehicle::vsafeCriticalCont(SUMOTime t, SUMOReal boundVSafe) { -#ifdef DEBUG_VEHICLE_GUI_SELECTION - if (gSelected.isSelected(GLO_VEHICLE, static_cast(this)->getGlID())) { - int bla = 0; - } -#endif -#ifndef NO_TRACI - if (myInfluencer != 0) { - SUMOReal vMin = MAX2(SUMOReal(0), getVehicleType().getCarFollowModel().getSpeedAfterMaxDecel(myState.mySpeed)); - SUMOReal vMax = getVehicleType().getCarFollowModel().maxNextSpeed(myState.mySpeed); - boundVSafe = myInfluencer->influenceSpeed(MSNet::getInstance()->getCurrentTimeStep(), boundVSafe, boundVSafe, vMin, vMax); - } -#endif - const MSCFModel& cfModel = getCarFollowModel(); - // the vehicle may have just to look into the next lane - // compute this information and use it only once in the next loop - SUMOReal seen = myLane->getLength() - myState.myPos; - SUMOReal seenNonInternal = 0; - // - if (this != myLane->getFirstVehicle() && seen - cfModel.brakeGap(myState.mySpeed) > 0 && seen - SPEED2DIST(boundVSafe) - ACCEL2DIST(cfModel.getMaxAccel()) > 0) { - // not "reaching critical" - SUMOReal place = MIN2(myLane->getLength() - (SUMOReal)POSITION_EPS, getVehicleType().getMinGap()); - myLFLinkLanes.push_back(DriveProcessItem(0, boundVSafe, boundVSafe, false, 0, 0, seen - place)); - return; - } - - MSLane* nextLane = myLane; - // compute the way the vehicle would drive if it would use the current speed and then - // decelerate - SUMOReal maxV = cfModel.maxNextSpeed(myState.mySpeed); - SUMOReal dist = SPEED2DIST(maxV) + cfModel.brakeGap(maxV); - SUMOReal vLinkPass = boundVSafe; - SUMOReal vLinkWait = vLinkPass; - const std::vector &bestLaneConts = getBestLanesContinuation(); -#ifdef HAVE_INTERNAL_LANES - bool hadNonInternal = false; -#else - bool hadNonInternal = true; -#endif - - unsigned int view = 1; - // loop over following lanes - while (true) { - // process stops - if (!myStops.empty() && &myStops.begin()->lane->getEdge() == &nextLane->getEdge()) { - const Stop& stop = *myStops.begin(); - const SUMOReal vsafeStop = stop.busstop == 0 - ? cfModel.stopSpeed(this, seen + stop.endPos) - : cfModel.stopSpeed(this, seen + stop.busstop->getLastFreePos(*this) - POSITION_EPS); - vLinkPass = MIN2(vLinkPass, vsafeStop); - vLinkWait = MIN2(vLinkWait, vsafeStop); - } - - // get the next link used - MSLinkCont::const_iterator link = myLane->succLinkSec(*this, view, *nextLane, bestLaneConts); - - // check whether the lane is a dead end - // (should be valid only on further loop iterations - SUMOReal place = MIN2(nextLane->getLength() - (SUMOReal)POSITION_EPS, getVehicleType().getMinGap()); - if (nextLane->isLinkEnd(link)) { - SUMOReal laneEndVSafe = cfModel.stopSpeed(this, seen - place); - if (myCurrEdge + view == myRoute->end()) { - if (myParameter->arrivalSpeedProcedure == ARRIVAL_SPEED_GIVEN) { - laneEndVSafe = cfModel.freeSpeed(this, getSpeed(), seen, myParameter->arrivalSpeed); - } else { - laneEndVSafe = vLinkPass; - } - } - // the vehicle will not drive further - assert(MIN2(vLinkPass, laneEndVSafe) >= cfModel.getSpeedAfterMaxDecel(myState.mySpeed)); - myLFLinkLanes.push_back(DriveProcessItem(0, MIN2(vLinkPass, laneEndVSafe), MIN2(vLinkPass, laneEndVSafe), false, 0, 0, seen)); - return; - } - // the link was passed - vLinkWait = vLinkPass; - - - // get the following lane -#ifdef HAVE_INTERNAL_LANES - nextLane = (*link)->getViaLane(); - if (nextLane == 0) { - nextLane = (*link)->getLane(); - hadNonInternal = true; - view++; - } -#else - nextLane = (*link)->getLane(); - view++; -#endif - - // compute the velocity to use when the link is not blocked by other vehicles - // the vehicle shall be not faster when reaching the next lane than allowed - SUMOReal vmaxNextLane = MAX2(cfModel.freeSpeed(this, getSpeed(), seen, nextLane->getMaxSpeed()), nextLane->getMaxSpeed()); - - // the vehicle shall keep a secure distance to its predecessor - // (or approach the lane end if the predeccessor is too near) - SUMOReal vsafePredNextLane = 100000; - std::pair lastOnNext = nextLane->getLastVehicleInformation(); - if (lastOnNext.first != 0) { - if (seen + lastOnNext.second >= 0) { - vsafePredNextLane = cfModel.followSpeed(this, getSpeed(), seen + lastOnNext.second - getVehicleType().getMinGap(), lastOnNext.first->getSpeed(), lastOnNext.first->getCarFollowModel().getMaxDecel()); - } else { - vsafePredNextLane = cfModel.stopSpeed(this, seen - place); - } - } -#ifdef DEBUG_VEHICLE_GUI_SELECTION - if (gSelected.isSelected(GLO_VEHICLE, static_cast(this)->getGlID())) { - int bla = 0; - } -#endif - // compute the velocity to use when the link may be used - vLinkPass = MIN3(vLinkPass, vmaxNextLane, vsafePredNextLane); - - // if the link may not be used (is blocked by another vehicle) then let the - // vehicle decelerate until the end of the street - vLinkWait = MIN3(vLinkPass, vLinkWait, cfModel.stopSpeed(this, seen - place)); -#ifdef _DEBUG - if (vLinkWait < cfModel.getSpeedAfterMaxDecel(myState.mySpeed)) { - WRITE_WARNING("Vehicle '" + getID() + "' is decelerating too much (#2; is: " + toString(myState.mySpeed - vLinkWait) + ", may: " + toString(cfModel.getSpeedAfterMaxDecel(myState.mySpeed)) + ")"); - } -#endif - - // behaviour in front of not priorised intersections (waiting for priorised foe vehicles) - bool setRequest = false; - // process stops - if (!myStops.empty() && &myStops.begin()->lane->getEdge() == &nextLane->getEdge()) { - const Stop& stop = *myStops.begin(); - const SUMOReal vsafeStop = stop.busstop == 0 - ? cfModel.stopSpeed(this, seen + stop.endPos) - : cfModel.stopSpeed(this, seen + stop.busstop->getLastFreePos(*this) - POSITION_EPS); - vLinkPass = MIN2(vLinkPass, vsafeStop); - vLinkWait = MIN2(vLinkWait, vsafeStop); - } - // check whether we approach the final edge - if (myCurrEdge + view == myRoute->end()) { - if (myParameter->arrivalSpeedProcedure == ARRIVAL_SPEED_GIVEN) { - const SUMOReal vsafe = cfModel.freeSpeed(this, getSpeed(), seen + myArrivalPos, myParameter->arrivalSpeed); - vLinkPass = MIN2(vLinkPass, vsafe); - vLinkWait = MIN2(vLinkWait, vsafe); - } - } - - setRequest |= ((*link)->getState() != LINKSTATE_TL_RED && vLinkPass > 0); -// setRequest |= (seen < cfModel.brakeGap(myState.mySpeed) + SPEED2DIST(myState.mySpeed)*cfModel.getHeadwayTime()); - bool yellow = (*link)->getState() == LINKSTATE_TL_YELLOW_MAJOR || (*link)->getState() == LINKSTATE_TL_YELLOW_MINOR; - bool red = (*link)->getState() == LINKSTATE_TL_RED; - if ((yellow || red) && seen > cfModel.brakeGap(myState.mySpeed) - myState.mySpeed*cfModel.getHeadwayTime()) { - vLinkPass = vLinkWait; - setRequest = false; - assert(vLinkWait >= cfModel.getSpeedAfterMaxDecel(myState.mySpeed)); - myLFLinkLanes.push_back(DriveProcessItem(*link, vLinkWait, vLinkWait, false, t + TIME2STEPS(seen / vLinkPass), vLinkPass, seen)); - } - // the next condition matches the previously one used for determining the difference - // between critical/non-critical vehicles. Though, one should assume that a vehicle - // should want to move over an intersection even though it could brake before it!? - //setRequest &= dist - seen > 0; -#ifdef _DEBUG - if (MIN2(vLinkPass, vLinkWait) < cfModel.getSpeedAfterMaxDecel(myState.mySpeed)) { - WRITE_WARNING("Vehicle '" + getID() + "' is decelerating too much (#3; is: " + toString(myState.mySpeed - MIN2(vLinkPass, vLinkWait)) + ", may: " + toString(cfModel.getSpeedAfterMaxDecel(myState.mySpeed)) + ")"); - } -#endif - myLFLinkLanes.push_back(DriveProcessItem(*link, vLinkPass, vLinkWait, setRequest, t + TIME2STEPS(seen / vLinkPass), vLinkPass, seen)); - seen += nextLane->getLength(); - seenNonInternal += nextLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL ? 0 : nextLane->getLength(); - if (!setRequest || ((vLinkPass <= 0 || seen > dist) && hadNonInternal && seenNonInternal > 50)) { - return; - } - } -} - - void MSVehicle::activateReminders(const MSMoveReminder::Notification reason) { for (MoveReminderCont::iterator rem = myMoveReminders.begin(); rem != myMoveReminders.end();) { @@ -1242,7 +1188,7 @@ bool MSVehicle::enterLaneAtMove(MSLane* enteredLane, bool onTeleporting) { - myAmOnNet = true; + myAmOnNet = !onTeleporting; // vaporizing edge? /* if (enteredLane->getEdge().isVaporizing()) { @@ -1251,12 +1197,10 @@ return true; } */ - if (!onTeleporting) { - // move mover reminder one lane further - adaptLaneEntering2MoveReminder(*enteredLane); - // set the entered lane as the current lane - myLane = enteredLane; - } + // move mover reminder one lane further + adaptLaneEntering2MoveReminder(*enteredLane); + // set the entered lane as the current lane + myLane = enteredLane; // internal edges are not a part of the route... if (enteredLane->getEdge().getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) { @@ -1272,8 +1216,12 @@ myLaneChangeModel->requestLaneChange(myInfluencer->checkForLaneChanges(MSNet::getInstance()->getCurrentTimeStep(), **myCurrEdge, getLaneIndex())); } #endif + } else { + activateReminders(MSMoveReminder::NOTIFICATION_TELEPORT); + // normal move() isn't called so reset position here + myState.myPos = 0; } - return ends(); + return hasArrived(); } @@ -1293,27 +1241,41 @@ addReminder(*rem); } activateReminders(MSMoveReminder::NOTIFICATION_LANE_CHANGE); - SUMOReal leftLength = myState.myPos - getVehicleType().getLength(); - if (leftLength < 0) { + /* + for (std::vector::iterator i = myFurtherLanes.begin(); i != myFurtherLanes.end(); ++i) { + (*i)->resetPartialOccupation(this); + } + myFurtherLanes.clear(); + */ + if (myState.myPos - getVehicleType().getLength() < 0) { // we have to rebuild "further lanes" const MSRoute& route = getRoute(); MSRouteIterator i = myCurrEdge; MSLane* lane = myLane; + SUMOReal leftLength = getVehicleType().getLength() - myState.myPos; while (i != route.begin() && leftLength > 0) { - const MSEdge* const prev = *(--i); + /* const MSEdge* const prev = */ *(--i); + lane = lane->getLogicalPredecessorLane(); + if (lane == 0) { + break; + } + myFurtherLanes.push_back(lane); + leftLength -= (lane)->setPartialOccupation(this, leftLength); + /* const std::vector &incomingLanes = lane->getIncomingLanes(); for (std::vector::const_iterator j = incomingLanes.begin(); j != incomingLanes.end(); ++j) { if (&(*j).lane->getEdge() == prev) { -#ifdef HAVE_INTERNAL_LANES + #ifdef HAVE_INTERNAL_LANES (*j).lane->setPartialOccupation(this, leftLength); -#else + #else leftLength -= (*j).length; (*j).lane->setPartialOccupation(this, leftLength); -#endif + #endif leftLength -= (*j).lane->getLength(); break; } } + */ } } #ifndef NO_TRACI @@ -1389,7 +1351,7 @@ } -const std::vector & +const std::vector& MSVehicle::getBestLanes(bool forceRebuild, MSLane* startLane) const { #ifdef DEBUG_VEHICLE_GUI_SELECTION if (gSelected.isSelected(GLO_VEHICLE, static_cast(this)->getGlID())) { @@ -1403,7 +1365,7 @@ } // update occupancy and current lane index, only, if the vehicle has not moved to a new lane if (myLastBestLanesEdge == &startLane->getEdge() && !forceRebuild) { - std::vector &lanes = *myBestLanes.begin(); + std::vector& lanes = *myBestLanes.begin(); std::vector::iterator i; for (i = lanes.begin(); i != lanes.end(); ++i) { SUMOReal nextOccupation = 0; @@ -1443,13 +1405,13 @@ bool progress = true; for (MSRouteIterator ce = myCurrEdge; progress;) { std::vector currentLanes; - const std::vector *allowed = 0; + const std::vector* allowed = 0; const MSEdge* nextEdge = 0; if (ce != myRoute->end() && ce + 1 != myRoute->end()) { nextEdge = *(ce + 1); allowed = (*ce)->allowedLanes(*nextEdge, myType->getVehicleClass()); } - const std::vector &lanes = (*ce)->getLanes(); + const std::vector& lanes = (*ce)->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { LaneQ q; MSLane* cl = *i; @@ -1464,7 +1426,7 @@ if (nextStopEdge == *ce) { progress = false; for (std::vector::iterator q = currentLanes.begin(); q != currentLanes.end(); ++q) { - if (nextStopLane != (*q).lane) { + if (nextStopLane != 0 && nextStopLane != (*q).lane) { (*q).allowsContinuation = false; (*q).length = nextStopPos; } @@ -1490,7 +1452,7 @@ SUMOReal bestLength = -1; int bestThisIndex = 0; int index = 0; - std::vector &last = myBestLanes.back(); + std::vector& last = myBestLanes.back(); for (std::vector::iterator j = last.begin(); j != last.end(); ++j, ++index) { if ((*j).length > bestLength) { bestLength = (*j).length; @@ -1508,8 +1470,8 @@ // go backward through the lanes // track back best lane and compute the best prior lane(s) for (std::vector >::reverse_iterator i = myBestLanes.rbegin() + 1; i != myBestLanes.rend(); ++i) { - std::vector &nextLanes = (*(i - 1)); - std::vector &clanes = (*i); + std::vector& nextLanes = (*(i - 1)); + std::vector& clanes = (*i); MSEdge& cE = clanes[0].lane->getEdge(); int index = 0; SUMOReal bestConnectedLength = -1; @@ -1593,7 +1555,7 @@ } // update occupancy and current lane index - std::vector &currLanes = *myBestLanes.begin(); + std::vector& currLanes = *myBestLanes.begin(); std::vector::iterator i; for (i = currLanes.begin(); i != currLanes.end(); ++i) { SUMOReal nextOccupation = 0; @@ -1609,7 +1571,7 @@ } -const std::vector & +const std::vector& MSVehicle::getBestLanesContinuation() const { if (myBestLanes.empty() || myBestLanes[0].empty() || myLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { return myEmptyLaneVector; @@ -1618,11 +1580,14 @@ } -const std::vector & +const std::vector& MSVehicle::getBestLanesContinuation(const MSLane* const l) const { - for (std::vector >::const_iterator i = myBestLanes.begin(); i != myBestLanes.end(); ++i) { - if ((*i).size() != 0 && (*i)[0].lane == l) { - return (*i)[0].bestContinuations; + if (myBestLanes.size() == 0) { + return myEmptyLaneVector; + } + for (std::vector::const_iterator i = myBestLanes[0].begin(); i != myBestLanes[0].end(); ++i) { + if ((*i).lane == l) { + return (*i).bestContinuations; } } return myEmptyLaneVector; @@ -1653,43 +1618,43 @@ SUMOReal MSVehicle::getHBEFA_CO2Emissions() const { - return HelpersHBEFA::computeCO2(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHBEFA::computeCO2(myType->getEmissionClass(), myState.speed(), myAcceleration); } SUMOReal MSVehicle::getHBEFA_COEmissions() const { - return HelpersHBEFA::computeCO(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHBEFA::computeCO(myType->getEmissionClass(), myState.speed(), myAcceleration); } SUMOReal MSVehicle::getHBEFA_HCEmissions() const { - return HelpersHBEFA::computeHC(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHBEFA::computeHC(myType->getEmissionClass(), myState.speed(), myAcceleration); } SUMOReal MSVehicle::getHBEFA_NOxEmissions() const { - return HelpersHBEFA::computeNOx(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHBEFA::computeNOx(myType->getEmissionClass(), myState.speed(), myAcceleration); } SUMOReal MSVehicle::getHBEFA_PMxEmissions() const { - return HelpersHBEFA::computePMx(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHBEFA::computePMx(myType->getEmissionClass(), myState.speed(), myAcceleration); } SUMOReal MSVehicle::getHBEFA_FuelConsumption() const { - return HelpersHBEFA::computeFuel(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHBEFA::computeFuel(myType->getEmissionClass(), myState.speed(), myAcceleration); } SUMOReal MSVehicle::getHarmonoise_NoiseEmissions() const { - return HelpersHarmonoise::computeNoise(myType->getEmissionClass(), myState.speed(), myPreDawdleAcceleration); + return HelpersHarmonoise::computeNoise(myType->getEmissionClass(), myState.speed(), myAcceleration); } @@ -1706,6 +1671,13 @@ } +unsigned int +MSVehicle::getPersonNumber() const { + unsigned int boarded = myPersonDevice == 0 ? 0 : myPersonDevice->size(); + return boarded + myParameter->personNumber; +} + + void MSVehicle::setBlinkerInformation() { switchOffSignal(VEH_SIGNAL_BLINKER_RIGHT | VEH_SIGNAL_BLINKER_LEFT); @@ -1717,7 +1689,7 @@ } else { const MSLane* lane = getLane(); MSLinkCont::const_iterator link = lane->succLinkSec(*this, 1, *lane, getBestLanesContinuation()); - if (link != lane->getLinkCont().end() && lane->getLength() - getPositionOnLane() < lane->getMaxSpeed() * (SUMOReal) 7.) { + if (link != lane->getLinkCont().end() && lane->getLength() - getPositionOnLane() < lane->getVehicleMaxSpeed(this) * (SUMOReal) 7.) { switch ((*link)->getDirection()) { case LINKDIR_TURN: case LINKDIR_LEFT: diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicle.h sumo-0.16.0~dfsg/src/microsim/MSVehicle.h --- sumo-0.15.0~dfsg/src/microsim/MSVehicle.h 2012-03-02 00:03:30.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicle.h 2012-12-02 13:57:49.000000000 +0000 @@ -10,7 +10,7 @@ /// @author Michael Behrisch /// @author Axel Wegener /// @date Mon, 12 Mar 2001 -/// @version $Id: MSVehicle.h 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSVehicle.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a vehicle in the micro simulation /****************************************************************************/ @@ -134,12 +134,19 @@ REQUEST_HOLD }; - /// Use this constructor only. + /** @brief Constructor + * @param[in] pars The vehicle description + * @param[in] route The vehicle's route + * @param[in] type The vehicle's type + * @param[in] speedFactor The factor for driven lane's speed limits + * @param[in] vehicleIndex The vehicle's running index + * @exception ProcessError If a value is wrong + */ MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route, - const MSVehicleType* type, int vehicleIndex) ; + const MSVehicleType* type, SUMOReal speedFactor, int vehicleIndex); /// @brief Destructor. - virtual ~MSVehicle() ; + virtual ~MSVehicle(); @@ -153,7 +160,7 @@ * * @param[in] reason why the vehicle leaves (reached its destination, parking, teleport) */ - void onRemovalFromNet(const MSMoveReminder::Notification reason) ; + void onRemovalFromNet(const MSMoveReminder::Notification reason); //@} @@ -161,11 +168,10 @@ /// @name interaction with the route //@{ - /** @brief Returns the information whether the vehicle should end now - * @return Whether the route ends + /** @brief Returns whether this vehicle has already arived + * (reached the arrivalPosition on its final edge) */ - bool ends() const ; - + bool hasArrived() const; /** @brief Replaces the current route by the given one * @@ -175,7 +181,7 @@ * @param[in] route The new route to pass * @return Whether the new route was accepted */ - bool replaceRoute(const MSRoute* route, bool onInit = false) ; + bool replaceRoute(const MSRoute* route, bool onInit = false); /** @brief Returns whether the vehicle wil pass the given edge @@ -183,15 +189,18 @@ * @return Whether the given edge will be passed by the vehicle * @todo Move to MSRoute? */ - bool willPass(const MSEdge* const edge) const ; + bool willPass(const MSEdge* const edge) const; + unsigned int getRoutePosition() const; + void resetRoutePosition(unsigned int index); /** @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 */ - MSEdgeWeightsStorage& getWeightsStorage() ; + const MSEdgeWeightsStorage& getWeightsStorage() const; + MSEdgeWeightsStorage& getWeightsStorage(); //@} @@ -263,23 +272,19 @@ * @param[in] newSpeed The vehicle's speed within this move * @see MSMoveReminder */ - void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ; + void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed); //@} - /** @brief Moves vehicles which may run out of the lane + /** @brief Moves vehicles * * @param[in] lane The lane the vehicle is on * @param[in] pred The leader (may be 0) * @param[in] neigh The neighbor vehicle (may be 0) * @param[in] lengthsInFront Sum of vehicle lengths in front of the vehicle - * @return Whether a collision occured (gap2pred(leader)<=0) */ - bool moveRegardingCritical(SUMOTime t, const MSLane* const lane, const MSVehicle* const pred, - const MSVehicle* const neigh, SUMOReal lengthsInFront) ; - - + void move(SUMOTime t, MSLane* lane, MSVehicle* pred, MSVehicle* neigh, SUMOReal lengthsInFront); /// @name state setter/getter //@{ @@ -300,11 +305,11 @@ } - /** @brief Returns the vehicle's acceleration before dawdling - * @return The acceleration before dawdling + /** @brief Returns the vehicle's acceleration + * @return The acceleration */ - SUMOReal getPreDawdleAcceleration() const { - return myPreDawdleAcceleration; + SUMOReal getAcceleration() const { + return myAcceleration; } //@} @@ -320,7 +325,7 @@ * @return The current position (in cartesian coordinates) * @see myLane */ - Position getPosition() const ; + Position getPosition() const; /** @brief Returns the lane the vehicle is on @@ -364,26 +369,12 @@ /** @brief Returns the vehicle's direction in degrees * @return The vehicle's current angle */ - SUMOReal getAngle() const ; + SUMOReal getAngle() const; //@} class Influencer; - void setIndividualMaxSpeed(SUMOReal individualMaxSpeed) { - myHasIndividualMaxSpeed = true; - myIndividualMaxSpeed = individualMaxSpeed; - } - - void unsetIndividualMaxSpeed(void) { - myHasIndividualMaxSpeed = false; - } - - void setPreDawdleAcceleration(SUMOReal accel) { - myPreDawdleAcceleration = accel; - } - - /** Returns true if the two vehicles overlap. */ static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) { if (veh1->myState.myPos < veh2->myState.myPos) { @@ -410,7 +401,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - void activateReminders(const MSMoveReminder::Notification reason) ; + void activateReminders(const MSMoveReminder::Notification reason); /** @brief Update when the vehicle enters a new lane in the move step. * @@ -430,7 +421,7 @@ * @param[in] notification The cause of insertion (i.e. departure, teleport, parking) */ void enterLaneAtInsertion(MSLane* enteredLane, SUMOReal pos, SUMOReal speed, - MSMoveReminder::Notification notification) ; + MSMoveReminder::Notification notification); /** @brief Update when the vehicle enters a new lane in the laneChange step. @@ -444,7 +435,6 @@ void leaveLane(const MSMoveReminder::Notification reason); - void vsafeCriticalCont(SUMOTime t, SUMOReal boundVSafe); @@ -492,20 +482,20 @@ * @param[in] startLane The lane the process shall start at ("myLane" will be used if ==0) * @return The best lanes structure holding matching the current vehicle position and state ahead */ - virtual const std::vector &getBestLanes(bool forceRebuild = false, MSLane* startLane = 0) const ; + virtual const std::vector& getBestLanes(bool forceRebuild = false, MSLane* startLane = 0) const; /** @brief Returns the subpart of best lanes that describes the vehicle's current lane and their successors * @return The best lane information for the vehicle's current lane * @todo Describe better */ - const std::vector &getBestLanesContinuation() const ; + const std::vector& getBestLanesContinuation() const; /** @brief Returns the subpart of best lanes that describes the given lane and their successors * @return The best lane information for the given lane * @todo Describe better */ - const std::vector &getBestLanesContinuation(const MSLane* const l) const ; + const std::vector& getBestLanesContinuation(const MSLane* const l) const; /// @} @@ -517,7 +507,7 @@ * @param[in] type The new vehicle type * @see MSVehicle::myType */ - void replaceVehicleType(MSVehicleType* type) ; + void replaceVehicleType(MSVehicleType* type); /** @brief Returns the vehicle's car following model definition @@ -577,7 +567,7 @@ * @param[in] stop The stop to add * @return Whether the stop could be added */ - bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset = 0) ; + bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset = 0); /** @brief Returns whether the vehicle has to stop somewhere @@ -619,7 +609,7 @@ * @see Stop * @see MSBusStop */ - SUMOReal processNextStop(SUMOReal currentVelocity) ; + SUMOReal processNextStop(SUMOReal currentVelocity); /// @name Emission retrieval @@ -628,48 +618,61 @@ /** @brief Returns CO2 emission of the current state * @return The current CO2 emission */ - SUMOReal getHBEFA_CO2Emissions() const ; + SUMOReal getHBEFA_CO2Emissions() const; /** @brief Returns CO emission of the current state * @return The current CO emission */ - SUMOReal getHBEFA_COEmissions() const ; + SUMOReal getHBEFA_COEmissions() const; /** @brief Returns HC emission of the current state * @return The current HC emission */ - SUMOReal getHBEFA_HCEmissions() const ; + SUMOReal getHBEFA_HCEmissions() const; /** @brief Returns NOx emission of the current state * @return The current NOx emission */ - SUMOReal getHBEFA_NOxEmissions() const ; + SUMOReal getHBEFA_NOxEmissions() const; /** @brief Returns PMx emission of the current state * @return The current PMx emission */ - SUMOReal getHBEFA_PMxEmissions() const ; + SUMOReal getHBEFA_PMxEmissions() const; /** @brief Returns fuel consumption of the current state * @return The current fuel consumption */ - SUMOReal getHBEFA_FuelConsumption() const ; + SUMOReal getHBEFA_FuelConsumption() const; /** @brief Returns noise emissions of the current state * @return The noise produced */ - SUMOReal getHarmonoise_NoiseEmissions() const ; + SUMOReal getHarmonoise_NoiseEmissions() const; //@} - void addPerson(MSPerson* person) ; + /// @name Interaction with persons + //@{ + + /** @brief Adds a passenger + * @param[in] person The person to add + */ + void addPerson(MSPerson* person); + + + /** @brief Returns the number of persons + * @return The number of passengers on-board + */ + unsigned int getPersonNumber() const; + /// @name Access to bool signals /// @{ @@ -792,13 +795,13 @@ /** @brief Sets a new velocity timeline * @param[in] speedTimeLine The time line of speeds to use */ - void setSpeedTimeLine(const std::vector > &speedTimeLine); + void setSpeedTimeLine(const std::vector >& speedTimeLine); /** @brief Sets a new lane timeline * @param[in] laneTimeLine The time line of lanes to use */ - void setLaneTimeLine(const std::vector > &laneTimeLine); + void setLaneTimeLine(const std::vector >& laneTimeLine); /** @brief Applies stored velocity information on the speed to use @@ -843,7 +846,6 @@ return myOriginalSpeed; } - private: /// @brief The velocity time line to apply std::vector > mySpeedTimeLine; @@ -880,8 +882,8 @@ protected: - void checkRewindLinkLanes(SUMOReal lengthsInFront) ; - SUMOReal getSpaceTillLastStanding(MSLane* l, bool& foundStopped) ; + void checkRewindLinkLanes(SUMOReal lengthsInFront); + SUMOReal getSpaceTillLastStanding(MSLane* l, bool& foundStopped); /// @name Interaction with move reminders ///@{ @@ -901,12 +903,12 @@ * @see MSMoveReminder * @see MSLane::getMoveReminder */ - void adaptLaneEntering2MoveReminder(const MSLane& enteredLane) ; + void adaptLaneEntering2MoveReminder(const MSLane& enteredLane); ///@} - void setBlinkerInformation() ; + void setBlinkerInformation(); /// @brief information how long ago the vehicle has performed a lane-change @@ -942,7 +944,7 @@ MSDevice_Person* myPersonDevice; /// @brief The current acceleration before dawdling - SUMOReal myPreDawdleAcceleration; + SUMOReal myAcceleration; /// @brief The information into which lanes the vehicle laps into std::vector myFurtherLanes; @@ -967,10 +969,22 @@ SUMOTime myArrivalTime; SUMOReal myArrivalSpeed; SUMOReal myDistance; + SUMOReal accelV; DriveProcessItem(MSLink* link, SUMOReal vPass, SUMOReal vWait, bool setRequest, SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal distance) : myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest), - myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed), myDistance(distance) { }; + myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed), myDistance(distance), + accelV(-1) { }; + void adaptLeaveSpeed(SUMOReal v) { + if (accelV < 0) { + accelV = v; + } else { + accelV = MIN2(accelV, v); + } + } + SUMOReal getLeaveSpeed() const { + return accelV < 0 ? myVLinkPass : accelV; + } }; typedef std::vector< DriveProcessItem > DriveItemVector; @@ -980,8 +994,9 @@ private: - /// @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage - MSEdgeWeightsStorage* myEdgeWeights; + /* @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; @@ -1001,6 +1016,7 @@ /// @brief invalidated assignment operator MSVehicle& operator=(const MSVehicle&); + MSEdgeWeightsStorage& _getWeightsStorage() const; }; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicleControl.cpp sumo-0.16.0~dfsg/src/microsim/MSVehicleControl.cpp --- sumo-0.15.0~dfsg/src/microsim/MSVehicleControl.cpp 2012-02-16 15:57:40.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicleControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: MSVehicleControl.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSVehicleControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The class responsible for building and deletion of vehicles /****************************************************************************/ @@ -48,6 +48,12 @@ // =========================================================================== +// static members +// =========================================================================== +MTRand MSVehicleControl::myVehicleParamsRNG; + + +// =========================================================================== // member method definitions // =========================================================================== MSVehicleControl::MSVehicleControl() : @@ -55,12 +61,22 @@ myRunningVehNo(0), myEndedVehNo(0), myDiscarded(0), + myCollisions(0), + myTeleports(0), myTotalDepartureDelay(0), myTotalTravelTime(0), myDefaultVTypeMayBeDeleted(true), - myWaitingForPerson(0) { + myWaitingForPerson(0), + myScale(-1) { SUMOVTypeParameter defType; myVTypeDict[DEFAULT_VTYPE_ID] = MSVehicleType::build(defType); + OptionsCont& oc = OptionsCont::getOptions(); + if (oc.isSet("incremental-dua-step")) { + myScale = oc.getInt("incremental-dua-step") / static_cast(oc.getInt("incremental-dua-base")); + } + if (oc.isSet("scale")) { + myScale = oc.getFloat("scale"); + } } @@ -88,7 +104,7 @@ const MSRoute* route, const MSVehicleType* type) { myLoadedVehNo++; - MSVehicle* built = new MSVehicle(defs, route, type, myLoadedVehNo - 1); + MSVehicle* built = new MSVehicle(defs, route, type, type->computeChosenSpeedDeviation(myVehicleParamsRNG), myLoadedVehNo - 1); MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); return built; } @@ -222,7 +238,7 @@ bool -MSVehicleControl::addVTypeDistribution(const std::string& id, RandomDistributor *vehTypeDistribution) { +MSVehicleControl::addVTypeDistribution(const std::string& id, RandomDistributor* vehTypeDistribution) { if (checkVType(id)) { myVTypeDistDict[id] = vehTypeDistribution; return true; @@ -245,7 +261,7 @@ if (it2 == myVTypeDistDict.end()) { return 0; } - return it2->second->get(); + return it2->second->get(&myVehicleParamsRNG); } if (id == DEFAULT_VTYPE_ID) { myDefaultVTypeMayBeDeleted = false; @@ -255,7 +271,7 @@ void -MSVehicleControl::insertVTypeIDs(std::vector &into) const { +MSVehicleControl::insertVTypeIDs(std::vector& into) const { into.reserve(into.size() + myVTypeDict.size() + myVTypeDistDict.size()); for (VTypeDictType::const_iterator i = myVTypeDict.begin(); i != myVTypeDict.end(); ++i) { into.push_back((*i).first); @@ -287,7 +303,7 @@ SUMOVehicle* -MSVehicleControl::getWaitingVehicle(const MSEdge* const edge, const std::set &lines) { +MSVehicleControl::getWaitingVehicle(const MSEdge* const edge, const std::set& lines) { if (myWaiting.find(edge) != myWaiting.end()) { for (std::vector::const_iterator it = myWaiting[edge].begin(); it != myWaiting[edge].end(); ++it) { const std::string& line = (*it)->getParameter().line == "" ? (*it)->getParameter().id : (*it)->getParameter().line; @@ -308,8 +324,12 @@ } -bool -MSVehicleControl::isInQuota(const SUMOReal frac) const { +bool +MSVehicleControl::isInQuota(SUMOReal frac) const { + frac = frac < 0 ? myScale : frac; + if (frac < 0) { + return true; + } const unsigned int resolution = 1000; const unsigned int intFrac = (unsigned int)floor(frac * resolution + 0.5); // the vehicle in question has already been loaded, hence the '-1' diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicleControl.h sumo-0.16.0~dfsg/src/microsim/MSVehicleControl.h --- sumo-0.15.0~dfsg/src/microsim/MSVehicleControl.h 2012-01-21 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicleControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: MSVehicleControl.h 11750 2012-01-20 09:27:07Z namdre $ +/// @version $Id: MSVehicleControl.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The class responsible for building and deletion of vehicles /****************************************************************************/ @@ -37,6 +37,7 @@ #include #include #include "MSGlobals.h" +#include #include #include #include @@ -78,11 +79,11 @@ public: /// @brief Constructor - MSVehicleControl() ; + MSVehicleControl(); /// @brief Destructor - virtual ~MSVehicleControl() ; + virtual ~MSVehicleControl(); /// @name Vehicle creation @@ -93,16 +94,13 @@ * Builds a MSVehicle instance using the given parameter. * Increases the number of loaded vehicles ("myLoadedVehNo"). * - * @param[in] id The id of the vehicle to build + * @param[in] defs The parameter defining the vehicle * @param[in] route The route of this vehicle - * @param[in] departTime The departure time of this vehicle * @param[in] type The type of this vehicle - * @param[in] repNo The number of repetitions - * @param[in] repOffset The repetition offset * @return The built vehicle (MSVehicle instance) */ virtual SUMOVehicle* buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, - const MSVehicleType* type) ; + const MSVehicleType* type); /// @} @@ -122,7 +120,7 @@ * @param[in] v The vehicle * @return Whether the vehicle could be inserted (no other vehicle with the same id was inserted before) */ - virtual bool addVehicle(const std::string& id, SUMOVehicle* v) ; + virtual bool addVehicle(const std::string& id, SUMOVehicle* v); /** @brief Returns the vehicle with the given id @@ -133,7 +131,7 @@ * @param[in] id The id of the vehicle to retrieve * @return The vehicle with the given id, 0 if no such vehicle exists */ - SUMOVehicle* getVehicle(const std::string& id) const ; + SUMOVehicle* getVehicle(const std::string& id) const; /** @brief Deletes the vehicle @@ -142,7 +140,7 @@ * @param[discard] Whether the vehicle is discard during loading (scale < 1) * @todo Isn't this quite insecure? */ - virtual void deleteVehicle(SUMOVehicle* v, bool discard=false) ; + virtual void deleteVehicle(SUMOVehicle* v, bool discard = false); /** @brief Removes a vehicle after it has ended @@ -156,21 +154,21 @@ * * @param[in] veh The vehicle to remove */ - void scheduleVehicleRemoval(SUMOVehicle* veh) ; + void scheduleVehicleRemoval(SUMOVehicle* veh); /** @brief Returns the begin of the internal vehicle map * * @return The begin of the internal vehicle map */ - constVehIt loadedVehBegin() const ; + constVehIt loadedVehBegin() const; /** @brief Returns the end of the internal vehicle map * * @return The end of the internal vehicle map */ - constVehIt loadedVehEnd() const ; + constVehIt loadedVehEnd() const; /// @} @@ -180,12 +178,12 @@ /** @brief Informs this control about a vehicle's departure * - * If the mean waiting time shall be computed (f.e. for emissions-output), + * If the mean waiting time shall be computed (f.e. for summary-output), * the absolut waiting time is increased by the waiting time of the given * vehicle. * @param[in] v The inserted vehicle */ - void vehicleDeparted(const SUMOVehicle& v) ; + void vehicleDeparted(const SUMOVehicle& v); /// @} @@ -225,11 +223,13 @@ } - /** @brief Returns the information whether the currently vehicle number shall be emitted + /** @brief Returns the information whether the currently vehicle number shall be emitted * considering that only frac of all vehicles shall be emitted overall + * if a negative fraction is given the demand scaling factor is used + * (--scale or --incremental-dua-step / --incremental-dua-base) * @return True iff the vehicle number is acceptable */ - bool isInQuota(const SUMOReal frac) const; + bool isInQuota(SUMOReal frac = -1) const; /** @brief Returns the number of build vehicles that have not been removed @@ -239,6 +239,17 @@ int getActiveVehicleCount() const { return myLoadedVehNo - (myWaitingForPerson + myEndedVehNo); } + + /// @brief return the number of collisions + unsigned int getCollisionCount() const { + return myCollisions; + } + + + /// @brief return the number of teleports (including collisions) + unsigned int getTeleportCount() const { + return myTeleports; + } /// @} @@ -249,14 +260,14 @@ * The mean time vehicles had to wait for being inserted (-1 if no vehicle was inserted, yet) * @todo Enable this for guisim? */ - void printMeanWaitingTime(OutputDevice& od) const ; + void printMeanWaitingTime(OutputDevice& od) const; /** @brief Returns the mean travel time of vehicles * The mean travel time of ended vehicles (-1 if no vehicle has ended, yet) * @todo Enable this for guisim? */ - void printMeanTravelTime(OutputDevice& od) const ; + void printMeanTravelTime(OutputDevice& od) const; /// @} @@ -277,7 +288,7 @@ * @param[in] vehType The vehicle type to add * @return Whether the vehicle type could be added */ - bool addVType(MSVehicleType* vehType) ; + bool addVType(MSVehicleType* vehType); /** @brief Adds a vehicle type distribution @@ -293,7 +304,7 @@ * @param[in] vehTypeDistribution The vehicle type distribution to add * @return Whether the vehicle type could be added */ - bool addVTypeDistribution(const std::string& id, RandomDistributor *vehTypeDistribution) ; + bool addVTypeDistribution(const std::string& id, RandomDistributor* vehTypeDistribution); /** @brief Asks for a vehicle type distribution @@ -303,27 +314,27 @@ * @param[in] id The id of the distribution * @return Whether the vehicle type distribution exists */ - bool hasVTypeDistribution(const std::string& id) const ; + bool hasVTypeDistribution(const std::string& id) const; /** @brief Returns the named vehicle type or a sample from the named distribution * @param[in] id The id of the vehicle type to return. If left out, the default type is returned. * @return The named vehicle type, or 0 if no such type exists */ - MSVehicleType* getVType(const std::string& id = DEFAULT_VTYPE_ID) ; + MSVehicleType* getVType(const std::string& id = DEFAULT_VTYPE_ID); /** @brief Inserts ids of all known vehicle types and vehicle type distributions to the given vector * @param[in] into The vector to fill with ids */ - void insertVTypeIDs(std::vector &into) const ; + void insertVTypeIDs(std::vector& into) const; /// @} - void addWaiting(const MSEdge* const edge, SUMOVehicle* vehicle) ; + void addWaiting(const MSEdge* const edge, SUMOVehicle* vehicle); - void removeWaiting(const MSEdge* const edge, SUMOVehicle* vehicle) ; + void removeWaiting(const MSEdge* const edge, SUMOVehicle* vehicle); - SUMOVehicle* getWaitingVehicle(const MSEdge* const edge, const std::set &lines) ; + SUMOVehicle* getWaitingVehicle(const MSEdge* const edge, const std::set& lines); /** @brief increases the count of vehicles waiting for a person to allow recogniztion of person related deadlocks */ @@ -337,34 +348,50 @@ myWaitingForPerson--; } + /// @brief registers one collision-related teleport + void registerCollision() { + myTeleports++; + myCollisions++; + } + + /// @brief register one non-collision-related teleport + void registerTeleport() { + myTeleports++; + } + /// @name State I/O (mesosim only) /// @{ /** @brief Loads the state of this control from the given stream * @todo Does not work for microsim */ - virtual void saveState(std::ostream& os) ; + virtual void saveState(std::ostream& os); /** @brief Saves the current state into the given stream * @todo Does not work for microsim */ - virtual void loadState(BinaryInputDevice& bis, const SUMOTime offset) ; + virtual void loadState(BinaryInputDevice& bis, const SUMOTime offset); /// @} - // + /** @brief removes any vehicles that are still waiting */ - void abortWaiting() ; + void abortWaiting(); + + +public: + /// @brief A random number generator used to choose from vtype/route distributions and computing the speed factors + static MTRand myVehicleParamsRNG; private: /** @brief Checks whether the vehicle type (distribution) may be added * - * Removed the vehicle from the internal dictionary + * This method checks also whether the default type may still be replaced * @param[in] id The id of the vehicle type (distribution) to add * @return Whether the type (distribution) may be added */ - bool checkVType(const std::string& id) ; + bool checkVType(const std::string& id); protected: @@ -382,6 +409,12 @@ /// @brief The number of vehicles which were discarded while loading unsigned int myDiscarded; + + /// @brief The number of collisions + unsigned int myCollisions; + + /// @brief The number of teleports (including collisions) + unsigned int myTeleports; /// @} @@ -428,6 +461,8 @@ /// the number of vehicles contained in myWaiting which can only continue by being triggered unsigned int myWaitingForPerson; + /// @brief The scaling factor (especially for inc-dua) + SUMOReal myScale; private: /// @brief invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicleTransfer.cpp sumo-0.16.0~dfsg/src/microsim/MSVehicleTransfer.cpp --- sumo-0.15.0~dfsg/src/microsim/MSVehicleTransfer.cpp 2012-03-02 00:03:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicleTransfer.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sep 2003 -/// @version $Id: MSVehicleTransfer.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSVehicleTransfer.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A mover of vehicles that got stucked due to grid locks /****************************************************************************/ @@ -31,7 +31,6 @@ #endif #include -#include #include #include "MSNet.h" #include "MSLane.h" @@ -49,6 +48,7 @@ // static member definitions // =========================================================================== MSVehicleTransfer* MSVehicleTransfer::myInstance = 0; +const SUMOReal MSVehicleTransfer::TeleportMinSpeed = 1; // =========================================================================== @@ -56,20 +56,19 @@ // =========================================================================== void MSVehicleTransfer::addVeh(const SUMOTime t, MSVehicle* veh) { - // get the current edge of the vehicle - const MSEdge* e = veh->getEdge(); if (veh->isParking()) { veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_PARKING); } else { + veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT); + MSNet::getInstance()->informVehicleStateListener(veh, MSNet::VEHICLE_STATE_STARTING_TELEPORT); if ((veh->succEdge(1) == 0) || veh->enterLaneAtMove(veh->succEdge(1)->getLanes()[0], true)) { - veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); return; } - veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT); - MSNet::getInstance()->informVehicleStateListener(veh, MSNet::VEHICLE_STATE_STARTING_TELEPORT); } - myVehicles.push_back(VehicleInformation(veh, t + TIME2STEPS(e->getCurrentTravelTime()), veh->isParking())); + myVehicles.push_back(VehicleInformation(veh, + t + TIME2STEPS(veh->getEdge()->getCurrentTravelTime(TeleportMinSpeed)), + veh->isParking())); } @@ -107,28 +106,26 @@ } } else { // handle teleporting vehicles - if (l->freeInsertion(*(desc.myVeh), MIN2(l->getMaxSpeed(), desc.myVeh->getMaxSpeed()), MSMoveReminder::NOTIFICATION_TELEPORT)) { + if (l->freeInsertion(*(desc.myVeh), MIN2(l->getSpeedLimit(), desc.myVeh->getMaxSpeed()), MSMoveReminder::NOTIFICATION_TELEPORT)) { WRITE_WARNING("Vehicle '" + desc.myVeh->getID() + "' ends teleporting on edge '" + e->getID() + "', simulation time " + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); MSNet::getInstance()->informVehicleStateListener(desc.myVeh, MSNet::VEHICLE_STATE_ENDING_TELEPORT); i = myVehicles.erase(i); } else { // could not insert. maybe we should proceed in virtual space if (desc.myProceedTime < time) { - // get the lanes of the next edge (the one the vehicle wiil be - // virtually on after all these computations) + // active move reminders desc.myVeh->leaveLane(MSMoveReminder::NOTIFICATION_TELEPORT); - // get the one beyond the one the vehicle moved to - // !!! only move reminders are called but the edge is not advanced - const MSEdge* nextEdge = desc.myVeh->succEdge(1); // let the vehicle move to the next edge - if (nextEdge == 0) { + const bool hasArrived = (desc.myVeh->succEdge(1) == 0 || + desc.myVeh->enterLaneAtMove(desc.myVeh->succEdge(1)->getLanes()[0], true)); + if (hasArrived) { WRITE_WARNING("Vehicle '" + desc.myVeh->getID() + "' ends teleporting on end edge '" + e->getID() + "'."); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(desc.myVeh); i = myVehicles.erase(i); continue; } // use current travel time to determine when to move the vehicle forward - desc.myProceedTime = time + TIME2STEPS(e->getCurrentTravelTime()); + desc.myProceedTime = time + TIME2STEPS(e->getCurrentTravelTime(TeleportMinSpeed)); } ++i; } diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicleTransfer.h sumo-0.16.0~dfsg/src/microsim/MSVehicleTransfer.h --- sumo-0.15.0~dfsg/src/microsim/MSVehicleTransfer.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicleTransfer.h 2012-09-25 22:01:39.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sep 2003 -/// @version $Id: MSVehicleTransfer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSVehicleTransfer.h 12636 2012-08-31 12:24:43Z namdre $ /// // A mover of vehicles that got stucked due to grid locks // This class also serves as container for parking vehicles @@ -64,7 +64,7 @@ class MSVehicleTransfer { public: /// @brief Destructor - virtual ~MSVehicleTransfer() ; + virtual ~MSVehicleTransfer(); /** @brief Adds a vehicle to this transfer object @@ -75,7 +75,7 @@ * * @param[in] veh The vehicle to add */ - void addVeh(const SUMOTime t, MSVehicle* veh) ; + void addVeh(const SUMOTime t, MSVehicle* veh); /** @brief Checks "movement" of stored vehicles @@ -86,25 +86,27 @@ * * @param[in] time The current simulation time */ - void checkInsertions(SUMOTime time) ; + void checkInsertions(SUMOTime time); /** @brief Checks whether stored vehicles are present * * @return whether any vehicles wait for transfer */ - bool hasPending() const ; + bool hasPending() const; /** @brief Returns the instance of this object * @return The singleton instance */ - static MSVehicleTransfer* getInstance() ; + static MSVehicleTransfer* getInstance(); + /// @brief The minimum speed while teleporting + static const SUMOReal TeleportMinSpeed; private: /// @brief Constructor - MSVehicleTransfer() ; + MSVehicleTransfer(); protected: diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicleType.cpp sumo-0.16.0~dfsg/src/microsim/MSVehicleType.cpp --- sumo-0.15.0~dfsg/src/microsim/MSVehicleType.cpp 2012-02-16 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicleType.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Thimor Bohn /// @author Michael Behrisch /// @date Tue, 06 Mar 2001 -/// @version $Id: MSVehicleType.cpp 11905 2012-02-15 22:39:36Z behrisch $ +/// @version $Id: MSVehicleType.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The car-following model and parameter /****************************************************************************/ @@ -42,6 +42,8 @@ #include "cfmodels/MSCFModel_Kerner.h" #include "cfmodels/MSCFModel_Krauss.h" #include "cfmodels/MSCFModel_KraussOrig1.h" +#include "cfmodels/MSCFModel_SmartSK.h" +#include "cfmodels/MSCFModel_Daniel1.h" #include "cfmodels/MSCFModel_PWag2009.h" #include "cfmodels/MSCFModel_Wiedemann.h" #include "MSVehicleType.h" @@ -54,24 +56,9 @@ // =========================================================================== // method definitions // =========================================================================== -MSVehicleType::MSVehicleType(const std::string& id, const SUMOReal length, - const SUMOReal minGap, const SUMOReal maxSpeed, const SUMOReal prob, - const SUMOReal speedFactor, const SUMOReal speedDev, - const SUMOVehicleClass vclass, - const SUMOEmissionClass emissionClass, - const SUMOReal guiWidth, const SUMOReal height, - const SUMOVehicleShape shape, const std::string osgFile, - const std::string& lcModel, - const RGBColor& c) - : myID(id), myLength(length), - myMinGap(minGap), myMaxSpeed(maxSpeed), - myDefaultProbability(prob), mySpeedFactor(speedFactor), - mySpeedDev(speedDev), myLaneChangeModel(lcModel), - myEmissionClass(emissionClass), myColor(c), - myVehicleClass(vclass), myWidth(guiWidth), - myHeight(height), myShape(shape), myOSGFile(osgFile), - myOriginalType(0) { - assert(myLength > 0); +MSVehicleType::MSVehicleType(const SUMOVTypeParameter& parameter) + : myParameter(parameter), myOriginalType(0) { + assert(getLength() > 0); assert(getMaxSpeed() > 0); } @@ -81,24 +68,34 @@ } +SUMOReal +MSVehicleType::computeChosenSpeedDeviation(MTRand& rng) const { + // for speedDev = 0.1, most 95% of the vehicles will drive between 80% and 120% of speedLimit * speedFactor + const SUMOReal devA = MIN2(SUMOReal(2.), RandHelper::randNorm(0, 1., rng)); + // avoid voluntary speeds below 20% of the requested speedFactor + return MAX2(0.2 * myParameter.speedFactor, + (devA * myParameter.speedDev + 1.) * myParameter.speedFactor); +} + + void MSVehicleType::saveState(std::ostream& os) { - FileHelpers::writeString(os, myID); - FileHelpers::writeFloat(os, myLength); - FileHelpers::writeFloat(os, myMinGap); + FileHelpers::writeString(os, myParameter.id); + FileHelpers::writeFloat(os, myParameter.length); + FileHelpers::writeFloat(os, myParameter.minGap); FileHelpers::writeFloat(os, getMaxSpeed()); - FileHelpers::writeInt(os, (int) myVehicleClass); - FileHelpers::writeInt(os, (int) myEmissionClass); - FileHelpers::writeInt(os, (int) myShape); - FileHelpers::writeFloat(os, myWidth); - FileHelpers::writeFloat(os, myDefaultProbability); - FileHelpers::writeFloat(os, mySpeedFactor); - FileHelpers::writeFloat(os, mySpeedDev); - FileHelpers::writeFloat(os, myColor.red()); - FileHelpers::writeFloat(os, myColor.green()); - FileHelpers::writeFloat(os, myColor.blue()); + FileHelpers::writeInt(os, (int) myParameter.vehicleClass); + FileHelpers::writeInt(os, (int) myParameter.emissionClass); + FileHelpers::writeInt(os, (int) myParameter.shape); + FileHelpers::writeFloat(os, myParameter.width); + FileHelpers::writeFloat(os, myParameter.defaultProbability); + FileHelpers::writeFloat(os, myParameter.speedFactor); + FileHelpers::writeFloat(os, myParameter.speedDev); + FileHelpers::writeFloat(os, myParameter.color.red()); + FileHelpers::writeFloat(os, myParameter.color.green()); + FileHelpers::writeFloat(os, myParameter.color.blue()); FileHelpers::writeInt(os, myCarFollowModel->getModelID()); - FileHelpers::writeString(os, myLaneChangeModel); + FileHelpers::writeString(os, myParameter.lcModel); //myCarFollowModel->saveState(os); } @@ -108,9 +105,9 @@ MSVehicleType::setLength(const SUMOReal& length) { assert(myOriginalType != 0); if (length < 0) { - myLength = myOriginalType->myLength; + myParameter.length = myOriginalType->getLength(); } else { - myLength = length; + myParameter.length = length; } } @@ -119,9 +116,9 @@ MSVehicleType::setMinGap(const SUMOReal& minGap) { assert(myOriginalType != 0); if (minGap < 0) { - myMinGap = myOriginalType->myMinGap; + myParameter.minGap = myOriginalType->getMinGap(); } else { - myMinGap = minGap; + myParameter.minGap = minGap; } } @@ -130,16 +127,16 @@ MSVehicleType::setMaxSpeed(const SUMOReal& maxSpeed) { assert(myOriginalType != 0); if (maxSpeed < 0) { - myMaxSpeed = myOriginalType->myMaxSpeed; + myParameter.maxSpeed = myOriginalType->getMaxSpeed(); } else { - myMaxSpeed = maxSpeed; + myParameter.maxSpeed = maxSpeed; } } void MSVehicleType::setVClass(SUMOVehicleClass vclass) { - myVehicleClass = vclass; + myParameter.vehicleClass = vclass; } @@ -147,9 +144,9 @@ MSVehicleType::setDefaultProbability(const SUMOReal& prob) { assert(myOriginalType != 0); if (prob < 0) { - myDefaultProbability = myOriginalType->myDefaultProbability; + myParameter.defaultProbability = myOriginalType->getDefaultProbability(); } else { - myDefaultProbability = prob; + myParameter.defaultProbability = prob; } } @@ -158,9 +155,9 @@ MSVehicleType::setSpeedFactor(const SUMOReal& factor) { assert(myOriginalType != 0); if (factor < 0) { - mySpeedFactor = myOriginalType->mySpeedFactor; + myParameter.speedFactor = myOriginalType->getSpeedFactor(); } else { - mySpeedFactor = factor; + myParameter.speedFactor = factor; } } @@ -169,22 +166,22 @@ MSVehicleType::setSpeedDeviation(const SUMOReal& dev) { assert(myOriginalType != 0); if (dev < 0) { - mySpeedDev = myOriginalType->mySpeedDev; + myParameter.speedDev = myOriginalType->getSpeedDeviation(); } else { - mySpeedDev = dev; + myParameter.speedDev = dev; } } void MSVehicleType::setEmissionClass(SUMOEmissionClass eclass) { - myEmissionClass = eclass; + myParameter.emissionClass = eclass; } void MSVehicleType::setColor(const RGBColor& color) { - myColor = color; + myParameter.color = color; } @@ -192,16 +189,16 @@ MSVehicleType::setWidth(const SUMOReal& width) { assert(myOriginalType != 0); if (width < 0) { - myWidth = myOriginalType->myWidth; + myParameter.width = myOriginalType->getWidth(); } else { - myWidth = width; + myParameter.width = width; } } void MSVehicleType::setShape(SUMOVehicleShape shape) { - myShape = shape; + myParameter.shape = shape; } @@ -209,10 +206,7 @@ // ------------ Static methods for building vehicle types MSVehicleType* MSVehicleType::build(SUMOVTypeParameter& from) { - MSVehicleType* vtype = new MSVehicleType( - from.id, from.length, from.minGap, from.maxSpeed, - from.defaultProbability, from.speedFactor, from.speedDev, from.vehicleClass, from.emissionClass, - from.width, from.height, from.shape, from.osgFile, from.lcModel, from.color); + MSVehicleType* vtype = new MSVehicleType(from); MSCFModel* model = 0; switch (from.cfModel) { case SUMO_TAG_CF_IDM: @@ -247,6 +241,30 @@ from.get(SUMO_ATTR_SIGMA, DEFAULT_VEH_SIGMA), from.get(SUMO_ATTR_TAU, DEFAULT_VEH_TAU)); break; + case SUMO_TAG_CF_SMART_SK: + model = new MSCFModel_SmartSK(vtype, + from.get(SUMO_ATTR_ACCEL, DEFAULT_VEH_ACCEL), + from.get(SUMO_ATTR_DECEL, DEFAULT_VEH_DECEL), + from.get(SUMO_ATTR_SIGMA, DEFAULT_VEH_SIGMA), + from.get(SUMO_ATTR_TAU, DEFAULT_VEH_TAU), + from.get(SUMO_ATTR_TMP1, DEFAULT_VEH_TMP1), + from.get(SUMO_ATTR_TMP2, DEFAULT_VEH_TMP2), + from.get(SUMO_ATTR_TMP3, DEFAULT_VEH_TMP3), + from.get(SUMO_ATTR_TMP4, DEFAULT_VEH_TMP4), + from.get(SUMO_ATTR_TMP5, DEFAULT_VEH_TMP5)); + break; + case SUMO_TAG_CF_DANIEL1: + model = new MSCFModel_Daniel1(vtype, + from.get(SUMO_ATTR_ACCEL, DEFAULT_VEH_ACCEL), + from.get(SUMO_ATTR_DECEL, DEFAULT_VEH_DECEL), + from.get(SUMO_ATTR_SIGMA, DEFAULT_VEH_SIGMA), + from.get(SUMO_ATTR_TAU, DEFAULT_VEH_TAU), + from.get(SUMO_ATTR_TMP1, DEFAULT_VEH_TMP1), + from.get(SUMO_ATTR_TMP2, DEFAULT_VEH_TMP2), + from.get(SUMO_ATTR_TMP3, DEFAULT_VEH_TMP3), + from.get(SUMO_ATTR_TMP4, DEFAULT_VEH_TMP4), + from.get(SUMO_ATTR_TMP5, DEFAULT_VEH_TMP5)); + break; case SUMO_TAG_CF_PWAGNER2009: model = new MSCFModel_PWag2009(vtype, from.get(SUMO_ATTR_ACCEL, DEFAULT_VEH_ACCEL), @@ -279,10 +297,8 @@ MSVehicleType* MSVehicleType::build(const std::string& id, const MSVehicleType* from) { - MSVehicleType* vtype = new MSVehicleType( - id, from->myLength, from->myMinGap, from->myMaxSpeed, - from->myDefaultProbability, from->mySpeedFactor, from->mySpeedDev, from->myVehicleClass, from->myEmissionClass, - from->myWidth, from->myHeight, from->myShape, from->myOSGFile, from->myLaneChangeModel, from->myColor); + MSVehicleType* vtype = new MSVehicleType(from->myParameter); + vtype->myParameter.id = id; vtype->myCarFollowModel = from->myCarFollowModel->duplicate(vtype); vtype->myOriginalType = from->myOriginalType != 0 ? from->myOriginalType : from; return vtype; diff -Nru sumo-0.15.0~dfsg/src/microsim/MSVehicleType.h sumo-0.16.0~dfsg/src/microsim/MSVehicleType.h --- sumo-0.15.0~dfsg/src/microsim/MSVehicleType.h 2012-02-16 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/MSVehicleType.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSVehicleType.h 11905 2012-02-15 22:39:36Z behrisch $ +/// @version $Id: MSVehicleType.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The car-following model and parameter /****************************************************************************/ @@ -43,6 +43,7 @@ #include #include #include +#include // =========================================================================== @@ -74,37 +75,23 @@ public: /** @brief Constructor. * - * @param[in] id The vehicle type's id - * @param[in] length The length of vehicles that of this type - * @param[in] minGap The free space in front of the vehicles of this class - * @param[in] maxSpeed The maximum velocity vehicles of this type may drive with - * @param[in] prob The probability of this vehicle type - * @param[in] speedFactor The speed factor to scale maximum speed with - * @param[in] speedDev The speed deviation - * @param[in] vclass The class vehicles of this type belong to - * @param[in] emissionClass The emission class vehicles of this type belong to - * @param[in] width The width of the vehicles when being drawn - * @param[in] height The height of the vehicles when being drawn - * @param[in] shape How vehicles of this class shall be drawn - * @param[in] osgFile Model file of this class - * @param[in] lcModel Name of the lane-change model to use - * @param[in] c Color of this vehicle type - */ - MSVehicleType(const std::string& id, const SUMOReal lengthWithGap, - const SUMOReal minGap, const SUMOReal maxSpeed, - const SUMOReal prob, const SUMOReal speedFactor, - const SUMOReal speedDev, const SUMOVehicleClass vclass, - const SUMOEmissionClass emissionClass, - const SUMOReal width, const SUMOReal height, - const SUMOVehicleShape shape, const std::string osgFile, - const std::string& lcModel, - const RGBColor& c) ; + * @param[in] parameter The vehicle type's parameter + */ + MSVehicleType(const SUMOVTypeParameter& parameter); /// @brief Destructor - virtual ~MSVehicleType() ; + virtual ~MSVehicleType(); + /** @brief Returns whether the given parameter was set + * @param[in] what The parameter which one asks for + * @return Whether the given parameter was set + */ + bool wasSet(int what) const { + return (myParameter.setParameter & what) != 0; + } + /// @name Atomar getter for simulation /// @{ @@ -113,7 +100,7 @@ * @return This type's id */ const std::string& getID() const { - return myID; + return myParameter.id; } @@ -121,7 +108,7 @@ * @return The length vehicles of this type have in m */ SUMOReal getLength() const { - return myLength; + return myParameter.length; } @@ -129,7 +116,7 @@ * @return The length vehicles of this type have (including the minimum gap in m */ SUMOReal getLengthWithGap() const { - return myLength + myMinGap; + return myParameter.length + myParameter.minGap; } @@ -137,7 +124,7 @@ * @return The place before the vehicle */ SUMOReal getMinGap() const { - return myMinGap; + return myParameter.minGap; } @@ -161,36 +148,21 @@ * @return The maximum speed (in m/s) of vehicles of this class */ SUMOReal getMaxSpeed() const { - return myMaxSpeed; - } - - /** @brief Get vehicle's maximum speed [m/s]. - * @return The maximum speed (in m/s) of vehicles of this class - */ - SUMOReal hasSpeedDeviation() const { - return mySpeedDev != 0.0 || mySpeedFactor != 1.0; + return myParameter.maxSpeed; } - /** @brief Get vehicle's maximum speed [m/s] drawn from a normal distribution. - * - * The speed is calculated relative to the reference speed (which is usually - * the maximum allowed speed on a lane or edge). - * @return The maximum speed (in m/s) of vehicles of this class + /** @brief Computes and returns the speed deviation + * @return A new, random speed deviation */ - SUMOReal getMaxSpeedWithDeviation(SUMOReal referenceSpeed) const { - SUMOReal meanSpeed = mySpeedFactor * referenceSpeed; - SUMOReal speedDev = mySpeedDev * meanSpeed; - SUMOReal speed = MIN3(RandHelper::randNorm(meanSpeed, speedDev), meanSpeed + 2 * speedDev, myMaxSpeed); - return MAX3((SUMOReal)0.0, speed, meanSpeed - 2 * speedDev); - } + SUMOReal computeChosenSpeedDeviation(MTRand& rng) const; /** @brief Get the default probability of this vehicle type * @return The probability to use this type */ SUMOReal getDefaultProbability() const { - return myDefaultProbability; + return myParameter.defaultProbability; } @@ -199,7 +171,7 @@ * @see SUMOVehicleClass */ SUMOVehicleClass getVehicleClass() const { - return myVehicleClass; + return myParameter.vehicleClass; } @@ -208,7 +180,7 @@ * @see SUMOEmissionClass */ SUMOEmissionClass getEmissionClass() const { - return myEmissionClass; + return myParameter.emissionClass; } @@ -216,7 +188,7 @@ * @return The color of this type */ const RGBColor& getColor() const { - return myColor; + return myParameter.color; } @@ -224,7 +196,7 @@ * @return The speed factor of this type */ SUMOReal getSpeedFactor() const { - return mySpeedFactor; + return myParameter.speedFactor; } @@ -232,7 +204,7 @@ * @return The speed deviation of this type */ SUMOReal getSpeedDeviation() const { - return mySpeedDev; + return myParameter.speedDev; } /// @} @@ -245,14 +217,14 @@ * @return The width of this type's vehicles */ SUMOReal getWidth() const { - return myWidth; + return myParameter.width; } /** @brief Get the height which vehicles of this class shall have when being drawn * @return The height of this type's vehicles */ SUMOReal getHeight() const { - return myHeight; + return myParameter.height; } /** @brief Get this vehicle type's shape @@ -260,14 +232,22 @@ * @see SUMOVehicleShape */ SUMOVehicleShape getGuiShape() const { - return myShape; + return myParameter.shape; } /** @brief Get this vehicle type's 3D model file name * @return The model file name of this vehicle type */ std::string getOSGFile() const { - return myOSGFile; + return myParameter.osgFile; + } + + + /** @brief Get this vehicle type's raster model file name + * @return The raster file name of this vehicle type + */ + std::string getImgFile() const { + return myParameter.imgFile; } /// @} @@ -291,7 +271,7 @@ * * @param[in] length The new length of this type */ - void setLength(const SUMOReal& length) ; + void setLength(const SUMOReal& length); /** @brief Set a new value for this type's minimum gap @@ -301,7 +281,7 @@ * * @param[in] offset The new minimum gap of this type */ - void setMinGap(const SUMOReal& minGap) ; + void setMinGap(const SUMOReal& minGap); /** @brief Set a new value for this type's maximum speed @@ -311,13 +291,13 @@ * * @param[in] maxSpeed The new maximum speed of this type */ - void setMaxSpeed(const SUMOReal& maxSpeed) ; + void setMaxSpeed(const SUMOReal& maxSpeed); /** @brief Set a new value for this type's vehicle class * @param[in] vclass The new vehicle class of this type */ - void setVClass(SUMOVehicleClass vclass) ; + void setVClass(SUMOVehicleClass vclass); /** @brief Set a new value for this type's default probability @@ -327,7 +307,7 @@ * * @param[in] prob The new default probability of this type */ - void setDefaultProbability(const SUMOReal& prob) ; + void setDefaultProbability(const SUMOReal& prob); /** @brief Set a new value for this type's speed factor @@ -337,7 +317,7 @@ * * @param[in] factor The new speed factor of this type */ - void setSpeedFactor(const SUMOReal& factor) ; + void setSpeedFactor(const SUMOReal& factor); /** @brief Set a new value for this type's speed deviation @@ -347,19 +327,19 @@ * * @param[in] dev The new speed deviation of this type */ - void setSpeedDeviation(const SUMOReal& dev) ; + void setSpeedDeviation(const SUMOReal& dev); /** @brief Set a new value for this type's emission class * @param[in] eclass The new emission class of this type */ - void setEmissionClass(SUMOEmissionClass eclass) ; + void setEmissionClass(SUMOEmissionClass eclass); /** @brief Set a new value for this type's color * @param[in] color The new color of this type */ - void setColor(const RGBColor& color) ; + void setColor(const RGBColor& color); /** @brief Set a new value for this type's width @@ -369,13 +349,13 @@ * * @param[in] width The new width of this type */ - void setWidth(const SUMOReal& width) ; + void setWidth(const SUMOReal& width); /** @brief Set a new value for this type's shape * @param[in] shape The new shape of this type */ - void setShape(SUMOVehicleShape shape) ; + void setShape(SUMOVehicleShape shape); /// @} @@ -388,7 +368,7 @@ * @return The built vehicle type * @exception ProcessError on false values (not et used) */ - static MSVehicleType* build(SUMOVTypeParameter& from) ; + static MSVehicleType* build(SUMOVTypeParameter& from); /** @brief Duplicates the microsim vehicle type giving it a the given id @@ -396,7 +376,7 @@ * @param[in] from The vehicle type * @return The built vehicle type */ - static MSVehicleType* build(const std::string& id, const MSVehicleType* from) ; + static MSVehicleType* build(const std::string& id, const MSVehicleType* from); /// @} @@ -409,60 +389,12 @@ private: - /// @brief Unique ID - std::string myID; - - /// @brief Vehicles' length [m] - SUMOReal myLength; - - /// @brief This class' free space in front of the vehicle itself - SUMOReal myMinGap; - - /// @brief Vehicles' maximum speed [m/s] - SUMOReal myMaxSpeed; - - /// @brief The probability when being added to a distribution without an explicit probability - SUMOReal myDefaultProbability; - - /// @brief The factor by which the maximum speed may deviate from the allowed max speed on the street - SUMOReal mySpeedFactor; - - /// @brief The standard deviation for speed variations - SUMOReal mySpeedDev; + /// @brief the parameter container + SUMOVTypeParameter myParameter; /// @brief ID of the car following model. MSCFModel* myCarFollowModel; - /// @brief ID of the lane change model. - std::string myLaneChangeModel; - - /// @brief The emission class of such vehicles - SUMOEmissionClass myEmissionClass; - - /// @brief The color - RGBColor myColor; - - /// @brief The vehicles' class - SUMOVehicleClass myVehicleClass; - - - /// @name Values for drawing this class' vehicles - /// @{ - - /// @brief This class' width - SUMOReal myWidth; - - /// @brief This class' height - SUMOReal myHeight; - - /// @brief This class' shape - SUMOVehicleShape myShape; - - /// @brief This class' model file - std::string myOSGFile; - /// @} - - /// @brief The original type const MSVehicleType* myOriginalType; diff -Nru sumo-0.15.0~dfsg/src/microsim/Makefile.in sumo-0.16.0~dfsg/src/microsim/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -154,6 +154,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -184,6 +185,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -218,6 +220,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -251,7 +254,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/microsim/actions/Makefile.in sumo-0.16.0~dfsg/src/microsim/actions/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/actions/Makefile.in 2012-03-14 00:11:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/actions/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -104,6 +104,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -134,6 +135,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -168,6 +170,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -201,7 +204,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,109 @@ +/****************************************************************************/ +/// @file MSCFModel_Daniel1.cpp +/// @author Daniel Krajzewicz +/// @date Tue, 05 Jun 2012 +/// @version $Id: MSCFModel_Daniel1.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// The original Krauss (1998) car-following model and parameter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include "MSCFModel_Daniel1.h" +#include +#include + + +// =========================================================================== +// method definitions +// =========================================================================== +MSCFModel_Daniel1::MSCFModel_Daniel1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, + SUMOReal dawdle, SUMOReal headwayTime, + SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5) + : MSCFModel(vtype, accel, decel, headwayTime), myDawdle(dawdle), myTauDecel(decel* headwayTime), + myTmp1(tmp1), myTmp2(tmp2), myTmp3(tmp3), myTmp4(tmp4), myTmp5(tmp5) { +} + + +MSCFModel_Daniel1::~MSCFModel_Daniel1() {} + + +SUMOReal +MSCFModel_Daniel1::moveHelper(MSVehicle* const veh, SUMOReal vPos) const { + const SUMOReal oldV = veh->getSpeed(); // save old v for optional acceleration computation + const SUMOReal vSafe = MIN2(vPos, veh->processNextStop(vPos)); // process stops + // we need the acceleration for emission computation; + // in this case, we neglect dawdling, nonetheless, using + // vSafe does not incorporate speed reduction due to interaction + // on lane changing + const SUMOReal vMin = getSpeedAfterMaxDecel(oldV); + const SUMOReal vMax = MIN3(veh->getLane()->getVehicleMaxSpeed(veh), maxNextSpeed(oldV), vSafe); +#ifdef _DEBUG + if (vMin > vMax) { + WRITE_WARNING("Vehicle's '" + veh->getID() + "' maximum speed is lower than the minimum speed (min: " + toString(vMin) + ", max: " + toString(vMax) + ")."); + } +#endif + return veh->getLaneChangeModel().patchSpeed(vMin, MAX2(vMin, dawdle(vMax)), vMax, *this); +} + + +SUMOReal +MSCFModel_Daniel1::followSpeed(const MSVehicle* const /*veh*/, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { + return MIN2(_vsafe(gap, predSpeed), maxNextSpeed(speed)); +} + + +SUMOReal +MSCFModel_Daniel1::stopSpeed(const MSVehicle* const veh, SUMOReal gap) const { + return MIN2(_vsafe(gap, 0), maxNextSpeed(veh->getSpeed())); +} + + +SUMOReal +MSCFModel_Daniel1::dawdle(SUMOReal speed) const { + return MAX2(SUMOReal(0), speed - ACCEL2SPEED(myDawdle * myAccel * RandHelper::rand())); +} + + +/** Returns the SK-vsafe. */ +SUMOReal MSCFModel_Daniel1::_vsafe(SUMOReal gap, SUMOReal predSpeed) const { + if (predSpeed == 0 && gap < 0.01) { + return 0; + } + SUMOReal vsafe = (SUMOReal)(-1. * myTauDecel + + sqrt( + myTauDecel * myTauDecel + + (predSpeed * predSpeed) + + (2. * myDecel * gap) + )); + assert(vsafe >= 0); + return vsafe; +} + + +MSCFModel* +MSCFModel_Daniel1::duplicate(const MSVehicleType* vtype) const { + return new MSCFModel_Daniel1(vtype, myAccel, myDecel, myDawdle, myHeadwayTime, + myTmp1, myTmp2, myTmp3, myTmp4, myTmp5); +} diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.h sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.h --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,173 @@ +/****************************************************************************/ +/// @file MSCFModel_Daniel1.h +/// @author Daniel Krajzewicz +/// @date Tue, 05 Jun 2012 +/// @version $Id: MSCFModel_Daniel1.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// The original Krauss (1998) car-following model and parameter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSCFModel_Daniel1_h +#define MSCFModel_Daniel1_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class MSCFModel_Daniel1 + * @brief The original Krauss (1998) car-following model and parameter + * @see MSCFModel + */ +class MSCFModel_Daniel1 : public MSCFModel { +public: + /** @brief Constructor + * @param[in] accel The maximum acceleration + * @param[in] decel The maximum deceleration + * @param[in] dawdle The driver imperfection + * @param[in] tau The driver's reaction time + */ + MSCFModel_Daniel1(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime, + SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5); + + + /// @brief Destructor + ~MSCFModel_Daniel1(); + + + /// @name Implementations of the MSCFModel interface + /// @{ + + /** @brief Applies interaction with stops and lane changing model influences + * @param[in] veh The ego vehicle + * @param[in] vPos The possible velocity + * @return The velocity after applying interactions with stops and lane change model influences + */ + SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const; + + + /** @brief Computes the vehicle's safe speed (no dawdling) + * @param[in] veh The vehicle (EGO) + * @param[in] speed The vehicle's speed + * @param[in] gap2pred The (netto) distance to the LEADER + * @param[in] predSpeed The speed of LEADER + * @return EGO's safe speed + * @see MSCFModel::ffeV + */ + virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const; + + + /** @brief Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) + * @param[in] veh The vehicle (EGO) + * @param[in] gap2pred The (netto) distance to the the obstacle + * @return EGO's safe speed for approaching a non-moving obstacle + * @see MSCFModel::ffeS + * @todo generic Interface, models can call for the values they need + */ + virtual SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const; + + + /** @brief Returns the model's name + * @return The model's name + * @see MSCFModel::getModelName + */ + virtual int getModelID() const { + return SUMO_TAG_CF_DANIEL1; + } + + + /** @brief Get the driver's imperfection + * @return The imperfection of drivers of this class + */ + SUMOReal getImperfection() const { + return myDawdle; + } + /// @} + + + + /// @name Setter methods + /// @{ + /** @brief Sets a new value for maximum deceleration [m/s^2] + * @param[in] accel The new deceleration in m/s^2 + */ + void setMaxDecel(SUMOReal decel) { + myDecel = decel; + myTauDecel = myDecel * myHeadwayTime; + } + + + /** @brief Sets a new value for driver imperfection + * @param[in] accel The new driver imperfection + */ + void setImperfection(SUMOReal imperfection) { + myDawdle = imperfection; + } + + + /** @brief Sets a new value for driver reaction time [s] + * @param[in] headwayTime The new driver reaction time (in s) + */ + void setHeadwayTime(SUMOReal headwayTime) { + myHeadwayTime = headwayTime; + myTauDecel = myDecel * headwayTime; + } + /// @} + + + /** @brief Duplicates the car-following model + * @param[in] vtype The vehicle type this model belongs to (1:1) + * @return A duplicate of this car-following model + */ + virtual MSCFModel* duplicate(const MSVehicleType* vtype) const; + +private: + /** @brief Returns the "safe" velocity + * @param[in] gap2pred The (netto) distance to the LEADER + * @param[in] predSpeed The LEADER's speed + * @return the safe velocity + */ + virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const; + + + /** @brief Applies driver imperfection (dawdling / sigma) + * @param[in] speed The speed with no dawdling + * @return The speed after dawdling + */ + virtual SUMOReal dawdle(SUMOReal speed) const; + +protected: + /// @brief The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max. + SUMOReal myDawdle; + + /// @brief The precomputed value for myDecel*myTau + SUMOReal myTauDecel; + + /// @brief temporary (testing) parameter + SUMOReal myTmp1, myTmp2, myTmp3, myTmp4, myTmp5; + +}; + +#endif /* MSCFModel_Daniel1_H */ + diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.cpp 2012-03-13 12:52:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 03 Sep 2009 -/// @version $Id: MSCFModel_IDM.cpp 12073 2012-03-13 07:48:27Z dkrajzew $ +/// @version $Id: MSCFModel_IDM.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The Intelligent Driver Model (IDM) car-following model /****************************************************************************/ @@ -46,17 +46,21 @@ SUMOReal internalStepping) : MSCFModel(vtype, accel, decel, headwayTime), myDelta(delta), myAdaptationFactor(1.), myAdaptationTime(0.), myExpFactor(0), - myTwoSqrtAccelDecel(SUMOReal(2 * sqrt(accel* decel))), myIterations(MAX2(1, int(TS / internalStepping + .5))) { + myIterations(MAX2(1, int(TS / internalStepping + .5))), + myTwoSqrtAccelDecel(SUMOReal(2 * sqrt(accel* decel))) { } MSCFModel_IDM::MSCFModel_IDM(const MSVehicleType* vtype, - SUMOReal accel, SUMOReal decel, SUMOReal headwayTime, + SUMOReal accel, SUMOReal decel, + SUMOReal headwayTime, SUMOReal adaptationFactor, SUMOReal adaptationTime, SUMOReal internalStepping) : MSCFModel(vtype, accel, decel, headwayTime), myDelta(4.), - myAdaptationFactor(adaptationFactor), myAdaptationTime(adaptationTime), myExpFactor(exp(-TS / adaptationTime)), - myTwoSqrtAccelDecel(SUMOReal(2 * sqrt(accel* decel))), myIterations(MAX2(1, int(TS / internalStepping + .5))) { + myAdaptationFactor(adaptationFactor), myAdaptationTime(adaptationTime), + myExpFactor(exp(-TS / adaptationTime)), + myIterations(MAX2(1, int(TS / internalStepping + .5))), + myTwoSqrtAccelDecel(SUMOReal(2 * sqrt(accel* decel))) { } diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.h sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.h --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_IDM.h 2012-09-25 22:01:37.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 03 Sep 2009 -/// @version $Id: MSCFModel_IDM.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_IDM.h 12428 2012-06-26 11:24:19Z behrisch $ /// // The Intelligent Driver Model (IDM) car-following model /****************************************************************************/ @@ -158,7 +158,7 @@ SUMOReal _v(const MSVehicle* const veh, SUMOReal gap2pred, SUMOReal mySpeed, SUMOReal predSpeed, SUMOReal desSpeed) const; SUMOReal desiredSpeed(const MSVehicle* const veh) const { - return MIN2(myType->getMaxSpeed(), veh->getLane()->getMaxSpeed()); + return MIN2(myType->getMaxSpeed(), veh->getLane()->getVehicleMaxSpeed(veh)); } @@ -180,6 +180,10 @@ /// @brief A computational shortcut const SUMOReal myTwoSqrtAccelDecel; + +private: + /// @brief Invalidated assignment operator + MSCFModel_IDM& operator=(const MSCFModel_IDM& s); }; #endif /* MSCFMODEL_IDM_H */ diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Krauss.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Krauss.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 04 Aug 2009 -/// @version $Id: MSCFModel_Krauss.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_Krauss.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Krauss car-following model, with acceleration decrease and faster start /****************************************************************************/ @@ -53,13 +53,13 @@ SUMOReal MSCFModel_Krauss::followSpeed(const MSVehicle* const /*veh*/, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { - return MAX2(getSpeedAfterMaxDecel(speed), MIN2(_vsafe(gap, predSpeed, predMaxDecel), maxNextSpeed(speed))); + return MIN2(_vsafe(gap, predSpeed, predMaxDecel), maxNextSpeed(speed)); } SUMOReal MSCFModel_Krauss::stopSpeed(const MSVehicle* const veh, SUMOReal gap) const { - return MAX2(getSpeedAfterMaxDecel(veh->getSpeed()), MIN2(_vsafe(gap, 0, 0), maxNextSpeed(veh->getSpeed()))); + return MIN2(_vsafe(gap, 0, 0), maxNextSpeed(veh->getSpeed())); } @@ -83,6 +83,10 @@ /** Returns the SK-vsafe. */ SUMOReal MSCFModel_Krauss::_vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { + if (predSpeed < predMaxDecel) { + // avoid discretization error at low speeds + predSpeed = 0; + } if (predSpeed == 0) { if (gap < 0.01) { return 0; @@ -90,12 +94,17 @@ return (SUMOReal)(-myTauDecel + sqrt(myTauDecel * myTauDecel + 2. * myDecel * gap)); } if (predMaxDecel == 0) { - return (SUMOReal)(-myTauDecel + sqrt(myTauDecel * myTauDecel + predSpeed * predSpeed + 2. * myDecel * gap)); + // adapt speed to succeeding lane, no reaction time is involved + // g = (x-v)/b * (x+v)/2 + return (SUMOReal)sqrt(2 * gap * myDecel + predSpeed * predSpeed); + } - const SUMOReal speedReduction = ACCEL2SPEED(predMaxDecel); - const int predSteps = int(predSpeed / speedReduction); - const SUMOReal leaderContrib = 2. * myDecel * (gap + SPEED2DIST(predSteps * predSpeed - speedReduction * predSteps * (predSteps + 1) / 2)); - return (SUMOReal)(-myTauDecel + sqrt(myTauDecel * myTauDecel + leaderContrib)); + // follow + // g + (v^2 - a*v)/(2*a) = x*t + (x^2 - b*x)/(2*b) + 0.5 + return (SUMOReal)(0.5 * sqrt(4.0 * myDecel * (2.0 * gap + predSpeed * predSpeed / predMaxDecel - predSpeed - 1.0) + + (myDecel * (2.0 * myHeadwayTime - 1.0)) + * (myDecel * (2.0 * myHeadwayTime - 1.0))) + + myDecel * (0.5 - myHeadwayTime)); } diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 04 Aug 2009 -/// @version $Id: MSCFModel_KraussOrig1.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_KraussOrig1.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ @@ -59,13 +59,14 @@ // in this case, we neglect dawdling, nonetheless, using // vSafe does not incorporate speed reduction due to interaction // on lane changing - veh->setPreDawdleAcceleration(SPEED2ACCEL(vSafe - oldV)); - const SUMOReal vMin = MAX2((SUMOReal) 0, oldV - ACCEL2SPEED(myDecel)); - const SUMOReal vMax = MIN3(veh->getLane()->getMaxSpeed(), maxNextSpeed(oldV), vSafe); + const SUMOReal vMin = getSpeedAfterMaxDecel(oldV); + // do not exceed max decel even if it is unsafe + SUMOReal vMax = MAX2(vMin, + MIN3(veh->getLane()->getVehicleMaxSpeed(veh), maxNextSpeed(oldV), vSafe)); #ifdef _DEBUG - if (vMin > vMax) { - WRITE_WARNING("Vehicle's '" + veh->getID() + "' maximum speed is lower than the minimum speed (min: " + toString(vMin) + ", max: " + toString(vMax) + ")."); - } + //if (vMin > vMax) { + // WRITE_WARNING("Vehicle's '" + veh->getID() + "' maximum speed is lower than the minimum speed (min: " + toString(vMin) + ", max: " + toString(vMax) + ")."); + //} #endif return veh->getLaneChangeModel().patchSpeed(vMin, MAX2(vMin, dawdle(vMax)), vMax, *this); } diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 03.04.2010 -/// @version $Id: MSCFModel_PWag2009.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_PWag2009.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Scalable model based on Krauß by Peter Wagner /****************************************************************************/ @@ -53,56 +53,88 @@ SUMOReal MSCFModel_PWag2009::moveHelper(MSVehicle* const veh, SUMOReal vPos) const { const SUMOReal vNext = MSCFModel::moveHelper(veh, vPos); - const SUMOReal speed = veh->getSpeed(); VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables(); - // model should re-use acceleration from previous time-step: + SUMOReal apref = SPEED2ACCEL(vNext - veh->getSpeed()); + vars->aOld = apref; + return vNext; +} + +// in addition, the parameters myTauLast, probAP, and sigmaAcc are needed; sigmaAcc can use myDawdle +// myTauLast might use the current time-step size, but this yields eventually an extreme model, I would be +// more careful and set it to something around 0.3 or 0.4, which are among the shortest headways I have +// seen so far in data ... + +SUMOReal +MSCFModel_PWag2009::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { + if (predSpeed == 0 && gap < 0.01) { + return 0; + } + const SUMOReal vsafe = -myTauLastDecel + sqrt(myTauLastDecel * myTauLastDecel + predSpeed * predSpeed + 2.0 * myDecel * gap); + const SUMOReal asafe = SPEED2ACCEL(vsafe - speed); + VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables(); SUMOReal apref = vars->aOld; - const SUMOReal asafe = SPEED2ACCEL(vNext - speed); - if (apref <= asafe && RandHelper::rand() > myActionPointProbability * TS) { - std::pair l = veh->getLane()->getLeaderOnConsecutive(100., 0., speed, *veh, veh->getBestLanesContinuation(veh->getLane())); - if (l.first) { - apref = myDecelDivTau * (l.second + (l.first->getSpeed() - speed) * myHeadwayTime - speed * myHeadwayTime) / (speed + myTauDecel); - apref += myDawdle * RandHelper::rand((SUMOReal) - 1., (SUMOReal)1.); - } + if (apref <= asafe && RandHelper::rand() <= myActionPointProbability * TS) { + apref = myDecelDivTau * (gap + (predSpeed - speed) * myHeadwayTime - speed * myHeadwayTime) / (speed + myTauDecel); + apref = MIN2(apref, myAccel); + apref = MAX2(apref, -myDecel); + apref += myDawdle * RandHelper::rand((SUMOReal) - 1., (SUMOReal)1.); } if (apref > asafe) { apref = asafe; } - vars->aOld = apref; // save this value for the next time-step return MAX2((SUMOReal)0, speed + ACCEL2SPEED(apref)); } - -SUMOReal -MSCFModel_PWag2009::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { - return _v(veh, speed, gap, predSpeed); -} - - +// uses the safe speed and preferred acceleration with the same NORMAL tau to compute stopSpeed SUMOReal MSCFModel_PWag2009::stopSpeed(const MSVehicle* const veh, SUMOReal gap) const { - return _v(veh, veh->getSpeed(), gap, 0); + if (gap < 0.01) { + return 0; + } + const SUMOReal vsafe = -myTauDecel + sqrt(myTauDecel * myTauDecel + 2.0 * myDecel * gap); + const SUMOReal speed = veh->getSpeed(); + const SUMOReal asafe = SPEED2ACCEL(vsafe - speed); +// VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables(); + SUMOReal apref = myDecelDivTau * (gap - 2 * speed * myHeadwayTime) / (speed + myTauDecel); + if (apref <= asafe) { + apref = MIN2(apref, myAccel); + apref = MAX2(apref, -myDecel); + } else { + apref = asafe; + } + return MAX2((SUMOReal)0, vsafe + ACCEL2SPEED(apref)); } - +// this method should not do anything, since followSpeed() has taken care of dawdling already... SUMOReal MSCFModel_PWag2009::dawdle(SUMOReal speed) const { - return MAX2(SUMOReal(0), speed - ACCEL2SPEED(myDawdle * myAccel * RandHelper::rand())); -} - -// in addition, the parameters myTauLast, probAP, and sigmaAcc are needed; sigmaAcc can use myDawdle -// myTauLast might use the current time-step size, but this yields eventually an extreme model, I would be -// more careful and set it to something around 0.3 or 0.4, which are among the shortest headways I have -// seen so far in data ... -SUMOReal -MSCFModel_PWag2009::_v(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed) const { - if (predSpeed == 0 && gap < 0.01) { - return 0; - } - const SUMOReal vsafe = -myTauLastDecel + sqrt(myTauLastDecel * myTauLastDecel + predSpeed * predSpeed + 2.0 * myDecel * gap); - return MAX2((SUMOReal)0, vsafe); + return speed; +// return MAX2(SUMOReal(0), speed - ACCEL2SPEED(myDawdle * myAccel * RandHelper::rand())); } +// eventually, this method isn't needed anymore +//SUMOReal +//MSCFModel_PWag2009::_v(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed) const { +// if (predSpeed == 0 && gap < 0.01) { +// return 0; +// } +// const SUMOReal vsafe = -myTauLastDecel + sqrt(myTauLastDecel * myTauLastDecel + predSpeed * predSpeed + 2.0 * myDecel * gap); +// const SUMOReal asafe = SPEED2ACCEL(vsafe - speed); +// VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables(); +// SUMOReal apref = vars->aOld; +// if (apref <= asafe && RandHelper::rand() <= myActionPointProbability * TS) { +// apref = myDecelDivTau * (gap + (predSpeed - speed) * myHeadwayTime - speed * myHeadwayTime) / (speed + myTauDecel); +// if (apref>myAccel) +// apref = myAccel; +// if (apref<-myDecel) +// apref = -myDecel; +// apref += myDawdle * RandHelper::rand((SUMOReal) - 1., (SUMOReal)1.); +// } +// if (apref > asafe) +// apref = asafe; +// return MAX2((SUMOReal)0, vsafe+ACCEL2SPEED(apref)); +//} +// MSCFModel* MSCFModel_PWag2009::duplicate(const MSVehicleType* vtype) const { diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.h sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.h --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 03.04.2010 -/// @version $Id: MSCFModel_PWag2009.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_PWag2009.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Scalable model based on Krauß by Peter Wagner /****************************************************************************/ @@ -116,7 +116,9 @@ virtual MSCFModel::VehicleVariables* createVehicleVariables() const { - return new VehicleVariables(); + VehicleVariables* ret = new VehicleVariables(); + ret->aOld = 0.0; + return ret; } diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,174 @@ +/****************************************************************************/ +/// @file MSCFModel_SmartSK.cpp +/// @author Daniel Krajzewicz +/// @date Tue, 05 Jun 2012 +/// @version $Id: MSCFModel_SmartSK.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// A smarter SK +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include "MSCFModel_SmartSK.h" +#include +#include + + +// =========================================================================== +// method definitions +// =========================================================================== +MSCFModel_SmartSK::MSCFModel_SmartSK(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, + SUMOReal dawdle, SUMOReal headwayTime, + SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5) +// check whether setting these variables here with default values is ''good'' SUMO design +// SUMOReal tmp1=0.0, SUMOReal tmp2=5.0, SUMOReal tmp3=0.0, SUMOReal tmp4, SUMOReal tmp5) + : MSCFModel(vtype, accel, decel, headwayTime), myDawdle(dawdle), myTauDecel(decel* headwayTime), + myTmp1(tmp1), myTmp2(tmp2), myTmp3(tmp3), myTmp4(tmp4), myTmp5(tmp5) { + // the variable tmp1 is the acceleration delay time, e.g. two seconds (or something like this). + // for use in the upate process, a rule like if (v 5.0) { + myS2Sspeed = 5.0; + } +// SUMOReal maxDeltaGap = -0.5*ACCEL2DIST(myDecel + myAccel); + maxDeltaGap = -0.5 * (myDecel + myAccel) * TS * TS; + std::cout << "# maxDeltaGap = " << maxDeltaGap << std::endl; + myTmp2 = TS / myTmp2; + myTmp3 = sqrt(TS) * myTmp3; +} + +MSCFModel_SmartSK::~MSCFModel_SmartSK() {} + +#include + +SUMOReal +MSCFModel_SmartSK::moveHelper(MSVehicle* const veh, SUMOReal vPos) const { + const SUMOReal oldV = veh->getSpeed(); // save old v for optional acceleration computation + const SUMOReal vSafe = MIN2(vPos, veh->processNextStop(vPos)); // process stops + // we need the acceleration for emission computation; + // in this case, we neglect dawdling, nonetheless, using + // vSafe does not incorporate speed reduction due to interaction + // on lane changing + const SUMOReal vMin = getSpeedAfterMaxDecel(oldV); + const SUMOReal vMax = MIN3(veh->getLane()->getVehicleMaxSpeed(veh), maxNextSpeed(oldV), vSafe); +#ifdef _DEBUG + if (vMin > vMax) { + WRITE_WARNING("Vehicle's '" + veh->getID() + "' maximum speed is lower than the minimum speed (min: " + toString(vMin) + ", max: " + toString(vMax) + ")."); + } +#endif + updateMyHeadway(veh); + SSKVehicleVariables* vars = (SSKVehicleVariables*)veh->getCarFollowVariables(); +#ifdef _DEBUG + if (vars->ggOld.size() > 1) { + std::cout << "# more than one entry in ggOld list. Speed is " << vPos << ", corresponding dist is " << vars->ggOld[(int) vPos] << "\n"; + for (std::map::iterator I = vars->ggOld.begin(); I != vars->ggOld.end(); I++) { + std::cout << "# " << (*I).first << ' ' << (*I).second << std::endl; + } + } +#endif + + vars->gOld = vars->ggOld[(int) vPos]; + vars->ggOld.clear(); + return veh->getLaneChangeModel().patchSpeed(vMin, MAX2(vMin, dawdle(vMax)), vMax, *this); +} + +SUMOReal +MSCFModel_SmartSK::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { + SSKVehicleVariables* vars = (SSKVehicleVariables*)veh->getCarFollowVariables(); + +// if (((gap - vars->gOld) < maxDeltaGap) && (speed>=5.0) && gap>=5.0) { + if ((gap - vars->gOld) < maxDeltaGap) { + SUMOReal tTauTest = gap / speed; +// allow headway only to decrease only, never to increase. Increase is handled automatically by the headway dynamics in moveHelper()!!! + if ((tTauTest < vars->myHeadway) && (tTauTest > TS)) { + vars->myHeadway = tTauTest; + } + } + + SUMOReal vsafe = _vsafe(veh, gap, predSpeed); + if ((speed <= 0.0) && (vsafe < myS2Sspeed)) { + vsafe = 0; + } + + SUMOReal vNew = MAX2(getSpeedAfterMaxDecel(speed), MIN2(vsafe, maxNextSpeed(speed))); + // there must be a better place to do the following assignment!!! + vars->gOld = gap; + vars->ggOld[(int)vNew] = gap; + return vNew; +} + +SUMOReal +MSCFModel_SmartSK::stopSpeed(const MSVehicle* const veh, SUMOReal gap) const { + SSKVehicleVariables* vars = (SSKVehicleVariables*)veh->getCarFollowVariables(); + SUMOReal speed = veh->getSpeed(); + +// if (((gap - vars->gOld) < maxDeltaGap) && (speed>=5.0) && gap>=5.0) { + if ((gap - vars->gOld) < maxDeltaGap) { + SUMOReal tTauTest = gap / speed; +// allow headway only to decrease only, never to increase. Increase is handled automatically by the headway dynamics in moveHelper()!!! + if ((tTauTest < vars->myHeadway) && (tTauTest > TS)) { + vars->myHeadway = tTauTest; + } + } + + return MAX2(getSpeedAfterMaxDecel(veh->getSpeed()), MIN2(_vsafe(veh, gap, 0), maxNextSpeed(veh->getSpeed()))); +} + + +SUMOReal +MSCFModel_SmartSK::dawdle(SUMOReal speed) const { + return MAX2(SUMOReal(0), speed - ACCEL2SPEED(myDawdle * myAccel * RandHelper::rand())); +} + + +/** Returns the SK-vsafe. */ +SUMOReal MSCFModel_SmartSK::_vsafe(const MSVehicle* const veh, SUMOReal gap, SUMOReal predSpeed) const { + if (predSpeed == 0 && gap < 0.01) { + return 0; + } + SSKVehicleVariables* vars = (SSKVehicleVariables*)veh->getCarFollowVariables(); + // this is the most obvious change to the normal SK: the model uses the variable vars->myHeadway instead of the constant + // myHeadwayTime as the "reaction time" tau + SUMOReal bTau = myDecel * (vars->myHeadway); + SUMOReal vsafe = (SUMOReal)(-1. * bTau + + sqrt( + bTau * bTau + + (predSpeed * predSpeed) + + (2. * myDecel * gap) + )); + assert(vsafe >= 0); + return vsafe; +} + + +MSCFModel* +MSCFModel_SmartSK::duplicate(const MSVehicleType* vtype) const { + return new MSCFModel_SmartSK(vtype, myAccel, myDecel, myDawdle, myHeadwayTime, + myTmp1, myTmp2, myTmp3, myTmp4, myTmp5); +} diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.h sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.h --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,205 @@ +/****************************************************************************/ +/// @file MSCFModel_SmartSK.h +/// @author Daniel Krajzewicz +/// @date Tue, 05 Jun 2012 +/// @version $Id: MSCFModel_SmartSK.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// A smarter SK +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSCFModel_SmartSK_h +#define MSCFModel_SmartSK_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class MSCFModel_SmartSK + * @brief The original Krauss (1998) car-following model and parameter + * @see MSCFModel + */ +class MSCFModel_SmartSK : public MSCFModel { +public: + /** @brief Constructor + * @param[in] accel The maximum acceleration + * @param[in] decel The maximum deceleration + * @param[in] dawdle The driver imperfection + * @param[in] tau The driver's reaction time + */ + MSCFModel_SmartSK(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime, + SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5); + + + /// @brief Destructor + ~MSCFModel_SmartSK(); + + + /// @name Implementations of the MSCFModel interface + /// @{ + + /** @brief Applies interaction with stops and lane changing model influences + * @param[in] veh The ego vehicle + * @param[in] vPos The possible velocity + * @return The velocity after applying interactions with stops and lane change model influences + */ + SUMOReal moveHelper(MSVehicle* const veh, SUMOReal vPos) const; + + + /** @brief Computes the vehicle's safe speed (no dawdling) + * @param[in] veh The vehicle (EGO) + * @param[in] speed The vehicle's speed + * @param[in] gap2pred The (netto) distance to the LEADER + * @param[in] predSpeed The speed of LEADER + * @return EGO's safe speed + * @see MSCFModel::ffeV + */ + virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const; + + + /** @brief Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) + * @param[in] veh The vehicle (EGO) + * @param[in] gap2pred The (netto) distance to the the obstacle + * @return EGO's safe speed for approaching a non-moving obstacle + * @see MSCFModel::ffeS + * @todo generic Interface, models can call for the values they need + */ + virtual SUMOReal stopSpeed(const MSVehicle* const veh, SUMOReal gap2pred) const; + + + /** @brief Returns the model's name + * @return The model's name + * @see MSCFModel::getModelName + */ + virtual int getModelID() const { + return SUMO_TAG_CF_SMART_SK; + } + + + /** @brief Get the driver's imperfection + * @return The imperfection of drivers of this class + */ + SUMOReal getImperfection() const { + return myDawdle; + } + /// @} + + + + /// @name Setter methods + /// @{ + /** @brief Sets a new value for maximum deceleration [m/s^2] + * @param[in] accel The new deceleration in m/s^2 + */ + void setMaxDecel(SUMOReal decel) { + myDecel = decel; + myTauDecel = myDecel * myHeadwayTime; + } + + + /** @brief Sets a new value for driver imperfection + * @param[in] accel The new driver imperfection + */ + void setImperfection(SUMOReal imperfection) { + myDawdle = imperfection; + } + + + /** @brief Sets a new value for driver reaction time [s] + * @param[in] headwayTime The new driver reaction time (in s) + */ + void setHeadwayTime(SUMOReal headwayTime) { + myHeadwayTime = headwayTime; + myTauDecel = myDecel * headwayTime; + } + /// @} + + + /** @brief Duplicates the car-following model + * @param[in] vtype The vehicle type this model belongs to (1:1) + * @return A duplicate of this car-following model + */ + virtual MSCFModel* duplicate(const MSVehicleType* vtype) const; + +private: + /** @brief Returns the "safe" velocity + * @param[in] gap2pred The (netto) distance to the LEADER + * @param[in] predSpeed The LEADER's speed + * @return the safe velocity + */ + virtual SUMOReal _vsafe(const MSVehicle* const veh, SUMOReal gap, SUMOReal predSpeed) const; + + + /** @brief Applies driver imperfection (dawdling / sigma) + * @param[in] speed The speed with no dawdling + * @return The speed after dawdling + */ + virtual SUMOReal dawdle(SUMOReal speed) const; + + virtual void updateMyHeadway(const MSVehicle* const veh) const { + // this is the point were the preferred headway changes slowly: + SSKVehicleVariables* vars = (SSKVehicleVariables*)veh->getCarFollowVariables(); + SUMOReal tTau = vars->myHeadway; + tTau = tTau + (myHeadwayTime - tTau) * myTmp2 + myTmp3 * tTau * RandHelper::rand(SUMOReal(-1.0), SUMOReal(1.0)); + if (tTau < TS) { // this ensures the SK safety condition + tTau = TS; + } + vars->myHeadway = tTau; + } + + virtual MSCFModel::VehicleVariables* createVehicleVariables() const { + SSKVehicleVariables* ret = new SSKVehicleVariables(); + ret->gOld = 0.0; + ret->myHeadway = myHeadwayTime; + return ret; + } + +#include + +private: + class SSKVehicleVariables : public MSCFModel::VehicleVariables { + public: + SUMOReal gOld, myHeadway; + std::map ggOld; + }; + +protected: + /// @brief The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max. + SUMOReal myDawdle; + + /// @brief The precomputed value for myDecel*myTau + SUMOReal myTauDecel; + + /// @brief temporary (testing) parameter + SUMOReal myTmp1, myTmp2, myTmp3, myTmp4, myTmp5; + + /** @brief new variables needed in this model; myS2Sspeed is the speed below which the vehicle does not move when stopped + * @brief maxDeltaGap is the theoretical maximum change in gap that can happen in one time step + */ + SUMOReal myS2Sspeed, maxDeltaGap; + +}; + +#endif /* MSCFModel_SmartSK_H */ + diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2012-09-25 22:01:37.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2011 -/// @version $Id: MSCFModel_Wiedemann.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_Wiedemann.cpp 12428 2012-06-26 11:24:19Z behrisch $ /// // The psycho-physical model of Wiedemann // references: @@ -76,7 +76,7 @@ SUMOReal -MSCFModel_Wiedemann::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { +MSCFModel_Wiedemann::followSpeed(const MSVehicle* const veh, SUMOReal /* speed */, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { return _v(veh, predSpeed, gap2pred); } @@ -172,7 +172,7 @@ SUMOReal -MSCFModel_Wiedemann::emergency(SUMOReal dv, SUMOReal dx) const { +MSCFModel_Wiedemann::emergency(SUMOReal /* dv */, SUMOReal /* dx */) const { /* emergency according to A.Stebens // wiedemann assumes that dx will always be larger than myAX (sumo may // violate this assumption when crashing (-: diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.h sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.h --- sumo-0.15.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2012-09-25 22:01:37.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2011 -/// @version $Id: MSCFModel_Wiedemann.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSCFModel_Wiedemann.h 12428 2012-06-26 11:24:19Z behrisch $ /// // The psycho-physical model of Wiedemann /****************************************************************************/ @@ -181,6 +181,10 @@ /// @brief vsafe from krauss since Wiedemann is deficient at approaching // standing obstacles (see MSCFModel_Krauss::_vsafe) SUMOReal krauss_vsafe(SUMOReal gap, SUMOReal predSpeed) const; + +private: + /// @brief Invalidated assignment operator + MSCFModel_Wiedemann& operator=(const MSCFModel_Wiedemann& s); }; #endif /* MSCFModel_Wiedemann_H */ diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/Makefile.am sumo-0.16.0~dfsg/src/microsim/cfmodels/Makefile.am --- sumo-0.15.0~dfsg/src/microsim/cfmodels/Makefile.am 2011-06-16 23:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/Makefile.am 2012-09-25 22:01:37.000000000 +0000 @@ -1,8 +1,11 @@ noinst_LIBRARIES = libmicrosimcfmodels.a -libmicrosimcfmodels_a_SOURCES = MSCFModel_IDM.cpp MSCFModel_IDM.h \ +libmicrosimcfmodels_a_SOURCES = \ +MSCFModel_Daniel1.cpp MSCFModel_Daniel1.h \ +MSCFModel_IDM.cpp MSCFModel_IDM.h \ MSCFModel_Kerner.cpp MSCFModel_Kerner.h \ MSCFModel_Krauss.cpp MSCFModel_Krauss.h \ MSCFModel_KraussOrig1.cpp MSCFModel_KraussOrig1.h \ MSCFModel_PWag2009.cpp MSCFModel_PWag2009.h \ +MSCFModel_SmartSK.cpp MSCFModel_SmartSK.h \ MSCFModel_Wiedemann.cpp MSCFModel_Wiedemann.h diff -Nru sumo-0.15.0~dfsg/src/microsim/cfmodels/Makefile.in sumo-0.16.0~dfsg/src/microsim/cfmodels/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/cfmodels/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/cfmodels/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -49,9 +49,10 @@ ARFLAGS = cru libmicrosimcfmodels_a_AR = $(AR) $(ARFLAGS) libmicrosimcfmodels_a_LIBADD = -am_libmicrosimcfmodels_a_OBJECTS = MSCFModel_IDM.$(OBJEXT) \ - MSCFModel_Kerner.$(OBJEXT) MSCFModel_Krauss.$(OBJEXT) \ - MSCFModel_KraussOrig1.$(OBJEXT) MSCFModel_PWag2009.$(OBJEXT) \ +am_libmicrosimcfmodels_a_OBJECTS = MSCFModel_Daniel1.$(OBJEXT) \ + MSCFModel_IDM.$(OBJEXT) MSCFModel_Kerner.$(OBJEXT) \ + MSCFModel_Krauss.$(OBJEXT) MSCFModel_KraussOrig1.$(OBJEXT) \ + MSCFModel_PWag2009.$(OBJEXT) MSCFModel_SmartSK.$(OBJEXT) \ MSCFModel_Wiedemann.$(OBJEXT) libmicrosimcfmodels_a_OBJECTS = $(am_libmicrosimcfmodels_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src @@ -103,6 +104,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -133,6 +135,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -167,6 +170,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -200,7 +204,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -221,11 +224,14 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libmicrosimcfmodels.a -libmicrosimcfmodels_a_SOURCES = MSCFModel_IDM.cpp MSCFModel_IDM.h \ +libmicrosimcfmodels_a_SOURCES = \ +MSCFModel_Daniel1.cpp MSCFModel_Daniel1.h \ +MSCFModel_IDM.cpp MSCFModel_IDM.h \ MSCFModel_Kerner.cpp MSCFModel_Kerner.h \ MSCFModel_Krauss.cpp MSCFModel_Krauss.h \ MSCFModel_KraussOrig1.cpp MSCFModel_KraussOrig1.h \ MSCFModel_PWag2009.cpp MSCFModel_PWag2009.h \ +MSCFModel_SmartSK.cpp MSCFModel_SmartSK.h \ MSCFModel_Wiedemann.cpp MSCFModel_Wiedemann.h all: all-am @@ -276,11 +282,13 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_Daniel1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_IDM.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_Kerner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_Krauss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_KraussOrig1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_PWag2009.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_SmartSK.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_Wiedemann.Po@am__quote@ .cpp.o: diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_HBEFA.cpp sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_HBEFA.cpp --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_HBEFA.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_HBEFA.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_HBEFA.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDevice_HBEFA.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which collects vehicular emissions (using HBEFA-reformulation) /****************************************************************************/ @@ -66,7 +66,7 @@ void -MSDevice_HBEFA::buildVehicleDevices(SUMOVehicle& v, std::vector &into) { +MSDevice_HBEFA::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { OptionsCont& oc = OptionsCont::getOptions(); if (oc.getFloat("device.hbefa.probability") == 0 && !oc.isSet("device.hbefa.explicit")) { // no route computation is modelled @@ -104,7 +104,7 @@ bool MSDevice_HBEFA::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /*newPos*/, SUMOReal newSpeed) { const SUMOEmissionClass c = veh.getVehicleType().getEmissionClass(); - const SUMOReal a = veh.getPreDawdleAcceleration(); + const SUMOReal a = veh.getAcceleration(); myCO2 += TS * HelpersHBEFA::computeCO2(c, newSpeed, a); myCO += TS * HelpersHBEFA::computeCO(c, newSpeed, a); myHC += TS * HelpersHBEFA::computeHC(c, newSpeed, a); diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_HBEFA.h sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_HBEFA.h --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_HBEFA.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_HBEFA.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_HBEFA.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDevice_HBEFA.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which collects vehicular emissions (using HBEFA-reformulation) /****************************************************************************/ @@ -64,7 +64,7 @@ public: /** @brief Inserts MSDevice_HBEFA-options */ - static void insertOptions() ; + static void insertOptions(); /** @brief Build devices for the given vehicle, if needed @@ -79,7 +79,7 @@ * @param[in] v The vehicle for which a device may be built * @param[in, filled] into The vector to store the built device in */ - static void buildVehicleDevices(SUMOVehicle& v, std::vector &into) ; + static void buildVehicleDevices(SUMOVehicle& v, std::vector& into); public: @@ -100,7 +100,7 @@ * @see MSMoveReminder::notifyMove * @see HelpersHBEFA */ - bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ; + bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed); /// @} @@ -114,7 +114,7 @@ /// @brief Destructor. - ~MSDevice_HBEFA() ; + ~MSDevice_HBEFA(); private: @@ -123,7 +123,7 @@ * @param[in] holder The vehicle that holds this device * @param[in] id The ID of the device */ - MSDevice_HBEFA(SUMOVehicle& holder, const std::string& id) ; + MSDevice_HBEFA(SUMOVehicle& holder, const std::string& id); private: diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Person.cpp sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Person.cpp --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Person.cpp 2012-03-02 00:03:29.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Person.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Person.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSDevice_Person.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which is used to keep track of Persons riding with a vehicle /****************************************************************************/ @@ -30,12 +30,13 @@ #include #endif -#include "MSDevice_Person.h" +#include #include #include #include #include -#include +#include +#include "MSDevice_Person.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -49,7 +50,7 @@ // static initialisation methods // --------------------------------------------------------------------------- MSDevice_Person* -MSDevice_Person::buildVehicleDevices(SUMOVehicle& v, std::vector &into) { +MSDevice_Person::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { MSDevice_Person* device = new MSDevice_Person(v, "person_" + v.getID()); into.push_back(device); return device; @@ -80,8 +81,11 @@ } else { if (veh.isStopped()) { for (std::vector::iterator i = myPersons.begin(); i != myPersons.end();) { - if (&(*i)->getDestination() == veh.getEdge()) { - (*i)->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep()); + MSPerson* person = *i; + if (&(person->getDestination()) == veh.getEdge()) { + if (!person->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) { + MSNet::getInstance()->getPersonControl().erase(person); + } i = myPersons.erase(i); } else { ++i; @@ -110,12 +114,15 @@ MSMoveReminder::Notification reason) { if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) { for (std::vector::iterator i = myPersons.begin(); i != myPersons.end(); ++i) { - if (&(*i)->getDestination() != veh.getEdge()) { - WRITE_WARNING("Teleporting person '" + (*i)->getID() + + MSPerson* person = *i; + if (&(person->getDestination()) != veh.getEdge()) { + WRITE_WARNING("Teleporting person '" + person->getID() + "' from vehicle destination '" + veh.getEdge()->getID() + - "' to intended destination '" + (*i)->getDestination().getID() + "'"); + "' to intended destination '" + person->getDestination().getID() + "'"); } - (*i)->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep()); + if (!person->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) { + MSNet::getInstance()->getPersonControl().erase(person); + }; } } return true; diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Person.h sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Person.h --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Person.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Person.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Person.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDevice_Person.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which is used to keep track of Persons riding with a vehicle /****************************************************************************/ @@ -63,7 +63,7 @@ * @param[in] v The vehicle for which a device may be built * @param[in, filled] into The vector to store the built device in */ - static MSDevice_Person* buildVehicleDevices(SUMOVehicle& v, std::vector &into) ; + static MSDevice_Person* buildVehicleDevices(SUMOVehicle& v, std::vector& into); public: @@ -80,7 +80,7 @@ * @see MSMoveReminder::notifyMove * @see HelpersHBEFA */ - bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ; + bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed); /** @brief Adds passengers on vehicle insertion @@ -91,7 +91,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /** @brief Passengers leaving on arrival @@ -104,7 +104,7 @@ * @return True if it did not leave the net. */ bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, - MSMoveReminder::Notification reason) ; + MSMoveReminder::Notification reason); /// @} @@ -112,11 +112,23 @@ * * @param[in] person The passenger to add. */ - void addPerson(MSPerson* person) ; + void addPerson(MSPerson* person); + + + /** @brief Return the number of passengers + * @return The number of stored persons + */ + unsigned int size() const { + return static_cast(myPersons.size()); + } + + const std::vector& getPersons() const { + return myPersons; + } /// @brief Destructor. - ~MSDevice_Person() ; + ~MSDevice_Person(); private: /** @brief Constructor @@ -124,14 +136,14 @@ * @param[in] holder The vehicle that holds this device * @param[in] id The ID of the device */ - MSDevice_Person(SUMOVehicle& holder, const std::string& id) ; + MSDevice_Person(SUMOVehicle& holder, const std::string& id); private: /// @brief The passengers of the vehicle std::vector myPersons; - /// @brief whether the vehicle is at a stop + /// @brief Whether the vehicle is at a stop bool myStopped; diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Routing.cpp sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Routing.cpp --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Routing.cpp 2012-03-02 00:03:29.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Routing.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Laura Bieker /// @author Christoph Sommer /// @date Tue, 04 Dec 2007 -/// @version $Id: MSDevice_Routing.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSDevice_Routing.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -54,6 +55,8 @@ SUMOTime MSDevice_Routing::myAdaptationInterval; bool MSDevice_Routing::myWithTaz; std::map, const MSRoute*> MSDevice_Routing::myCachedRoutes; +SUMOAbstractRouter* MSDevice_Routing::myRouter = 0; +std::set MSDevice_Routing::myExplicitIDs; // =========================================================================== @@ -99,13 +102,16 @@ oc.addSynonyme("device.rerouting.with-taz", "device.routing.with-taz", true); oc.addDescription("device.rerouting.with-taz", "Routing", "Use zones (districts) as routing end points"); + oc.doRegister("device.rerouting.init-with-loaded-weights", new Option_Bool(false)); + oc.addDescription("device.rerouting.init-with-loaded-weights", "Routing", "Use given weight files for initializing edge weights"); + myEdgeWeightSettingCommand = 0; myEdgeEfforts.clear(); } void -MSDevice_Routing::buildVehicleDevices(SUMOVehicle& v, std::vector &into) { +MSDevice_Routing::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { OptionsCont& oc = OptionsCont::getOptions(); bool needRerouting = v.getParameter().wasSet(VEHPARS_FORCE_REROUTE); if (!needRerouting && oc.getFloat("device.rerouting.probability") == 0 && !oc.isSet("device.rerouting.explicit")) { @@ -119,7 +125,12 @@ } else { haveByNumber = RandHelper::rand() <= oc.getFloat("device.rerouting.probability"); } - bool haveByName = oc.isSet("device.rerouting.explicit") && OptionsCont::getOptions().isInStringVector("device.rerouting.explicit", v.getID()); + // initialize myExplicitIDs if not done before + if (oc.isSet("device.rerouting.explicit") && myExplicitIDs.size() == 0) { + const std::vector idList = OptionsCont::getOptions().getStringVector("device.rerouting.explicit"); + myExplicitIDs.insert(idList.begin(), idList.end()); + } + const bool haveByName = myExplicitIDs.count(v.getID()) > 0; myWithTaz = oc.getBool("device.rerouting.with-taz"); if (needRerouting || haveByNumber || haveByName) { // build the device @@ -129,9 +140,15 @@ into.push_back(device); // initialise edge efforts if not done before if (myEdgeEfforts.size() == 0) { - const std::vector &edges = MSNet::getInstance()->getEdgeControl().getEdges(); + const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + const bool useLoaded = oc.getBool("device.rerouting.init-with-loaded-weights"); + const SUMOReal currentSecond = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { - myEdgeEfforts[*i] = (*i)->getCurrentTravelTime(); + if (useLoaded) { + myEdgeEfforts[*i] = MSNet::getTravelTime(*i, 0, currentSecond); + } else { + myEdgeEfforts[*i] = (*i)->getCurrentTravelTime(); + } } } // make the weights be updated @@ -210,9 +227,7 @@ if (source && dest) { const std::pair key = std::make_pair(source, dest); if (myCachedRoutes.find(key) == myCachedRoutes.end()) { - DijkstraRouterTT_ByProxi, MSDevice_Routing> - router(MSEdge::dictSize(), true, this, &MSDevice_Routing::getEffort); - myHolder.reroute(currentTime, router, true); + myHolder.reroute(currentTime, getRouter(), true); myCachedRoutes[key] = &myHolder.getRoute(); myHolder.getRoute().addReference(); } else { @@ -225,17 +240,15 @@ SUMOTime MSDevice_Routing::wrappedRerouteCommandExecute(SUMOTime currentTime) { - DijkstraRouterTT_ByProxi, MSDevice_Routing> - router(MSEdge::dictSize(), true, this, &MSDevice_Routing::getEffort); - myHolder.reroute(currentTime, router); + myHolder.reroute(currentTime, getRouter()); return myPeriod; } SUMOReal -MSDevice_Routing::getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal) const { +MSDevice_Routing::getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal) { if (myEdgeEfforts.find(e) != myEdgeEfforts.end()) { - return MAX2(myEdgeEfforts.find(e)->second, e->getLength() / v->getMaxSpeed()); + return MAX2(myEdgeEfforts.find(e)->second, e->getMinimumTravelTime(v)); } return 0; } @@ -249,7 +262,7 @@ } myCachedRoutes.clear(); SUMOReal newWeight = (SUMOReal)(1. - myAdaptationWeight); - const std::vector &edges = MSNet::getInstance()->getEdgeControl().getEdges(); + const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { myEdgeEfforts[*i] = myEdgeEfforts[*i] * myAdaptationWeight + (*i)->getCurrentTravelTime() * newWeight; } @@ -257,6 +270,28 @@ } +SUMOAbstractRouter& +MSDevice_Routing::getRouter() { + if (myRouter == 0) { + const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm"); + if (routingAlgorithm == "dijkstra") { + myRouter = new DijkstraRouterTT_ByProxi >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort); + } else if (routingAlgorithm == "astar") { + myRouter = new AStarRouterTT_ByProxi >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort); + } else { + throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!"); + } + } + return *myRouter; +} + +void +MSDevice_Routing::cleanup() { + delete myRouter; + myRouter = 0; +} /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Routing.h sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Routing.h --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Routing.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Routing.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Michael Behrisch /// @author Daniel Krajzewicz /// @date Tue, 04 Dec 2007 -/// @version $Id: MSDevice_Routing.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDevice_Routing.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ @@ -34,10 +34,11 @@ #include #include #include -#include "MSDevice.h" #include -#include #include +#include +#include +#include "MSDevice.h" // =========================================================================== @@ -45,7 +46,6 @@ // =========================================================================== class MSLane; - // =========================================================================== // class definitions // =========================================================================== @@ -71,7 +71,7 @@ public: /** @brief Inserts MSDevice_Routing-options */ - static void insertOptions() ; + static void insertOptions(); /** @brief Build devices for the given vehicle, if needed @@ -91,8 +91,10 @@ * @param[in] v The vehicle for which a device may be built * @param[in, filled] into The vector to store the built device in */ - static void buildVehicleDevices(SUMOVehicle& v, std::vector &into) ; + static void buildVehicleDevices(SUMOVehicle& v, std::vector& into); + /// @brief deletes the router instance + static void cleanup(); public: /// @name Methods called on vehicle movement / state change, overwriting MSDevice @@ -116,12 +118,12 @@ * @see MSEventHandler * @see WrappingCommand */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /// @} /// @brief Destructor. - ~MSDevice_Routing() ; + ~MSDevice_Routing(); private: @@ -133,7 +135,7 @@ * @param[in] preInsertionPeriod The route search period before insertion */ MSDevice_Routing(SUMOVehicle& holder, const std::string& id, SUMOTime period, - SUMOTime preInsertionPeriod) ; + SUMOTime preInsertionPeriod); /** @brief Performs rerouting at insertion into the network @@ -147,7 +149,7 @@ * @see MSEventHandler * @see WrappingCommand */ - SUMOTime preInsertionReroute(SUMOTime currentTime) ; + SUMOTime preInsertionReroute(SUMOTime currentTime); /** @brief Performs rerouting after a period @@ -164,7 +166,7 @@ * @see MSEventHandler * @see WrappingCommand */ - SUMOTime wrappedRerouteCommandExecute(SUMOTime currentTime) ; + SUMOTime wrappedRerouteCommandExecute(SUMOTime currentTime); /** @brief Returns the effort to pass an edge @@ -181,7 +183,7 @@ * @return The effort (time to pass in this case) for an edge * @see DijkstraRouterTT_ByProxi */ - SUMOReal getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t) const; + static SUMOReal getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal t); /// @name Network state adaptation @@ -198,10 +200,13 @@ * @see MSEventHandler * @see StaticCommand */ - static SUMOTime adaptEdgeEfforts(SUMOTime currentTime) ; + static SUMOTime adaptEdgeEfforts(SUMOTime currentTime); /// @} + /// @brief get the router, initialize on first use + static SUMOAbstractRouter& getRouter(); + private: /// @brief The period with which a vehicle shall be rerouted SUMOTime myPeriod; @@ -230,6 +235,12 @@ /// @brief The container of pre-calculated routes static std::map, const MSRoute*> myCachedRoutes; + /// @brief The router to use + static SUMOAbstractRouter* myRouter; + + /// @brief the vehicles which explicitly carry a device + static std::set myExplicitIDs; + private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.cpp sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.cpp --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.cpp 2012-02-16 15:57:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Tripinfo.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSDevice_Tripinfo.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ @@ -48,7 +48,7 @@ // static initialisation methods // --------------------------------------------------------------------------- void -MSDevice_Tripinfo::buildVehicleDevices(SUMOVehicle& v, std::vector &into) { +MSDevice_Tripinfo::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { if (OptionsCont::getOptions().isSet("tripinfo-output")) { MSDevice_Tripinfo* device = new MSDevice_Tripinfo(v, "tripinfo_" + v.getID()); into.push_back(device); @@ -130,7 +130,7 @@ << "routeLength=\"" << routeLength << "\" " << "waitSteps=\"" << myWaitingSteps << "\" " << "rerouteNo=\"" << myHolder.getNumberReroutes(); - const std::vector &devices = myHolder.getDevices(); + const std::vector& devices = myHolder.getDevices(); std::ostringstream str; for (std::vector::const_iterator i = devices.begin(); i != devices.end(); ++i) { if (i != devices.begin()) { diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.h sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.h --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.h 2012-02-16 15:57:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Tripinfo.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Tripinfo.h 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSDevice_Tripinfo.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ @@ -62,7 +62,7 @@ * @param[in] v The vehicle for which a device may be built * @param[in, filled] into The vector to store the built device in */ - static void buildVehicleDevices(SUMOVehicle& v, std::vector &into) ; + static void buildVehicleDevices(SUMOVehicle& v, std::vector& into); public: @@ -79,7 +79,7 @@ * @return True (always). */ bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, - SUMOReal newPos, SUMOReal newSpeed) ; + SUMOReal newPos, SUMOReal newSpeed); /** @brief Saves departure info on insertion @@ -90,7 +90,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /** @brief Saves arrival info @@ -102,7 +102,7 @@ * @return True if it did not leave the net. */ bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, - MSMoveReminder::Notification reason) ; + MSMoveReminder::Notification reason); /// @} @@ -116,7 +116,7 @@ /// @brief Destructor. - ~MSDevice_Tripinfo() ; + ~MSDevice_Tripinfo(); private: @@ -125,7 +125,7 @@ * @param[in] holder The vehicle that holds this device * @param[in] id The ID of the device */ - MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) ; + MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id); private: diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.cpp sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.cpp --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.cpp 2012-03-02 00:03:27.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Vehroutes.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: MSDevice_Vehroutes.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ @@ -76,7 +76,7 @@ MSDevice_Vehroutes* -MSDevice_Vehroutes::buildVehicleDevices(SUMOVehicle& v, std::vector &into, unsigned int maxRoutes) { +MSDevice_Vehroutes::buildVehicleDevices(SUMOVehicle& v, std::vector& into, unsigned int maxRoutes) { if (maxRoutes < INT_MAX) { return new MSDevice_Vehroutes(v, "vehroute_" + v.getID(), maxRoutes); } @@ -171,6 +171,7 @@ } else { os << " edges=\""; const MSEdge* lastEdge = 0; + int numWritten = 0; if (myHolder.getNumberReroutes() > 0) { assert(myReplacedRoutes.size() <= myHolder.getNumberReroutes()); unsigned int i = static_cast(myReplacedRoutes.size()); @@ -178,11 +179,20 @@ i--; } for (; i < myReplacedRoutes.size(); ++i) { - myReplacedRoutes[i].route->writeEdgeIDs(os, lastEdge, myReplacedRoutes[i].edge); + numWritten += myReplacedRoutes[i].route->writeEdgeIDs(os, lastEdge, myReplacedRoutes[i].edge); lastEdge = myReplacedRoutes[i].edge; } } - myCurrentRoute->writeEdgeIDs(os, lastEdge); + const MSEdge* upTo = 0; + if (mySaveExits) { + int remainingWithExitTime = (int)myExits.size() - numWritten; + assert(remainingWithExitTime >= 0); + assert(remainingWithExitTime <= (int)myCurrentRoute->size()); + if (remainingWithExitTime < (int)myCurrentRoute->size()) { + upTo = *(myCurrentRoute->begin() + remainingWithExitTime); + } + } + myCurrentRoute->writeEdgeIDs(os, lastEdge, upTo); if (mySaveExits) { os << "\" exitTimes=\""; for (std::vector::const_iterator it = myExits.begin(); it != myExits.end(); ++it) { @@ -206,7 +216,8 @@ od.writeAttr(SUMO_ATTR_TYPE, myHolder.getVehicleType().getID()); } od.writeAttr(SUMO_ATTR_DEPART, time2string(myHolder.getDeparture())); - od.writeAttr("arrival", time2string(MSNet::getInstance()->getCurrentTimeStep())); + od.writeAttr("arrival", (myHolder.hasArrived() ? + time2string(MSNet::getInstance()->getCurrentTimeStep()) : "")); if (myWithTaz) { od.writeAttr(SUMO_ATTR_FROM_TAZ, myHolder.getParameter().fromTaz).writeAttr(SUMO_ATTR_TO_TAZ, myHolder.getParameter().toTaz); } @@ -248,7 +259,7 @@ void MSDevice_Vehroutes::addRoute() { if (myMaxRoutes > 0) { - if (myHolder.getDeparture() >= 0) { + if (myHolder.hasDeparted()) { myReplacedRoutes.push_back(RouteReplaceInfo(myHolder.getEdge(), MSNet::getInstance()->getCurrentTimeStep(), myCurrentRoute)); } else { myReplacedRoutes.push_back(RouteReplaceInfo(0, MSNet::getInstance()->getCurrentTimeStep(), myCurrentRoute)); @@ -265,5 +276,15 @@ } +void +MSDevice_Vehroutes::generateOutputForUnfinished() { + for (std::map::iterator it = myStateListener.myDevices.begin(); + it != myStateListener.myDevices.end(); ++it) { + if (it->first->hasDeparted()) { + it->second->generateOutput(); + } + } +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.h sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.h --- sumo-0.15.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/MSDevice_Vehroutes.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Vehroutes.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDevice_Vehroutes.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ @@ -71,8 +71,10 @@ * @param[in] v The vehicle for which a device may be built * @param[in, filled] into The vector to store the built device in */ - static MSDevice_Vehroutes* buildVehicleDevices(SUMOVehicle& v, std::vector &into, unsigned int maxRoutes = INT_MAX) ; + static MSDevice_Vehroutes* buildVehicleDevices(SUMOVehicle& v, std::vector& into, unsigned int maxRoutes = INT_MAX); + /// @brief generate vehroute output for vehicles which are still in the network + static void generateOutputForUnfinished(); public: /// @name Methods called on vehicle movement / state change, overwriting MSDevice @@ -86,7 +88,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /** @brief Saves exit times if needed @@ -100,7 +102,7 @@ * * @return True, if exit times are to be collected. */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, Notification reason); /// @} @@ -122,7 +124,7 @@ /// @brief Destructor. - ~MSDevice_Vehroutes() ; + ~MSDevice_Vehroutes(); private: @@ -131,7 +133,7 @@ * @param[in] holder The vehicle that holds this device * @param[in] id The ID of the device */ - MSDevice_Vehroutes(SUMOVehicle& holder, const std::string& id, unsigned int maxRoutes) ; + MSDevice_Vehroutes(SUMOVehicle& holder, const std::string& id, unsigned int maxRoutes); /** @brief Called on route output diff -Nru sumo-0.15.0~dfsg/src/microsim/devices/Makefile.in sumo-0.16.0~dfsg/src/microsim/devices/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/devices/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/devices/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/microsim/logging/CastingFunctionBinding.h sumo-0.16.0~dfsg/src/microsim/logging/CastingFunctionBinding.h --- sumo-0.15.0~dfsg/src/microsim/logging/CastingFunctionBinding.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/logging/CastingFunctionBinding.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Christian Roessel /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: CastingFunctionBinding.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: CastingFunctionBinding.h 13107 2012-12-02 13:57:34Z behrisch $ /// // »missingDescription« /****************************************************************************/ @@ -58,11 +58,11 @@ return (R)(mySource->*myOperation)(); } - ValueSource *copy() const { + ValueSource* copy() const { return new CastingFunctionBinding(mySource, myOperation); } - ValueSource *makeSUMORealReturningCopy() const { + ValueSource* makeSUMORealReturningCopy() const { return new CastingFunctionBinding(mySource, myOperation); } diff -Nru sumo-0.15.0~dfsg/src/microsim/logging/FuncBinding_IntParam.h sumo-0.16.0~dfsg/src/microsim/logging/FuncBinding_IntParam.h --- sumo-0.15.0~dfsg/src/microsim/logging/FuncBinding_IntParam.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/logging/FuncBinding_IntParam.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: FuncBinding_IntParam.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: FuncBinding_IntParam.h 13107 2012-12-02 13:57:34Z behrisch $ /// // �missingDescription� /****************************************************************************/ @@ -62,12 +62,12 @@ return (mySource->*myOperation)(myParam); } - ValueSource *copy() const { + ValueSource* copy() const { return new FuncBinding_IntParam( mySource, myOperation, myParam); } - ValueSource *makeSUMORealReturningCopy() const { + ValueSource* makeSUMORealReturningCopy() const { return new FuncBinding_IntParam(mySource, myOperation, myParam); } diff -Nru sumo-0.15.0~dfsg/src/microsim/logging/FuncBinding_StringParam.h sumo-0.16.0~dfsg/src/microsim/logging/FuncBinding_StringParam.h --- sumo-0.15.0~dfsg/src/microsim/logging/FuncBinding_StringParam.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/logging/FuncBinding_StringParam.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: FuncBinding_StringParam.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: FuncBinding_StringParam.h 13107 2012-12-02 13:57:34Z behrisch $ /// // »missingDescription« /****************************************************************************/ @@ -60,12 +60,12 @@ return (mySource->*myOperation)(myParam); } - ValueSource *copy() const { + ValueSource* copy() const { return new FuncBinding_StringParam( mySource, myOperation, myParam); } - ValueSource *makeSUMORealReturningCopy() const { + ValueSource* makeSUMORealReturningCopy() const { throw 1; } diff -Nru sumo-0.15.0~dfsg/src/microsim/logging/FunctionBinding.h sumo-0.16.0~dfsg/src/microsim/logging/FunctionBinding.h --- sumo-0.15.0~dfsg/src/microsim/logging/FunctionBinding.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/logging/FunctionBinding.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: FunctionBinding.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: FunctionBinding.h 13107 2012-12-02 13:57:34Z behrisch $ /// // »missingDescription« /****************************************************************************/ @@ -61,11 +61,11 @@ return (mySource->*myOperation)(); } - ValueSource *copy() const { + ValueSource* copy() const { return new FunctionBinding(mySource, myOperation); } - ValueSource *makeSUMORealReturningCopy() const { + ValueSource* makeSUMORealReturningCopy() const { return new CastingFunctionBinding(mySource, myOperation); } diff -Nru sumo-0.15.0~dfsg/src/microsim/logging/Makefile.in sumo-0.16.0~dfsg/src/microsim/logging/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/logging/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/logging/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -69,6 +69,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -99,6 +100,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -133,6 +135,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -166,7 +169,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSDetectorControl.cpp sumo-0.16.0~dfsg/src/microsim/output/MSDetectorControl.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSDetectorControl.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSDetectorControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2005-09-15 -/// @version $Id: MSDetectorControl.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDetectorControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Detectors container; responsible for string and output generation /****************************************************************************/ @@ -40,7 +40,7 @@ #include #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #endif @@ -80,7 +80,7 @@ if (myDetectors.find(type) == myDetectors.end()) { myDetectors[type] = NamedObjectCont(); } - NamedObjectCont &m = myDetectors.find(type)->second; + NamedObjectCont& m = myDetectors.find(type)->second; // insert object into dictionary if (! m.add(d->getID(), d)) { throw ProcessError(toString(type) + " detector '" + d->getID() + "' could not be build (declared twice?)."); @@ -95,7 +95,7 @@ if (myDetectors.find(type) == myDetectors.end()) { myDetectors[type] = NamedObjectCont(); } - NamedObjectCont &m = myDetectors.find(type)->second; + NamedObjectCont& m = myDetectors.find(type)->second; // insert object into dictionary if (! m.add(d->getID(), d)) { throw ProcessError(toString(type) + " detector '" + d->getID() + "' could not be build (declared twice?)."); @@ -115,7 +115,7 @@ } -const NamedObjectCont & +const NamedObjectCont& MSDetectorControl::getTypedDetectors(SumoXMLTag type) const { if (myDetectors.find(type) == myDetectors.end()) { return myEmptyContainer;//myDetectors[type] = NamedObjectCont(); @@ -127,7 +127,7 @@ void MSDetectorControl::updateDetectors(const SUMOTime step) { for (std::map >::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { - const std::map &dets = getTypedDetectors((*i).first).getMyMap(); + const std::map& dets = getTypedDetectors((*i).first).getMyMap(); for (std::map::const_iterator j = dets.begin(); j != dets.end(); ++j) { (*j).second->detectorUpdate(step); } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSDetectorControl.h sumo-0.16.0~dfsg/src/microsim/output/MSDetectorControl.h --- sumo-0.15.0~dfsg/src/microsim/output/MSDetectorControl.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSDetectorControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: MSDetectorControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSDetectorControl.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Detectors container; responsible for string and output generation /****************************************************************************/ @@ -44,7 +44,7 @@ #include #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #endif @@ -70,14 +70,14 @@ /** @brief Constructor */ - MSDetectorControl() ; + MSDetectorControl(); /** @brief Destructor * * Deletes all stored detectors. */ - ~MSDetectorControl() ; + ~MSDetectorControl(); /** @brief Closes the detector outputs @@ -106,7 +106,7 @@ * @param[in] splInterval The sample interval of the detector * @exception ProcessError If the detector is already known */ - void add(SumoXMLTag type, MSDetectorFileOutput* d, OutputDevice& device, int splInterval, SUMOTime begin = -1) ; + void add(SumoXMLTag type, MSDetectorFileOutput* d, OutputDevice& device, int splInterval, SUMOTime begin = -1); @@ -122,7 +122,7 @@ * @param[in] d The detector to add * @exception ProcessError If the detector is already known */ - void add(SumoXMLTag type, MSDetectorFileOutput* d) ; + void add(SumoXMLTag type, MSDetectorFileOutput* d); /** @brief Adds a mean data object @@ -137,7 +137,7 @@ * @param[in] begin The begin of the first interval */ void add(MSMeanData* mn, OutputDevice& device, - SUMOTime frequency, SUMOTime begin) ; + SUMOTime frequency, SUMOTime begin); @@ -150,7 +150,7 @@ */ void addDetectorAndInterval(MSDetectorFileOutput* det, OutputDevice* device, - SUMOTime interval, SUMOTime begin = -1) ; + SUMOTime interval, SUMOTime begin = -1); @@ -159,7 +159,7 @@ * @param[in] type The type of detectors to be retrieved * @return The container of detectors */ - const NamedObjectCont &getTypedDetectors(SumoXMLTag type) const ; + const NamedObjectCont& getTypedDetectors(SumoXMLTag type) const; @@ -171,7 +171,7 @@ * the values. * @param[in] step The current time step */ - void updateDetectors(const SUMOTime step) ; + void updateDetectors(const SUMOTime step); /** @brief Writes the output to be generated within the given time step diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSE2Collector.cpp sumo-0.16.0~dfsg/src/microsim/output/MSE2Collector.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSE2Collector.cpp 2012-02-16 15:57:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSE2Collector.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue Dec 02 2003 22:13 CET -/// @version $Id: MSE2Collector.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSE2Collector.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An areal (along a single lane) detector /****************************************************************************/ @@ -32,6 +32,7 @@ #include #endif +#include #include #include "MSE2Collector.h" #include @@ -152,7 +153,7 @@ void -MSE2Collector::detectorUpdate(const SUMOTime step) { +MSE2Collector::detectorUpdate(const SUMOTime /* step */) { JamInfo* currentJam = 0; std::map haltingVehicles; std::map intervalHaltingVehicles; @@ -452,7 +453,7 @@ } -int +int MSE2Collector::by_vehicle_position_sorter::operator()(const SUMOVehicle* v1, const SUMOVehicle* v2) { const MSVehicle* const occ = myLane->getPartialOccupator(); if (v1 == occ) { diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSE2Collector.h sumo-0.16.0~dfsg/src/microsim/output/MSE2Collector.h --- sumo-0.15.0~dfsg/src/microsim/output/MSE2Collector.h 2012-02-16 15:57:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSE2Collector.h 2012-09-25 22:01:36.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue Dec 02 2003 22:13 CET -/// @version $Id: MSE2Collector.h 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSE2Collector.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // An areal (along a single lane) detector /****************************************************************************/ @@ -91,11 +91,11 @@ MSE2Collector(const std::string& id, DetectorUsage usage, MSLane* const lane, SUMOReal startPos, SUMOReal detLength, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /// @brief Destructor - virtual ~MSE2Collector() ; + virtual ~MSE2Collector(); /** @brief Returns the detector's usage type @@ -128,7 +128,7 @@ * @see MSMoveReminder::notifyMove */ bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, - SUMOReal newSpeed) ; + SUMOReal newSpeed); /** @brief Removes a known vehicle due to its lane-change @@ -142,7 +142,7 @@ * @param[in] isLaneChange whether the vehicle changed from the lane * @see MSMoveReminder::notifyLeave */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason); /** @brief Adds the vehicle to known vehicles if not beyond the dector @@ -157,7 +157,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /// @} @@ -170,7 +170,7 @@ * * @param[in] currentTime The current simulation time */ - void detectorUpdate(const SUMOTime step) ; + void detectorUpdate(const SUMOTime step); @@ -222,41 +222,41 @@ * were written. Values for the next interval may be collected, then. * The list of known vehicles stays untouched. */ - void reset() ; + void reset(); /// @name Methods returning current values /// @{ /** @brief Returns the number of vehicles currently on the detector */ - unsigned getCurrentVehicleNumber() const ; + unsigned getCurrentVehicleNumber() const; /** @brief Returns the curent detector occupancy */ - SUMOReal getCurrentOccupancy() const ; + SUMOReal getCurrentOccupancy() const; /** @brief Returns the mean vehicle speed of vehicles currently on the detector*/ - SUMOReal getCurrentMeanSpeed() const ; + SUMOReal getCurrentMeanSpeed() const; /** @brief Returns the mean vehicle length of vehicles currently on the detector*/ - SUMOReal getCurrentMeanLength() const ; + SUMOReal getCurrentMeanLength() const; /** @brief Returns the current number of jams */ - unsigned getCurrentJamNumber() const ; + unsigned getCurrentJamNumber() const; /** @brief Returns the length in vehicles of the currently largest jam */ - unsigned getCurrentMaxJamLengthInVehicles() const ; + unsigned getCurrentMaxJamLengthInVehicles() const; /** @brief Returns the length in meters of the currently largest jam */ - SUMOReal getCurrentMaxJamLengthInMeters() const ; + SUMOReal getCurrentMaxJamLengthInMeters() const; /** @brief Returns the length of all jams in vehicles */ - unsigned getCurrentJamLengthInVehicles() const ; + unsigned getCurrentJamLengthInVehicles() const; /** @brief Returns the length of all jams in meters */ - SUMOReal getCurrentJamLengthInMeters() const ; + SUMOReal getCurrentJamLengthInMeters() const; /** @brief Returns the length of all jams in meters */ - unsigned getCurrentStartedHalts() const ; + unsigned getCurrentStartedHalts() const; /// @} diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSE3Collector.cpp sumo-0.16.0~dfsg/src/microsim/output/MSE3Collector.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSE3Collector.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSE3Collector.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Tue Dec 02 2003 22:17 CET -/// @version $Id: MSE3Collector.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSE3Collector.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A detector of vehicles passing an area between entry/exit points /****************************************************************************/ @@ -57,19 +57,21 @@ bool MSE3Collector::MSE3EntryReminder::notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) { - if (newPos < myPosition/* && static_cast(veh).getLane() == myLane*/) { - return true; - } - if (newPos >= myPosition && oldPos <= myPosition/* && static_cast(veh).getLane() == myLane*/) { - SUMOReal entryTime = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); - if (newSpeed != 0) { - if (myPosition > oldPos) { - entryTime += (myPosition - oldPos) / newSpeed; + if (myCollector.myEnteredContainer.find(&veh) == myCollector.myEnteredContainer.end() && newPos >= myPosition) { + if (oldPos > myPosition) { + // was behind the detector + return false; + } else { + SUMOReal entryTime = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); + if (newSpeed != 0) { + if (myPosition > oldPos) { + entryTime += (myPosition - oldPos) / newSpeed; + } } + myCollector.enter(veh, entryTime); } - myCollector.enter(veh, entryTime); } - return myCollector.myEnteredContainer.find(&veh) != myCollector.myEnteredContainer.end(); + return true; } @@ -79,7 +81,7 @@ myCollector.myEnteredContainer.erase(&veh); return false; } - return myCollector.myEnteredContainer.find(&veh) != myCollector.myEnteredContainer.end(); + return true; } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSE3Collector.h sumo-0.16.0~dfsg/src/microsim/output/MSE3Collector.h --- sumo-0.15.0~dfsg/src/microsim/output/MSE3Collector.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSE3Collector.h 2012-09-25 22:01:36.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue Dec 02 2003 22:17 CET -/// @version $Id: MSE3Collector.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSE3Collector.h 12381 2012-06-08 09:28:48Z dkrajzew $ /// // A detector of vehicles passing an area between entry/exit points /****************************************************************************/ @@ -33,7 +33,6 @@ #endif #include -#include #include #include #include @@ -75,7 +74,7 @@ * @param[in] crossSection The position at which the entry lies * @param[in] collector The detector the entry belongs to */ - MSE3EntryReminder(const MSCrossSection& crossSection, MSE3Collector& collector) ; + MSE3EntryReminder(const MSCrossSection& crossSection, MSE3Collector& collector); /// @name Methods inherited from MSMoveReminder. @@ -96,7 +95,7 @@ * @see MSMoveReminder::notifyMove * @see MSE3Collector::enter */ - bool notifyMove(SUMOVehicle& veh, SUMOReal , SUMOReal newPos, SUMOReal) ; + bool notifyMove(SUMOVehicle& veh, SUMOReal , SUMOReal newPos, SUMOReal); /** @brief Processes state changes of a vehicle @@ -109,7 +108,7 @@ * @param[in] reason The reason for the state change * @see MSMoveReminder::notifyLeave */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason); /// @} @@ -142,7 +141,7 @@ * @param[in] crossSection The position at which the exit lies * @param[in] collector The detector the exit belongs to */ - MSE3LeaveReminder(const MSCrossSection& crossSection, MSE3Collector& collector) ; + MSE3LeaveReminder(const MSCrossSection& crossSection, MSE3Collector& collector); /// @name methods from MSMoveReminder @@ -163,7 +162,7 @@ * @see MSMoveReminder::notifyMove * @see MSE3Collector::leave */ - bool notifyMove(SUMOVehicle& veh, SUMOReal , SUMOReal newPos, SUMOReal) ; + bool notifyMove(SUMOVehicle& veh, SUMOReal , SUMOReal newPos, SUMOReal); //@} @@ -197,16 +196,16 @@ MSE3Collector(const std::string& id, const CrossSectionVector& entries, const CrossSectionVector& exits, SUMOReal haltingSpeedThreshold, - SUMOTime haltingTimeThreshold) ; + SUMOTime haltingTimeThreshold); /// @brief Destructor - virtual ~MSE3Collector() ; + virtual ~MSE3Collector(); /** @brief Resets all generated values to allow computation of next interval */ - void reset() ; + void reset(); /** @brief Called if a vehicle touches an entry-cross-section. @@ -216,7 +215,7 @@ * @param[in] veh The vehicle that entered the area * @param[in] entryTimestep The time step the vehicle entered the area */ - void enter(SUMOVehicle& veh, SUMOReal entryTimestep) ; + void enter(SUMOVehicle& veh, SUMOReal entryTimestep); /** @brief Called if a vehicle passes a leave-cross-section. @@ -226,7 +225,7 @@ * @param[in] veh The vehicle that left the area * @param[in] entryTimestep The time step the vehicle left the area */ - void leave(SUMOVehicle& veh, SUMOReal leaveTimestep) ; + void leave(SUMOVehicle& veh, SUMOReal leaveTimestep); /// @name Methods returning current values @@ -238,7 +237,7 @@ * * @return The mean speed [m/s] of all vehicles within the area, -1 if there is none */ - SUMOReal getCurrentMeanSpeed() const ; + SUMOReal getCurrentMeanSpeed() const; /** @brief Returns the number of current haltings within the area @@ -247,20 +246,20 @@ * * @return The mean number of haltings within the area */ - SUMOReal getCurrentHaltingNumber() const ; + SUMOReal getCurrentHaltingNumber() const; /** @brief Returns the number of vehicles within the area * @return The number of vehicles that passed the entry collector */ - SUMOReal getVehiclesWithin() const ; + SUMOReal getVehiclesWithin() const; /** @brief Returns the number of vehicles within the area * * @return The number of vehicles that have passed the entry, but not yet an exit point */ - std::vector getCurrentVehicleIDs() const ; + std::vector getCurrentVehicleIDs() const; /// @} @@ -299,7 +298,7 @@ * * @param[in] currentTime The current simulation time (unused) */ - void detectorUpdate(const SUMOTime step) ; + void detectorUpdate(const SUMOTime step); protected: diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSEmissionExport.cpp sumo-0.16.0~dfsg/src/microsim/output/MSEmissionExport.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSEmissionExport.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSEmissionExport.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,84 @@ +/****************************************************************************/ +/// @file MSEmissionExport.cpp +/// @author Mario Krumnow +/// @version $Id: MSEmissionExport.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Realises dumping Emission Data +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include "MSEmissionExport.h" +#include +#include + +#ifdef HAVE_MESOSIM +#include +#include +#endif + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +void +MSEmissionExport::write(OutputDevice& of, SUMOTime timestep) { + + of.openTag("timestep") << " time=\"" << time2string(timestep) << "\">\n"; + + MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + MSVehicleControl::constVehIt it = vc.loadedVehBegin(); + MSVehicleControl::constVehIt end = vc.loadedVehEnd(); + + for (; it != end; ++it) { + const MSVehicle* veh = static_cast((*it).second); + + if (veh->isOnRoad()) { + + std::string fclass = veh->getVehicleType().getID(); + fclass = fclass.substr(0, fclass.find_first_of("@")); + + Position pos = veh->getLane()->getShape().positionAtLengthPosition(veh->getPositionOnLane()); + of.openTag("vehicle") << " id=\"" << veh->getID() << "\" eclass=\"" << veh->getVehicleType().getEmissionClass() << "\" co2=\"" << veh->getHBEFA_CO2Emissions() + << "\" co=\"" << veh->getHBEFA_COEmissions() << "\" hc=\"" << veh->getHBEFA_HCEmissions() + << "\" nox=\"" << veh->getHBEFA_NOxEmissions() << "\" pmx=\"" << veh->getHBEFA_PMxEmissions() + << "\" noise=\"" << veh->getHarmonoise_NoiseEmissions() << "\" route=\"" << veh->getRoute().getID() + << "\" type=\"" << fclass << "\" waiting=\"" << veh->getWaitingSeconds() + << "\" lane=\"" << veh->getLane()->getID() << "\" pos=\"" + << veh->getPositionOnLane() << "\" speed=\"" << veh->getSpeed() * 3.6 + << "\" angle=\"" << veh->getAngle() << "\" x=\"" << pos.x() << "\" y=\"" << pos.y() << "\""; + of.closeTag(true); + + } + } + + of.closeTag(); +} diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSEmissionExport.h sumo-0.16.0~dfsg/src/microsim/output/MSEmissionExport.h --- sumo-0.15.0~dfsg/src/microsim/output/MSEmissionExport.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSEmissionExport.h 2012-12-02 13:39:49.000000000 +0000 @@ -0,0 +1,80 @@ +/****************************************************************************/ +/// @file MSEmissionExport.h +/// @author Mario Krumnow +/// +// Realises dumping Emission Data +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSEmissionExport_h +#define MSEmissionExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSEmissionExport + * @brief Realises dumping Emission Data + * + * The class offers a static method, which writes all available emission factors + * of each vehicles of the network into the given OutputDevice. + * + * @todo consider error-handling on write (using IOError) + */ +class MSEmissionExport { +public: + /** @brief Writes the complete network state of the given edges into the given device + * + * Opens the current time step and export the emission factors of all availabel vehicles + * + * @param[in] of The output device to use + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + + +private: + /// @brief Invalidated copy constructor. + MSEmissionExport(const MSEmissionExport&); + + /// @brief Invalidated assignment operator. + MSEmissionExport& operator=(const MSEmissionExport&); + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSFCDExport.cpp sumo-0.16.0~dfsg/src/microsim/output/MSFCDExport.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSFCDExport.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSFCDExport.cpp 2012-12-02 13:39:49.000000000 +0000 @@ -0,0 +1,85 @@ +/****************************************************************************/ +/// @file MSFCDExport.cpp +/// @author Mario Krumnow +/// +// Realises dumping Floating Car Data (FCD) Data +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "MSFCDExport.h" +#include +#include + +#ifdef HAVE_MESOSIM +#include +#include +#endif + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +void +MSFCDExport::write(OutputDevice& of, SUMOTime timestep) { + const bool useGeo = OptionsCont::getOptions().getBool("fcd-output.geo"); + MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + MSVehicleControl::constVehIt it = vc.loadedVehBegin(); + MSVehicleControl::constVehIt end = vc.loadedVehEnd(); + + of.openTag("timestep") << " time=\"" << time2string(timestep) << "\">\n"; + for (; it != end; ++it) { + const MSVehicle* veh = static_cast((*it).second); + if (veh->isOnRoad()) { + std::string fclass = veh->getVehicleType().getID(); + fclass = fclass.substr(0, fclass.find_first_of("@")); + Position pos = veh->getLane()->getShape().positionAtLengthPosition( + veh->getLane()->interpolateLanePosToGeometryPos(veh->getPositionOnLane())); + if (useGeo) { + of.setPrecision(GEO_OUTPUT_ACCURACY); + GeoConvHelper::getFinal().cartesian2geo(pos); + } + of.openTag("vehicle"); + of.writeAttr(SUMO_ATTR_ID, veh->getID()); + of.writeAttr(SUMO_ATTR_X, pos.x()); + of.writeAttr(SUMO_ATTR_Y, pos.y()); + of.writeAttr(SUMO_ATTR_ANGLE, veh->getAngle()); + of.writeAttr(SUMO_ATTR_TYPE, fclass); + of.writeAttr(SUMO_ATTR_SPEED, veh->getSpeed()); + of.closeTag(true); + } + } + of.closeTag(); +} + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSFCDExport.h sumo-0.16.0~dfsg/src/microsim/output/MSFCDExport.h --- sumo-0.15.0~dfsg/src/microsim/output/MSFCDExport.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSFCDExport.h 2012-09-25 22:01:36.000000000 +0000 @@ -0,0 +1,162 @@ +/****************************************************************************/ +/// @file MSFCDExport.h +/// @author Mario Krumnow +/// +// Realises dumping Floating Car Data (FCD) Data +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSFCDExport_h +#define MSFCDExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSFCDExport + * @brief Realises dumping FCD Data + * + * The class offers a static method, which writes Position of each vehicle of + * the network into the given OutputDevice. + * + * @todo consider error-handling on write (using IOError) + */ +class MSFCDExport { +public: + /** @brief Writes the posion and the angle of each vehcile into the given device + * + * Opens the current time step and export the values vehicle id, position and angle + * + * @param[in] of The output device to use + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + + +private: + /// @brief Invalidated copy constructor. + MSFCDExport(const MSFCDExport&); + + /// @brief Invalidated assignment operator. + MSFCDExport& operator=(const MSFCDExport&); + + +}; + + +#endif + +/****************************************************************************/ +/****************************************************************************/ +/// @file MSFCDExport.h +/// @author Mario Krumnow +/// +// Realises dumping Floating Car Data (FCD) Data +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSFCDExport_h +#define MSFCDExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSFCDExport + * @brief Realises dumping FCD Data + * + * The class offers a static method, which writes Position of each vehicle of + * the network into the given OutputDevice. + * + * @todo consider error-handling on write (using IOError) + */ +class MSFCDExport { +public: + /** @brief Writes the posion and the angle of each vehcile into the given device + * + * Opens the current time step and export the values vehicle id, position and angle + * + * @param[in] of The output device to use + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + + +private: + /// @brief Invalidated copy constructor. + MSFCDExport(const MSFCDExport&); + + /// @brief Invalidated assignment operator. + MSFCDExport& operator=(const MSFCDExport&); + + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSFullExport.cpp sumo-0.16.0~dfsg/src/microsim/output/MSFullExport.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSFullExport.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSFullExport.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,194 @@ +/****************************************************************************/ +/// @file MSFullExport.cpp +/// @author Mario Krumnow +/// @version $Id: MSFullExport.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Dumping a hugh List of Parameters available in the Simulation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "MSFullExport.h" +#include +#include +#include + +#ifdef HAVE_MESOSIM +#include +#include +#endif + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +void +MSFullExport::write(OutputDevice& of, SUMOTime timestep) { + + of.openTag("data") << " timestep=\"" << time2string(timestep) << "\">\n"; + + //Vehicles + writeVehicles(of); + + //Edges + writeEdge(of); + + //TrafficLights + writeTLS(of, timestep); + + + of.closeTag(); +} + +void +MSFullExport::writeVehicles(OutputDevice& of) { + + of.openTag("vehicles") << ">\n"; + + const std::string indent(" "); + MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + MSVehicleControl::constVehIt it = vc.loadedVehBegin(); + MSVehicleControl::constVehIt end = vc.loadedVehEnd(); + + + for (; it != end; ++it) { + const MSVehicle* veh = static_cast((*it).second); + + if (veh->isOnRoad()) { + + std::string fclass = veh->getVehicleType().getID(); + fclass = fclass.substr(0, fclass.find_first_of("@")); + + Position pos = veh->getLane()->getShape().positionAtLengthPosition(veh->getPositionOnLane()); + + of.openTag("vehicle") << " id=\"" << veh->getID() << "\" eclass=\"" << veh->getVehicleType().getEmissionClass() << "\" co2=\"" << veh->getHBEFA_CO2Emissions() + << "\" co=\"" << veh->getHBEFA_COEmissions() << "\" hc=\"" << veh->getHBEFA_HCEmissions() + << "\" nox=\"" << veh->getHBEFA_NOxEmissions() << "\" pmx=\"" << veh->getHBEFA_PMxEmissions() + << "\" noise=\"" << veh->getHarmonoise_NoiseEmissions() << "\" route=\"" << veh->getRoute().getID() + << "\" type=\"" << fclass << "\" waiting=\"" << veh->getWaitingSeconds() + << "\" lane=\"" << veh->getLane()->getID() + << "\" pos_lane=\"" << veh->getPositionOnLane() << "\" speed=\"" << veh->getSpeed() * 3.6 + << "\" angle=\"" << veh->getAngle() << "\" x=\"" << pos.x() << "\" y=\"" << pos.y() << "\""; + + of.closeTag(true); + + } + + } + + of.closeTag(); + + + +} + +void +MSFullExport::writeEdge(OutputDevice& of) { + + of.openTag("edges") << ">\n"; + + MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); + + const std::vector& edges = ec.getEdges(); + for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + + MSEdge& edge = **e; + + of.openTag("edge") << " id=\"" << edge.getID() << "\" traveltime=\"" << edge.getCurrentTravelTime() << "\">\n"; + + const std::vector& lanes = edge.getLanes(); + for (std::vector::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) { + + writeLane(of, **lane); + + } + + of.closeTag(); + + } + + of.closeTag(); + +} + +void +MSFullExport::writeLane(OutputDevice& of, const MSLane& lane) { + + of.openTag("lane") + << " id=\"" << lane.getID() + << "\" co=\"" << lane.getHBEFA_COEmissions() + << "\" co2=\"" << lane.getHBEFA_CO2Emissions() + << "\" nox=\"" << lane.getHBEFA_NOxEmissions() + << "\" pmx=\"" << lane.getHBEFA_PMxEmissions() + << "\" hc=\"" << lane.getHBEFA_HCEmissions() + << "\" noise=\"" << lane.getHarmonoise_NoiseEmissions() + << "\" fuel=\"" << lane.getHBEFA_FuelConsumption() + << "\" maxspeed=\"" << lane.getSpeedLimit() * 3.6 + << "\" meanspeed=\"" << lane.getMeanSpeed() * 3.6 + << "\" occupancy=\"" << lane.getOccupancy() + << "\" vehicle_count=\"" << lane.getVehicleNumber() << "\""; + + of.closeTag(true); + +} + +void +MSFullExport::writeTLS(OutputDevice& of, SUMOTime /* timestep */) { + of.openTag("tls") << ">\n"; + MSTLLogicControl& vc = MSNet::getInstance()->getTLSControl(); + std::vector ids = vc.getAllTLIds(); + for (std::vector::const_iterator id_it = ids.begin(); id_it != ids.end(); ++id_it) { + MSTLLogicControl::TLSLogicVariants& vars = MSNet::getInstance()->getTLSControl().get(*id_it); + const MSTrafficLightLogic::LaneVectorVector& lanes = vars.getActive()->getLanes(); + + std::vector laneIDs; + for (MSTrafficLightLogic::LaneVectorVector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { + const MSTrafficLightLogic::LaneVector& llanes = (*i); + for (MSTrafficLightLogic::LaneVector::const_iterator j = llanes.begin(); j != llanes.end(); ++j) { + laneIDs.push_back((*j)->getID()); + } + } + + std::string lane_output = ""; + for (unsigned int i1 = 0; i1 < laneIDs.size(); ++i1) { + lane_output += laneIDs[i1] + " "; + } + + std::string state = vars.getActive()->getCurrentPhaseDef().getState(); + of.openTag("trafficlight") << " id=\"" << *id_it << "\" state=\"" << state << "\""; + of.closeTag(true); + + } + + of.closeTag(); + +} diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSFullExport.h sumo-0.16.0~dfsg/src/microsim/output/MSFullExport.h --- sumo-0.15.0~dfsg/src/microsim/output/MSFullExport.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSFullExport.h 2012-12-02 13:39:49.000000000 +0000 @@ -0,0 +1,95 @@ +/****************************************************************************/ +/// @file MSFullExport.h +/// @author Mario Krumnow +/// +// Dumping a hugh List of Parameters available in the Simulation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSFullExport_h +#define MSFullExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSFullExport + * @brief Dumping a hugh List of Parameters available in the Simulation + * + * The class offers a static method, which writes a hugh List of Parameters + * available in the Simulation into the given OutputDevice. + * + * @todo consider error-handling on write (using IOError) + */ +class MSFullExport { +public: + /**@brief Dumping a hugh List of Parameters available in the Simulation + * + * The class offers a static method, which writes a hugh List of Parameters + * available in the Simulation into the given OutputDevice. + * + * @param[in] of The output device to use + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + + +private: + /// @brief Invalidated copy constructor. + MSFullExport(const MSFullExport&); + + /// @brief Invalidated assignment operator. + MSFullExport& operator=(const MSFullExport&); + + /// @brief Writes the XML Nodes for the vehicles (e.g. speed, position, emissions) + static void writeVehicles(OutputDevice& of); + + /// @brief Writes the XML Nodes for the edges (e.g. traveltime) + static void writeEdge(OutputDevice& of); + + /// @brief Writes the XML Nodes for the lanes (e.g. emissions, occupancy) + static void writeLane(OutputDevice& of, const MSLane& lane); + + /// @brief Writes the XML Nodes for the traffic lights (e.g. actual state) + static void writeTLS(OutputDevice& of, SUMOTime timestep); + +}; + + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSInductLoop.cpp sumo-0.16.0~dfsg/src/microsim/output/MSInductLoop.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSInductLoop.cpp 2012-02-16 15:57:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSInductLoop.cpp 2012-09-25 22:01:36.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2004-11-23 -/// @version $Id: MSInductLoop.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSInductLoop.cpp 12469 2012-07-04 05:33:45Z behrisch $ /// // An unextended detector measuring at a fixed position on a fixed lane. /****************************************************************************/ @@ -58,15 +58,13 @@ // =========================================================================== MSInductLoop::MSInductLoop(const std::string& id, MSLane* const lane, SUMOReal positionInMeters, bool splitByType) : - MSMoveReminder(lane), - MSDetectorFileOutput(id), - myPosition(positionInMeters), - myLastLeaveTime(0), + MSMoveReminder(lane), MSDetectorFileOutput(id), + myPosition(positionInMeters), mySplitByType(splitByType), + myLastLeaveTime(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep())), myVehicleDataCont(), - myVehiclesOnDet(), mySplitByType(splitByType) { + myVehiclesOnDet() { assert(myPosition >= 0 && myPosition <= myLane->getLength()); reset(); - myLastLeaveTime = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSInductLoop.h sumo-0.16.0~dfsg/src/microsim/output/MSInductLoop.h --- sumo-0.15.0~dfsg/src/microsim/output/MSInductLoop.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSInductLoop.h 2012-09-25 22:01:36.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: MSInductLoop.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSInductLoop.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // An unextended detector measuring at a fixed position on a fixed lane. /****************************************************************************/ @@ -81,16 +81,16 @@ * @param[in] splitByType Whether additional information split by vehicle classes shall be generated */ MSInductLoop(const std::string& id, MSLane* const lane, - SUMOReal positionInMeters, bool splitByType) ; + SUMOReal positionInMeters, bool splitByType); /// @brief Destructor - ~MSInductLoop() ; + ~MSInductLoop(); /** @brief Resets all generated values to allow computation of next interval */ - virtual void reset() ; + virtual void reset(); /** @brief Returns the position of the detector on the lane @@ -120,7 +120,7 @@ * @see enterDetectorByMove * @see leaveDetectorByMove */ - bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ; + bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed); /** @brief Dismisses the vehicle if it is on the detector due to a lane change @@ -137,7 +137,7 @@ * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason); /** @brief Returns whether the detector may has to be concerned during the vehicle's further movement @@ -153,7 +153,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); //@} @@ -168,7 +168,7 @@ * * @return The speed [m/s] of the vehicle if one is on the detector, -1 otherwise */ - SUMOReal getCurrentSpeed() const ; + SUMOReal getCurrentSpeed() const; /** @brief Returns the length of the vehicle on the detector @@ -178,7 +178,7 @@ * * @return The length [m] of the vehicle if one is on the detector, -1 otherwise */ - SUMOReal getCurrentLength() const ; + SUMOReal getCurrentLength() const; /** @brief Returns the current occupancy @@ -190,7 +190,7 @@ * @return This detector's current occupancy * @todo recheck (especially if more than one vehicle has passed) */ - SUMOReal getCurrentOccupancy() const ; + SUMOReal getCurrentOccupancy() const; /** @brief Returns the number of vehicles that have passed the detector @@ -202,7 +202,7 @@ * @return The number of vehicles that have passed the detector * @todo recheck (especially if more than one vehicle has passed) */ - unsigned int getCurrentPassedNumber() const ; + unsigned int getCurrentPassedNumber() const; /** @brief Returns the ids of vehicles that have passed the detector @@ -210,14 +210,14 @@ * @return The ids of vehicles that have passed the detector * @todo recheck (especially if more than one vehicle has passed) */ - std::vector getCurrentVehicleIDs() const ; + std::vector getCurrentVehicleIDs() const; /** @brief Returns the time since the last vehicle left the detector * * @return Timesteps from last leaving (detection) of the detector */ - SUMOReal getTimestepsSinceLastDetection() const ; + SUMOReal getTimestepsSinceLastDetection() const; //@} @@ -287,7 +287,7 @@ * @param[in] t The time from which vehicles shall be counted * @return The list of vehicles */ - virtual std::vector collectVehiclesOnDet(SUMOTime t) const ; + virtual std::vector collectVehiclesOnDet(SUMOTime t) const; protected: @@ -298,7 +298,7 @@ * @param veh The entering vehicle. * @param entryTimestep Timestep (not necessary integer) of entrance. */ - virtual void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep) ; + virtual void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep); /** @brief Processes a vehicle that leaves the detector @@ -309,13 +309,13 @@ * @param veh The leaving vehicle. * @param leaveTimestep Timestep (not necessary integer) of leaving. */ - virtual void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep) ; + virtual void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep); /** @brief Removes a vehicle from the detector's map myVehiclesOnDet. * @param veh The leaving vehicle. */ - virtual void leaveDetectorByLaneChange(SUMOVehicle& veh) ; + virtual void leaveDetectorByLaneChange(SUMOVehicle& veh); /// @} diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSInstantInductLoop.h sumo-0.16.0~dfsg/src/microsim/output/MSInstantInductLoop.h --- sumo-0.15.0~dfsg/src/microsim/output/MSInstantInductLoop.h 2012-03-08 00:03:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSInstantInductLoop.h 2012-09-25 22:01:36.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MSInstantInductLoop.h /// @author Daniel Krajzewicz /// @date 2011-09.08 -/// @version $Id: MSInstantInductLoop.h 12025 2012-03-07 09:20:15Z behrisch $ +/// @version $Id: MSInstantInductLoop.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // An instantaneous induction loop /****************************************************************************/ @@ -68,11 +68,11 @@ * @param[in] position Position of the detector within the lane. */ MSInstantInductLoop(const std::string& id, OutputDevice& od, - MSLane* const lane, SUMOReal positionInMeters) ; + MSLane* const lane, SUMOReal positionInMeters); /// @brief Destructor - ~MSInstantInductLoop() ; + ~MSInstantInductLoop(); @@ -95,7 +95,7 @@ * @see enterDetectorByMove * @see leaveDetectorByMove */ - bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) ; + bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed); /** @brief Dismisses the vehicle if it is on the detector due to a lane change @@ -112,7 +112,7 @@ * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason); /** @brief Returns whether the detector may has to be concerned during the vehicle's further movement @@ -128,7 +128,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); //@} diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData.cpp sumo-0.16.0~dfsg/src/microsim/output/MSMeanData.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Data collector for edges/lanes /****************************************************************************/ @@ -42,7 +42,7 @@ #include "MSMeanData.h" #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #include @@ -82,24 +82,26 @@ bool MSMeanData::MeanDataValues::notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) { + // if the vehicle has arrived, the reminder must be kept so it can be + // notified of the arrival subsequently SUMOReal timeOnLane = TS; bool ret = true; if (oldPos < 0 && newSpeed != 0) { timeOnLane = newPos / newSpeed; } - if (newPos-veh.getVehicleType().getLength() > myLaneLength && newSpeed != 0) { + if (newPos - veh.getVehicleType().getLength() > myLaneLength && newSpeed != 0) { timeOnLane -= (newPos - veh.getVehicleType().getLength() - myLaneLength) / newSpeed; if (fabs(timeOnLane) < 0.001) { // reduce rounding errors timeOnLane = 0.; } - ret = false; + ret = veh.hasArrived(); } if (timeOnLane < 0) { WRITE_ERROR("Negative vehicle step fraction for '" + veh.getID() + "' on lane '" + getLane()->getID() + "'."); - return false; + return veh.hasArrived(); } if (timeOnLane == 0) { - return false; + return veh.hasArrived(); } notifyMoveInternal(veh, timeOnLane, newSpeed); return ret; @@ -266,13 +268,13 @@ void MSMeanData::init() { - const std::vector &edges = MSNet::getInstance()->getEdgeControl().getEdges(); + const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { if (myDumpInternal || (*e)->getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) { myEdges.push_back(*e); myMeasures.push_back(std::vector()); - const std::vector &lanes = (*e)->getLanes(); -#ifdef HAVE_MESOSIM + const std::vector& lanes = (*e)->getLanes(); +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MeanDataValues* data; if (myTrackVehicles) { @@ -323,7 +325,7 @@ void MSMeanData::resetOnly(SUMOTime stopTime) { UNUSED_PARAMETER(stopTime); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { std::vector::iterator edge = myEdges.begin(); for (std::vector >::const_iterator i = myMeasures.begin(); i != myMeasures.end(); ++i, ++edge) { @@ -348,9 +350,9 @@ void MSMeanData::writeEdge(OutputDevice& dev, - const std::vector &edgeValues, + const std::vector& edgeValues, MSEdge* edge, SUMOTime startTime, SUMOTime stopTime) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(*edge); MeanDataValues* data = edgeValues.front(); @@ -358,10 +360,10 @@ s->prepareDetectorForWriting(*data); s = s->getNextSegment(); } - if (writePrefix(dev, *data, "edge", edge->getID())) { + if (writePrefix(dev, *data, SUMO_TAG_EDGE, edge->getID())) { data->write(dev, stopTime - startTime, (SUMOReal)edge->getLanes().size(), - myPrintDefaults ? edge->getLength() / edge->getMaxSpeed() : -1.); + myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } data->reset(true); return; @@ -379,13 +381,12 @@ } } if (writeCheck) { - dev.openTag("edge").writeAttr(SUMO_ATTR_ID, edge->getID()).closeOpener(); + dev.openTag(SUMO_TAG_EDGE).writeAttr(SUMO_ATTR_ID, edge->getID()).closeOpener(); } for (lane = edgeValues.begin(); lane != edgeValues.end(); ++lane) { MeanDataValues& meanData = **lane; - if (writePrefix(dev, meanData, "lane", meanData.getLane()->getID())) { - meanData.write(dev, stopTime - startTime, 1.f, - myPrintDefaults ? meanData.getLane()->getLength() / meanData.getLane()->getMaxSpeed() : -1.); + 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.reset(true); } @@ -395,9 +396,8 @@ } else { if (myTrackVehicles) { MeanDataValues& meanData = **edgeValues.begin(); - if (writePrefix(dev, meanData, "edge", edge->getID())) { - meanData.write(dev, stopTime - startTime, (SUMOReal)edge->getLanes().size(), - myPrintDefaults ? edge->getLength() / edge->getMaxSpeed() : -1.); + if (writePrefix(dev, meanData, SUMO_TAG_EDGE, edge->getID())) { + meanData.write(dev, stopTime - startTime, (SUMOReal)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } meanData.reset(true); } else { @@ -407,9 +407,8 @@ meanData.addTo(*sumData); meanData.reset(); } - if (writePrefix(dev, *sumData, "edge", edge->getID())) { - sumData->write(dev, stopTime - startTime, (SUMOReal)edge->getLanes().size(), - myPrintDefaults ? edge->getLength() / edge->getMaxSpeed() : -1.); + if (writePrefix(dev, *sumData, SUMO_TAG_EDGE, edge->getID())) { + sumData->write(dev, stopTime - startTime, (SUMOReal)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } delete sumData; } @@ -418,7 +417,7 @@ bool -MSMeanData::writePrefix(OutputDevice& dev, const MeanDataValues& values, const std::string tag, const std::string id) const { +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) << " sampledSeconds=\"" << values.getSamples(); return true; @@ -456,8 +455,8 @@ stopTime = myPendingIntervals.front().second; myPendingIntervals.pop_front(); } - dev.openTag("interval") << " begin=\"" << time2string(startTime) << "\" end=\"" << - time2string(stopTime) << "\" " << "id=\"" << myID << "\">\n"; + dev.openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, STEPS2TIME(startTime)).writeAttr(SUMO_ATTR_END, STEPS2TIME(stopTime)); + dev.writeAttr(SUMO_ATTR_ID, myID).closeOpener(); std::vector::iterator edge = myEdges.begin(); for (std::vector >::const_iterator i = myMeasures.begin(); i != myMeasures.end(); ++i, ++edge) { writeEdge(dev, (*i), *edge, startTime, stopTime); diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData.h sumo-0.16.0~dfsg/src/microsim/output/MSMeanData.h --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 17.11.2009 -/// @version $Id: MSMeanData.h 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Data collector for edges/lanes /****************************************************************************/ @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -101,7 +100,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - virtual bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + virtual bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /** @brief Checks whether the reminder still has to be notified about the vehicle moves @@ -118,7 +117,7 @@ * @return True if vehicle hasn't passed the reminder completely. */ bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, - SUMOReal newPos, SUMOReal newSpeed) ; + SUMOReal newPos, SUMOReal newSpeed); /** @brief Called if the vehicle leaves the reminder's lane @@ -130,7 +129,7 @@ * @see MSMoveReminder::notifyLeave */ virtual bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, - MSMoveReminder::Notification reason) ; + MSMoveReminder::Notification reason); /** @brief Tests whether the vehicles type is to be regarded @@ -138,19 +137,19 @@ * @param[in] veh The regarded vehicle * @return whether the type of the vehicle is in the set of regarded types */ - bool vehicleApplies(const SUMOVehicle& veh) const ; + bool vehicleApplies(const SUMOVehicle& veh) const; /** @brief Returns whether any data was collected. * * @return whether no data was collected */ - virtual bool isEmpty() const ; + virtual bool isEmpty() const; /** @brief Called if a per timestep update is needed. Default does nothing. */ - virtual void update() ; + virtual void update(); /** @brief Writes output values into the given stream * @@ -166,7 +165,7 @@ /** @brief Returns the number of collected sample seconds. * @return the number of collected sample seconds */ - virtual SUMOReal getSamples() const ; + virtual SUMOReal getSamples() const; protected: /// @brief The length of the lane / edge the data collector is on @@ -197,20 +196,20 @@ /** @brief Constructor */ MeanDataValueTracker(MSLane* const lane, const SUMOReal length, const std::set* const vTypes = 0, - const MSMeanData* const parent = 0) ; + const MSMeanData* const parent = 0); /** @brief Destructor */ - virtual ~MeanDataValueTracker() ; + virtual ~MeanDataValueTracker(); /** @brief Resets values so they may be used for the next interval */ - void reset(bool afterWrite) ; + void reset(bool afterWrite); /** @brief Add the values of this to the given one and store them there * * @param[in] val The meandata to add to */ - void addTo(MSMeanData::MeanDataValues& val) const ; + void addTo(MSMeanData::MeanDataValues& val) const; /// @name Methods inherited from MSMoveReminder /// @{ @@ -225,7 +224,7 @@ * @param[in] timeOnLane time the vehicle spent on the lane. * @param[in] speed Moving speed. */ - void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, SUMOReal speed) ; + void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, SUMOReal speed); /** @brief Called if the vehicle leaves the reminder's lane @@ -237,7 +236,7 @@ * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason); /** @brief Computes current values and adds them to their sums @@ -251,10 +250,10 @@ * @see MSMoveReminder::notifyEnter * @return Always true */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); //@} - bool isEmpty() const ; + bool isEmpty() const; /** @brief Writes output values into the given stream * @@ -267,11 +266,11 @@ const SUMOReal numLanes, const SUMOReal defaultTravelTime, const int numVehicles = -1) const; - size_t getNumReady() const ; + size_t getNumReady() const; - void clearFirst() ; + void clearFirst(); - SUMOReal getSamples() const ; + SUMOReal getSamples() const; private: class TrackerEntry { @@ -327,11 +326,11 @@ /// @brief Destructor - virtual ~MSMeanData() ; + virtual ~MSMeanData(); /** @brief Adds the value collectors to all relevant edges. */ - void init() ; + void init(); /// @name Methods inherited from MSDetectorFileOutput. /// @{ @@ -363,7 +362,7 @@ /** @brief Updates the detector */ - virtual void detectorUpdate(const SUMOTime step) ; + virtual void detectorUpdate(const SUMOTime step); protected: @@ -379,7 +378,7 @@ * Goes through the lists of edges and starts "resetOnly" for each edge. * @param [in] edge The last time step that is reported */ - void resetOnly(SUMOTime stopTime) ; + void resetOnly(SUMOTime stopTime); /** @brief Writes edge values into the given stream * @@ -395,7 +394,7 @@ * @param[in] stopTime Last time step the data were gathered * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - void writeEdge(OutputDevice& dev, const std::vector &edgeValues, + void writeEdge(OutputDevice& dev, const std::vector& edgeValues, MSEdge* edge, SUMOTime startTime, SUMOTime stopTime); /** @brief Checks for emptiness and writes prefix into the given stream @@ -408,7 +407,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ bool writePrefix(OutputDevice& dev, const MeanDataValues& values, - const std::string tag, const std::string id) const; + const SumoXMLTag tag, const std::string id) const; protected: /// @brief the minimum sample seconds diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_HBEFA.cpp sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_HBEFA.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_HBEFA.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_HBEFA.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_HBEFA.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData_HBEFA.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Emission data collector for edges/lanes /****************************************************************************/ @@ -50,10 +50,12 @@ // --------------------------------------------------------------------------- // MSMeanData_HBEFA::MSLaneMeanDataValues - methods // --------------------------------------------------------------------------- -MSMeanData_HBEFA::MSLaneMeanDataValues::MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd, +MSMeanData_HBEFA::MSLaneMeanDataValues::MSLaneMeanDataValues(MSLane* const lane, + const SUMOReal length, const bool doAdd, const std::set* const vTypes, const MSMeanData_HBEFA* parent) - : MSMeanData::MeanDataValues(lane, length, doAdd, vTypes), myParent(parent), CO2(0), CO(0), HC(0), NOx(0), PMx(0), fuel(0) {} + : MSMeanData::MeanDataValues(lane, length, doAdd, vTypes), + CO2(0), CO(0), HC(0), NOx(0), PMx(0), fuel(0), myParent(parent) {} MSMeanData_HBEFA::MSLaneMeanDataValues::~MSLaneMeanDataValues() { @@ -91,7 +93,7 @@ MSMeanData_HBEFA::MSLaneMeanDataValues::notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, SUMOReal speed) { sampleSeconds += timeOnLane; travelledDistance += speed * timeOnLane; - const double a = veh.getPreDawdleAcceleration(); + const double a = veh.getAcceleration(); CO += (timeOnLane * HelpersHBEFA::computeCO(veh.getVehicleType().getEmissionClass(), (double) speed, a)); CO2 += (timeOnLane * HelpersHBEFA::computeCO2(veh.getVehicleType().getEmissionClass(), (double) speed, a)); HC += (timeOnLane * HelpersHBEFA::computeHC(veh.getVehicleType().getEmissionClass(), (double) speed, a)); @@ -143,7 +145,7 @@ "\" fuel_perVeh=\"" << OutputDevice::realString(HelpersHBEFA::computeDefaultFuel(t->getEmissionClass(), speed, t->getCarFollowModel().getMaxAccel(), defaultTravelTime), 6); } dev << "\""; - dev.closeTag(true); + dev.closeTag(true); } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_HBEFA.h sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_HBEFA.h --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_HBEFA.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_HBEFA.h 2012-09-25 22:01:36.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_HBEFA.h 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData_HBEFA.h 12381 2012-06-08 09:28:48Z dkrajzew $ /// // Emission data collector for edges/lanes /****************************************************************************/ @@ -33,7 +33,6 @@ #include #include -#include #include "MSMeanData.h" #include @@ -73,21 +72,21 @@ /** @brief Constructor */ MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd, const std::set* const vTypes = 0, - const MSMeanData_HBEFA* parent = 0) ; + const MSMeanData_HBEFA* parent = 0); /** @brief Destructor */ - virtual ~MSLaneMeanDataValues() ; + virtual ~MSLaneMeanDataValues(); /** @brief Resets values so they may be used for the next interval */ - void reset(bool afterWrite = false) ; + void reset(bool afterWrite = false); /** @brief Add the values of this to the given one and store them there * * @param[in] val The meandata to add to */ - void addTo(MSMeanData::MeanDataValues& val) const ; + void addTo(MSMeanData::MeanDataValues& val) const; /** @brief Writes output values into the given stream * @@ -113,7 +112,7 @@ * @param[in] speed Moving speed. */ void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, - SUMOReal speed) ; + SUMOReal speed); private: /// @name Collected values @@ -158,11 +157,11 @@ const bool printDefaults, const bool withInternal, const bool trackVehicles, const SUMOReal minSamples, const SUMOReal maxTravelTime, - const std::set vTypes) ; + const std::set vTypes); /// @brief Destructor - virtual ~MSMeanData_HBEFA() ; + virtual ~MSMeanData_HBEFA(); protected: /** @brief Create an instance of MeanDataValues diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.cpp sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Harmonoise.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData_Harmonoise.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Redirector for mean data output (net->edgecontrol) /****************************************************************************/ @@ -88,7 +88,7 @@ void MSMeanData_Harmonoise::MSLaneMeanDataValues::notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, SUMOReal speed) { const SUMOReal sn = HelpersHarmonoise::computeNoise(veh.getVehicleType().getEmissionClass(), - (double) speed, veh.getPreDawdleAcceleration()); + (double) speed, veh.getAcceleration()); currentTimeN += (SUMOReal) pow(10., (sn / 10.)); sampleSeconds += timeOnLane; travelledDistance += speed * timeOnLane; @@ -116,7 +116,7 @@ dev << "\" traveltime=\"" << defaultTravelTime; } dev << "\""; - dev.closeTag(true); + dev.closeTag(true); } @@ -149,7 +149,7 @@ MSMeanData_Harmonoise::detectorUpdate(const SUMOTime step) { MSMeanData::detectorUpdate(step); for (std::vector >::const_iterator i = myMeasures.begin(); i != myMeasures.end(); ++i) { - const std::vector &lm = *i; + const std::vector& lm = *i; for (std::vector::const_iterator j = lm.begin(); j != lm.end(); ++j) { (*j)->update(); } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.h sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.h --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Harmonoise.h 2012-09-25 22:01:36.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Harmonoise.h 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData_Harmonoise.h 12381 2012-06-08 09:28:48Z dkrajzew $ /// // Noise data collector for edges/lanes /****************************************************************************/ @@ -32,7 +32,6 @@ #endif #include -#include #include #include "MSMeanData.h" @@ -72,19 +71,19 @@ /** @brief Constructor */ MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd, const std::set* const vTypes = 0, - const MSMeanData_Harmonoise* parent = 0) ; + const MSMeanData_Harmonoise* parent = 0); /** @brief Destructor */ - virtual ~MSLaneMeanDataValues() ; + virtual ~MSLaneMeanDataValues(); /** @brief Resets values so they may be used for the next interval */ - void reset(bool afterWrite = false) ; + void reset(bool afterWrite = false); /** @brief Add the values to this meanData */ - void addTo(MSMeanData::MeanDataValues& val) const ; + void addTo(MSMeanData::MeanDataValues& val) const; /// @name Methods inherited from MSMoveReminder. @@ -102,7 +101,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); //@} @@ -111,7 +110,7 @@ * The sum of noises collected so far (in the last seen step) * is built, and added to meanNTemp; currentTimeN is resetted. */ - void update() ; + void update(); /** @brief Writes output values into the given stream * @@ -138,7 +137,7 @@ * @param[in] speed Moving speed. */ void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, - SUMOReal speed) ; + SUMOReal speed); private: /// @name Collected values @@ -178,15 +177,15 @@ const bool printDefaults, const bool withInternal, const bool trackVehicles, const SUMOReal minSamples, const SUMOReal maxTravelTime, - const std::set vTypes) ; + const std::set vTypes); /// @brief Destructor - virtual ~MSMeanData_Harmonoise() ; + virtual ~MSMeanData_Harmonoise(); /** @brief Updates the detector */ - virtual void detectorUpdate(const SUMOTime step) ; + virtual void detectorUpdate(const SUMOTime step); protected: diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Net.cpp sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Net.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Net.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Net.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Net.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData_Net.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Network state mean data collector for edges/lanes /****************************************************************************/ @@ -39,7 +39,7 @@ #include "MSMeanData_Net.h" #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #include @@ -61,9 +61,10 @@ const bool doAdd, const std::set* const vTypes, const MSMeanData_Net* parent) - : MSMeanData::MeanDataValues(lane, length, doAdd, vTypes), myParent(parent), + : MSMeanData::MeanDataValues(lane, length, doAdd, vTypes), nVehDeparted(0), nVehArrived(0), nVehEntered(0), nVehLeft(0), - nVehLaneChangeFrom(0), nVehLaneChangeTo(0), waitSeconds(0), vehLengthSum(0) {} + nVehVaporized(0), nVehLaneChangeFrom(0), nVehLaneChangeTo(0), + waitSeconds(0), vehLengthSum(0), myParent(parent) {} MSMeanData_Net::MSLaneMeanDataValues::~MSLaneMeanDataValues() { @@ -76,6 +77,7 @@ nVehArrived = 0; nVehEntered = 0; nVehLeft = 0; + nVehVaporized = 0; nVehLaneChangeFrom = 0; nVehLaneChangeTo = 0; sampleSeconds = 0.; @@ -92,6 +94,7 @@ v.nVehArrived += nVehArrived; v.nVehEntered += nVehEntered; v.nVehLeft += nVehLeft; + v.nVehVaporized += nVehVaporized; v.nVehLaneChangeFrom += nVehLaneChangeFrom; v.nVehLaneChangeTo += nVehLaneChangeTo; v.sampleSeconds += sampleSeconds; @@ -115,7 +118,7 @@ bool MSMeanData_Net::MSLaneMeanDataValues::notifyLeave(SUMOVehicle& veh, SUMOReal /*lastPos*/, MSMoveReminder::Notification reason) { if (vehicleApplies(veh) && (getLane() == 0 || getLane() == static_cast(veh).getLane())) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { myLastVehicleUpdateValues.erase(&veh); } @@ -126,9 +129,12 @@ ++nVehLaneChangeFrom; } else if (myParent == 0 || reason != MSMoveReminder::NOTIFICATION_SEGMENT) { ++nVehLeft; + if (reason == MSMoveReminder::NOTIFICATION_VAPORIZED) { + ++nVehVaporized; + } } } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { return false; } @@ -157,7 +163,8 @@ bool MSMeanData_Net::MSLaneMeanDataValues::isEmpty() const { - return sampleSeconds == 0 && nVehDeparted == 0 && nVehArrived == 0 && nVehEntered == 0 && nVehLeft == 0 && nVehLaneChangeFrom == 0 && nVehLaneChangeTo == 0; + return sampleSeconds == 0 && nVehDeparted == 0 && nVehArrived == 0 && nVehEntered == 0 + && nVehLeft == 0 && nVehVaporized == 0 && nVehLaneChangeFrom == 0 && nVehLaneChangeTo == 0; } @@ -175,7 +182,10 @@ "\" arrived=\"" << nVehArrived << "\" entered=\"" << nVehEntered << "\" left=\"" << nVehLeft << "\""; - dev.closeTag(true); + if (nVehVaporized > 0) { + dev << " vaporized=\"" << nVehVaporized << "\""; + } + dev.closeTag(true); return; } if (sampleSeconds > myParent->myMinSamples) { @@ -204,7 +214,10 @@ "\" left=\"" << nVehLeft << "\" laneChangedFrom=\"" << nVehLaneChangeFrom << "\" laneChangedTo=\"" << nVehLaneChangeTo << "\""; - dev.closeTag(true); + if (nVehVaporized > 0) { + dev << " vaporized=\"" << nVehVaporized << "\""; + } + dev.closeTag(true); } // --------------------------------------------------------------------------- @@ -220,9 +233,9 @@ const SUMOReal minSamples, const SUMOReal haltSpeed, const std::set vTypes) - : MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, - withInternal, trackVehicles, maxTravelTime, minSamples, vTypes), - myHaltSpeed(haltSpeed) { + : MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, + withInternal, trackVehicles, maxTravelTime, minSamples, vTypes), + myHaltSpeed(haltSpeed) { } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Net.h sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Net.h --- sumo-0.15.0~dfsg/src/microsim/output/MSMeanData_Net.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSMeanData_Net.h 2012-09-25 22:01:36.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Net.h 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: MSMeanData_Net.h 12381 2012-06-08 09:28:48Z dkrajzew $ /// // Network state mean data collector for edges/lanes /****************************************************************************/ @@ -34,7 +34,6 @@ #include #include -#include #include #include "MSMeanData.h" @@ -78,20 +77,20 @@ */ MSLaneMeanDataValues(MSLane* const lane, const SUMOReal length, const bool doAdd, const std::set* const vTypes = 0, - const MSMeanData_Net* parent = 0) ; + const MSMeanData_Net* parent = 0); /** @brief Destructor */ - virtual ~MSLaneMeanDataValues() ; + virtual ~MSLaneMeanDataValues(); /** @brief Resets values so they may be used for the next interval */ - void reset(bool afterWrite = false) ; + void reset(bool afterWrite = false); /** @brief Add the values of this to the given one and store them there * * @param[in] val The meandata to add to */ - void addTo(MSMeanData::MeanDataValues& val) const ; + void addTo(MSMeanData::MeanDataValues& val) const; /// @name Methods inherited from MSMoveReminder /// @{ @@ -105,7 +104,7 @@ * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ - bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) ; + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason); /** @brief Computes current values and adds them to their sums @@ -121,10 +120,10 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); //@} - bool isEmpty() const ; + bool isEmpty() const; /** @brief Writes output values into the given stream * @@ -149,7 +148,7 @@ * @param[in] speed Moving speed. */ void notifyMoveInternal(SUMOVehicle& veh, SUMOReal timeOnLane, - SUMOReal speed) ; + SUMOReal speed); public: /// @name Collected values @@ -166,6 +165,9 @@ /// @brief The number of vehicles that left this lane within the sample interval unsigned nVehLeft; + /// @brief The number of vehicles that left this lane within the sample interval + unsigned nVehVaporized; + private: /// @brief The number of vehicles that changed from this lane unsigned nVehLaneChangeFrom; @@ -211,7 +213,7 @@ /// @brief Destructor - virtual ~MSMeanData_Net() ; + virtual ~MSMeanData_Net(); protected: /** @brief Create an instance of MeanDataValues @@ -226,7 +228,7 @@ * Goes through the lists of edges and starts "resetOnly" for each edge. * @param [in] edge The last time step that is reported */ - void resetOnly(SUMOTime stopTime) ; + void resetOnly(SUMOTime stopTime); private: /// @brief the minimum sample seconds diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSQueueExport.cpp sumo-0.16.0~dfsg/src/microsim/output/MSQueueExport.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSQueueExport.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSQueueExport.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,183 @@ +/****************************************************************************/ +/// @file MSQueueExport.cpp +/// @author Mario Krumnow +/// @version $Id: MSQueueExport.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Export the queueing length in front of a junction (very experimental!) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include "MSQueueExport.h" +#include +#include + +#ifdef HAVE_MESOSIM +#include +#include +#endif + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +void +MSQueueExport::write(OutputDevice& of, SUMOTime timestep) { + + of.openTag("data") << " timestep=\"" << time2string(timestep) << "\">\n"; + + writeEdge(of); + + of.closeTag(); +} + +void +MSQueueExport::writeEdge(OutputDevice& of) { + + of.openTag("lanes") << ">\n"; + + MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); + + const std::vector& edges = ec.getEdges(); + for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + + MSEdge& edge = **e; + + const std::vector& lanes = edge.getLanes(); + for (std::vector::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) { + + writeLane(of, **lane); + + } + + } + + of.closeTag(); + +} + + +void +MSQueueExport::writeLane(OutputDevice& of, const MSLane& lane) { + + //Fahrzeug mit der höchsten Wartezeit + //Fahrzeug am Ende des Rückstaus + + double queueing_time = 0.0; + double queueing_length = 0.0; + double queueing_length2 = 0.0; + + + if (lane.getVehicleNumber() != 0) { + + for (std::vector::const_iterator veh = lane.myVehBuffer.begin(); veh != lane.myVehBuffer.end(); ++veh) { + + const MSVehicle& veh_tmp = **veh; + if (veh_tmp.isOnRoad()) { + + if (veh_tmp.getWaitingSeconds() > 0) { + + if (veh_tmp.getWaitingSeconds() > queueing_time) { + queueing_time = veh_tmp.getWaitingSeconds(); + } + + double tmp_length = (lane.getLength() - veh_tmp.getPositionOnLane()) + veh_tmp.getVehicleType().getLengthWithGap(); + + if (tmp_length > queueing_length) { + queueing_length = tmp_length; + } + + + } + + } + + } + + + for (MSLane::VehCont::const_iterator veh = lane.myVehicles.begin(); veh != lane.myVehicles.end(); ++veh) { + + const MSVehicle& veh_tmp = **veh; + if (veh_tmp.isOnRoad()) { + + if (veh_tmp.getWaitingSeconds() > 0) { + + if (veh_tmp.getWaitingSeconds() > queueing_time) { + queueing_time = veh_tmp.getWaitingSeconds(); + } + + double tmp_length = (lane.getLength() - veh_tmp.getPositionOnLane()) + veh_tmp.getVehicleType().getLengthWithGap(); + + if (tmp_length > queueing_length) { + queueing_length = tmp_length; + } + + + } + + } + } + + + //Experimental + double tmp_length2 = 0.0; + + for (MSLane::VehCont::const_iterator veh = lane.myVehicles.begin(); veh != lane.myVehicles.end(); ++veh) { + + //wenn Fahrzeug langsamer als 5 km/h fährt = Rückstau + double threshold_velocity = 5 / 3.6; + const MSVehicle& veh_tmp = **veh; + if (veh_tmp.isOnRoad()) { + + if (veh_tmp.getSpeed() < (threshold_velocity) && (veh_tmp.getPositionOnLane() > (veh_tmp.getLane()->getLength()) * 0.25)) + + { + tmp_length2 = (lane.getLength() - veh_tmp.getPositionOnLane()) + veh_tmp.getVehicleType().getLengthWithGap(); + } + if (tmp_length2 > queueing_length2) { + queueing_length2 = tmp_length2; + } + + } + } + + } + + //Output + if (queueing_length > 1 || queueing_length2 > 1) { + of.openTag("lane") << " id=\"" << lane.getID() << "\""; + of << " queueing_time=\"" << queueing_time << "\" queueing_length=\"" << queueing_length << "\" queueing_length_experimental=\"" << queueing_length2 << "\""; + of.closeTag(true); + } + +} + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSQueueExport.h sumo-0.16.0~dfsg/src/microsim/output/MSQueueExport.h --- sumo-0.15.0~dfsg/src/microsim/output/MSQueueExport.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSQueueExport.h 2012-12-02 13:39:49.000000000 +0000 @@ -0,0 +1,88 @@ +/****************************************************************************/ +/// @file MSQueueExport.h +/// @author Mario Krumnow +/// +// Export the queueing length in front of a junction (very experimental!) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSQueueExport_h +#define MSQueueExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSQueueExport + * @brief Export the queueing length in front of a junction (very experimental!) + * + * The class offers a static method, which writes the actual queueing length of + * the network into the given OutputDevice. + * + * @todo consider error-handling on write (using IOError) + */ +class MSQueueExport { +public: + /** @brief Export the queueing length in front of a junction (very experimental!) + * + * Opens the current time step, goes through the lanes check for a traffic jam in front of a junction + * + * @param[in] of The output device to use + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + + +private: + /// @brief Invalidated copy constructor. + MSQueueExport(const MSQueueExport&); + + /// @brief Invalidated assignment operator. + MSQueueExport& operator=(const MSQueueExport&); + + /// @brief Iterates through all the edges and extract the lanes + static void writeEdge(OutputDevice& of); + + /// @brief Iterates through the lanes and check for available vehicle queues + static void writeLane(OutputDevice& of, const MSLane& lane); + +}; + + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSRouteProbe.cpp sumo-0.16.0~dfsg/src/microsim/output/MSRouteProbe.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSRouteProbe.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSRouteProbe.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Tino Morenz /// @date Thu, 04.12.2008 -/// @version $Id: MSRouteProbe.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSRouteProbe.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Writes route distributions at a certain edge /****************************************************************************/ @@ -38,7 +38,7 @@ #include #include #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #endif @@ -57,10 +57,10 @@ const std::string distID = id + "_" + toString(begin); myCurrentRouteDistribution = MSRoute::distDictionary(distID); if (myCurrentRouteDistribution == 0) { - myCurrentRouteDistribution = new RandomDistributor(); + myCurrentRouteDistribution = new RandomDistributor(MSRoute::getMaxRouteDistSize(), &MSRoute::releaseRoute); MSRoute::dictionary(distID, myCurrentRouteDistribution); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* seg = MSGlobals::gMesoNet->getSegmentForEdge(*edge); while (seg != 0) { @@ -95,8 +95,8 @@ SUMOTime startTime, SUMOTime stopTime) { if (myCurrentRouteDistribution->getOverallProb() > 0) { dev.openTag("routeDistribution") << " id=\"" << getID() + "_" + time2string(startTime) << "\">\n"; - const std::vector &routes = myCurrentRouteDistribution->getVals(); - const std::vector &probs = myCurrentRouteDistribution->getProbs(); + const std::vector& routes = myCurrentRouteDistribution->getVals(); + const std::vector& probs = myCurrentRouteDistribution->getProbs(); for (unsigned int j = 0; j < routes.size(); ++j) { const MSRoute* r = routes[j]; dev.openTag("route") << " id=\"" << r->getID() + "_" + time2string(startTime) << "\" edges=\""; @@ -110,7 +110,7 @@ dev.closeTag(true); } dev.closeTag(); - myCurrentRouteDistribution = new RandomDistributor(); + myCurrentRouteDistribution = new RandomDistributor(MSRoute::getMaxRouteDistSize(), &MSRoute::releaseRoute); MSRoute::dictionary(getID() + "_" + toString(stopTime), myCurrentRouteDistribution); } } diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSRouteProbe.h sumo-0.16.0~dfsg/src/microsim/output/MSRouteProbe.h --- sumo-0.15.0~dfsg/src/microsim/output/MSRouteProbe.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSRouteProbe.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Tino Morenz /// @date Thu, 04.12.2008 -/// @version $Id: MSRouteProbe.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSRouteProbe.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Writes route distributions at a certain edge /****************************************************************************/ @@ -75,11 +75,11 @@ */ MSRouteProbe(const std::string& id, const MSEdge* edge, - SUMOTime begin) ; + SUMOTime begin); /// @brief Destructor - virtual ~MSRouteProbe() ; + virtual ~MSRouteProbe(); /// @name Methods inherited from MSMoveReminder @@ -96,7 +96,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /// @} @@ -132,7 +132,7 @@ private: /// @brief The current distribution of routes (probability->route) - RandomDistributor *myCurrentRouteDistribution; + RandomDistributor* myCurrentRouteDistribution; private: diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSVTKExport.cpp sumo-0.16.0~dfsg/src/microsim/output/MSVTKExport.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSVTKExport.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSVTKExport.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,253 @@ +/****************************************************************************/ +/// @file MSVTKExport.cpp +/// @author Mario Krumnow +/// @version $Id: MSVTKExport.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Realises VTK Export +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include "MSVTKExport.h" + +#ifdef HAVE_MESOSIM +#include +#include +#endif + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +void +MSVTKExport::write(OutputDevice& of, SUMOTime /* timestep */) { + + of.openTag("?xml") << " version=\"1.0\" encoding=\"UTF-8\" ?>\n"; + of.openTag("VTKFile") << " type=\"PolyData\" version=\"0.1\" order=\"LittleEndian\" >\n"; + of.openTag("PolyData") << ">\n"; + + std::vector speed = getSpeed(); + std::vector points = getPositions(); + + + of.openTag("Piece") << " NumberOfPoints=\"" << speed.size() << + "\" NumberOfVerts=\"1\" NumberOfLines=\"0\" NumberOfStrips=\"0\" NumberOfPolys=\"0\">\n"; + + of.openTag("PointData") << ">\n"; + of.openTag("DataArray") << " type=\"Float64\" Name=\"speed\" format=\"ascii\" >" << List2String(getSpeed()); + of.closeTag(); + + //close PointData + of.closeTag(); + + of.openTag("CellData"); + + //close CellData + of.closeTag(true); + + of.openTag("Points") << ">\n"; + of.openTag("DataArray") << " type=\"Float64\" Name=\"Points\" NumberOfComponents=\"3\" format=\"ascii\" >" << List2String(getPositions()); + of.closeTag(); + + //close Points + of.closeTag(); + + of.openTag("Verts") << ">\n"; + of.openTag("DataArray") << " type=\"Int64\" Name=\"connectivity\" format=\"ascii\" >" << getOffset((int) speed.size()); + of.closeTag(); + + of.openTag("DataArray") << " type=\"Int64\" Name=\"offsets\" format=\"ascii\" >" << speed.size(); + of.closeTag(); + + //Close Verts + of.closeTag(); + + of.openTag("Lines") << ">\n"; + of.openTag("DataArray") << " type=\"Int64\" Name=\"connectivity\" format=\"ascii\""; + of.closeTag(true); + + of.openTag("DataArray") << " type=\"Int64\" Name=\"offsets\" format=\"ascii\""; + of.closeTag(true); + + //Close Lines + of.closeTag(); + + of.openTag("Strips") << ">\n"; + of.openTag("DataArray") << " type=\"Int64\" Name=\"connectivity\" format=\"ascii\""; + of.closeTag(true); + + of.openTag("DataArray") << " type=\"Int64\" Name=\"offsets\" format=\"ascii\""; + of.closeTag(true); + + //Close Strips + of.closeTag(); + + of.openTag("Polys") << ">\n"; + of.openTag("DataArray") << " type=\"Int64\" Name=\"connectivity\" format=\"ascii\""; + of.closeTag(true); + + of.openTag("DataArray") << " type=\"Int64\" Name=\"offsets\" format=\"ascii\""; + of.closeTag(true); + + //close Polys + of.closeTag(); + + //close Piece + of.closeTag(); + + //close PolyData + of.closeTag(); + + //close VTKFile + of.closeTag(); + +} + +std::vector +MSVTKExport::getSpeed() { + + std::vector output; + + MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + MSVehicleControl::constVehIt it = vc.loadedVehBegin(); + MSVehicleControl::constVehIt end = vc.loadedVehEnd(); + + + for (; it != end; ++it) { + const MSVehicle* veh = static_cast((*it).second); + + if (veh->isOnRoad()) { + + Position pos = veh->getLane()->getShape().positionAtLengthPosition(veh->getPositionOnLane()); + output.push_back(veh->getSpeed() * 3.6); + } + + } + + return output; +} + +std::vector +MSVTKExport::getPositions() { + + std::vector output; + + MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + MSVehicleControl::constVehIt it = vc.loadedVehBegin(); + MSVehicleControl::constVehIt end = vc.loadedVehEnd(); + + + for (; it != end; ++it) { + const MSVehicle* veh = static_cast((*it).second); + + if (veh->isOnRoad()) { + + output.push_back(veh->getPosition().x()); + output.push_back(veh->getPosition().y()); + output.push_back(veh->getPosition().z()); + + } + + } + + return output; +} + +std::string +MSVTKExport::List2String(std::vector input) { + + std::string output = ""; + for (unsigned i = 0; i < input.size(); i++) { + + std::stringstream ss; + + //for a high precision + ss.precision(::std::numeric_limits::digits10); + ss.unsetf(::std::ios::dec); + ss.setf(::std::ios::scientific); + + ss << input[i] << " "; + output += ss.str(); + } + + return trim(output); +} + +std::string +MSVTKExport::getOffset(int nr) { + + std::string output = ""; + for (int i = 0; i < nr; i++) { + + std::stringstream ss; + ss << i << " "; + output += ss.str(); + } + + return trim(output); +} + +bool +MSVTKExport::ctype_space(const char c) { + if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == 11) { + return true; + } + return false; +} + +std::string +MSVTKExport::trim(std::string istring) { + bool trimmed = false; + + if (ctype_space(istring[istring.length() - 1])) { + istring.erase(istring.length() - 1); + trimmed = true; + } + + if (ctype_space(istring[0])) { + istring.erase(0, 1); + trimmed = true; + } + + if (!trimmed) { + return istring; + } else { + return trim(istring); + } + +} + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSVTKExport.h sumo-0.16.0~dfsg/src/microsim/output/MSVTKExport.h --- sumo-0.15.0~dfsg/src/microsim/output/MSVTKExport.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSVTKExport.h 2012-12-02 13:39:48.000000000 +0000 @@ -0,0 +1,192 @@ +/****************************************************************************/ +/// @file MSVTKExport.h +/// @author Mario Krumnow +/// +// Produce a VTK output to use with Tools like ParaView +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSVTKExport_h +#define MSVTKExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSVTKExport + * @brief Produce a VTK output to use with Tools like ParaView + * + * The class offers a static method, which writes VTK Files for each timestep + * of the simulation, where at least one vehicle is present. + * + * @todo + */ +class MSVTKExport { +public: + /** @brief Produce a VTK output to use with Tools like ParaView + * + * @param[in] of The output device to use + * @param[in] ec The EdgeControl which holds the edges to write + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + +private: + /// @brief Invalidated copy constructor. + MSVTKExport(const MSVTKExport&); + + /// @brief Invalidated assignment operator. + MSVTKExport& operator=(const MSVTKExport&); + + /// @brief Deletes the whitespaces at the end of a String + static std::string trim(std::string istring); + + /// @brief Checks if there is a whitespace + static bool ctype_space(const char c); + + /// @brief Get a comma separated String from a Vector + static std::string List2String(std::vector input); + + /// @brief Get a Vector with the speed values of each vehicle in the actual timestep + static std::vector getSpeed(); + + /// @brief Get a Vector of the Positions (x,y,z) of each vehicle in the actual timestep + static std::vector getPositions(); + + /// @brief Get a String with the indexes of all vehicles (needed in the VTk File) + static std::string getOffset(int nr); + +}; + + +#endif + +/****************************************************************************/ +/****************************************************************************/ +/// @file MSVTKExport.h +/// @author Mario Krumnow +/// +// Produce a VTK output to use with Tools like ParaView +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef MSVTKExport_h +#define MSVTKExport_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class MSEdgeControl; +class MSEdge; +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSVTKExport + * @brief Produce a VTK output to use with Tools like ParaView + * + * The class offers a static method, which writes VTK Files for each timestep + * of the simulation, where at least one vehicle is present. + * + * @todo + */ +class MSVTKExport { +public: + /** @brief Produce a VTK output to use with Tools like ParaView + * + * @param[in] of The output device to use + * @param[in] ec The EdgeControl which holds the edges to write + * @param[in] timestep The current time step + * @exception IOError If an error on writing occurs (!!! not yet implemented) + */ + static void write(OutputDevice& of, SUMOTime timestep); + +private: + /// @brief Invalidated copy constructor. + MSVTKExport(const MSVTKExport&); + + /// @brief Invalidated assignment operator. + MSVTKExport& operator=(const MSVTKExport&); + + /// @brief Deletes the whitespaces at the end of a String + static std::string trim(std::string istring); + + /// @brief Checks if there is a whitespace + static bool ctype_space(const char c); + + /// @brief Get a comma separated String from a Vector + static std::string List2String(std::vector input); + + /// @brief Get a Vector with the speed values of each vehicle in the actual timestep + static std::vector getSpeed(); + + /// @brief Get a Vector of the Positions (x,y,z) of each vehicle in the actual timestep + static std::vector getPositions(); + + /// @brief Get a String with the indexes of all vehicles (needed in the VTk File) + static std::string getOffset(int nr); + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MSXMLRawOut.cpp sumo-0.16.0~dfsg/src/microsim/output/MSXMLRawOut.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MSXMLRawOut.cpp 2012-02-16 15:57:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MSXMLRawOut.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Bjoern Hendriks /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSXMLRawOut.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSXMLRawOut.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Realises dumping the complete network state /****************************************************************************/ @@ -32,7 +32,6 @@ #include #endif -#include #include #include #include @@ -42,7 +41,7 @@ #include #include "MSXMLRawOut.h" -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #endif @@ -59,7 +58,7 @@ MSXMLRawOut::write(OutputDevice& of, const MSEdgeControl& ec, SUMOTime timestep) { of.openTag("timestep") << " time=\"" << time2string(timestep) << "\">\n"; - const std::vector &edges = ec.getEdges(); + const std::vector& edges = ec.getEdges(); for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { writeEdge(of, **e); } @@ -72,7 +71,7 @@ //en bool dump = !MSGlobals::gOmitEmptyEdgesOnDump; if (!dump) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* seg = MSGlobals::gMesoNet->getSegmentForEdge(edge); while (seg != 0) { @@ -84,21 +83,21 @@ } } else { #endif - const std::vector &lanes = edge.getLanes(); + const std::vector& lanes = edge.getLanes(); for (std::vector::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) { if (((**lane).getVehicleNumber() != 0)) { dump = true; break; } } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif } //en if (dump) { of.openTag("edge") << " id=\"" << edge.getID() << "\">\n"; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* seg = MSGlobals::gMesoNet->getSegmentForEdge(edge); while (seg != 0) { @@ -107,11 +106,11 @@ } } else { #endif - const std::vector &lanes = edge.getLanes(); + const std::vector& lanes = edge.getLanes(); for (std::vector::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) { writeLane(of, **lane); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif of.closeTag(); diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp sumo-0.16.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp --- sumo-0.15.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp 2012-02-16 15:57:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Oct 2003 -/// @version $Id: MS_E2_ZS_CollectorOverLanes.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MS_E2_ZS_CollectorOverLanes.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A detector which joins E2Collectors over consecutive lanes (backward) /****************************************************************************/ @@ -29,6 +29,7 @@ #include #endif +#include #include #include #include "MS_E2_ZS_CollectorOverLanes.h" @@ -110,7 +111,7 @@ if (predeccessors.size() == 0) { int off = 1; MSEdge& e = toExtend->getEdge(); - const std::vector &lanes = e.getLanes(); + const std::vector& lanes = e.getLanes(); int idx = (int) distance(lanes.begin(), find(lanes.begin(), lanes.end(), toExtend)); while (predeccessors.size() == 0) { if (idx - off >= 0) { @@ -168,7 +169,7 @@ MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(MSLane* l) { std::string eid = l->getEdge().getID(); // get predecessing edges - const std::vector &predEdges = l->getEdge().getIncomingEdges(); + const std::vector& predEdges = l->getEdge().getIncomingEdges(); std::vector ret; // find predecessing lanes std::vector::const_iterator i = predEdges.begin(); diff -Nru sumo-0.15.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h sumo-0.16.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h --- sumo-0.15.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h 2012-09-25 22:01:36.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Oct 2003 -/// @version $Id: MS_E2_ZS_CollectorOverLanes.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: MS_E2_ZS_CollectorOverLanes.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A detector which joins E2Collectors over consecutive lanes (backward) /****************************************************************************/ @@ -82,7 +82,7 @@ MS_E2_ZS_CollectorOverLanes(const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /** @brief Builds the consecutive E2 detectors @@ -93,24 +93,24 @@ * @param[in] lane The lane the detector starts at * @param[in] startPos Begin position of the detector */ - void init(MSLane* lane, SUMOReal detLength) ; + void init(MSLane* lane, SUMOReal detLength); /// @brief Destructor - virtual ~MS_E2_ZS_CollectorOverLanes() ; + virtual ~MS_E2_ZS_CollectorOverLanes(); /** @brief Returns this detector's id * @return The id of this detector */ - const std::string& getID() const ; + const std::string& getID() const; /** @brief Returns the id of the lane this detector starts at * @return The id of the lane this detector starts at * @todo Check whether this is needed */ - const std::string& getStartLaneID() const ; + const std::string& getStartLaneID() const; @@ -155,7 +155,7 @@ * @param[in] length !!! * @todo Describe length's usage */ - void extendTo(SUMOReal length) ; + void extendTo(SUMOReal length); /** @brief Builds an id for one of the E2 collectors this detector uses @@ -166,7 +166,7 @@ * @todo Describe! */ std::string makeID(const std::string& baseID, - size_t c, size_t r) const ; + size_t c, size_t r) const; /** @brief Builds a single collector @@ -178,7 +178,7 @@ * @todo Describe! */ virtual MSE2Collector* buildCollector(size_t c, size_t r, - MSLane* l, SUMOReal start, SUMOReal end) ; + MSLane* l, SUMOReal start, SUMOReal end); /** @brief Returns the list of lanes predecessing the given one @@ -186,7 +186,7 @@ * @param[in] l The lane to return predecessors of * @return List of lanes predecessing the given one */ - std::vector getLanePredeccessorLanes(MSLane* l) ; + std::vector getLanePredeccessorLanes(MSLane* l); protected: /// @brief The position the collector starts at diff -Nru sumo-0.15.0~dfsg/src/microsim/output/Makefile.am sumo-0.16.0~dfsg/src/microsim/output/Makefile.am --- sumo-0.15.0~dfsg/src/microsim/output/Makefile.am 2011-09-12 23:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/Makefile.am 2012-09-25 22:01:36.000000000 +0000 @@ -15,4 +15,9 @@ MSMeanData_Net.cpp MSMeanData_Net.h \ MSRouteProbe.cpp MSRouteProbe.h \ MSVTypeProbe.cpp MSVTypeProbe.h \ -MSXMLRawOut.cpp MSXMLRawOut.h +MSXMLRawOut.cpp MSXMLRawOut.h \ +MSFCDExport.cpp MSFCDExport.h \ +MSEmissionExport.cpp MSEmissionExport.h \ +MSVTKExport.cpp MSVTKExport.h \ +MSFullExport.cpp MSFullExport.h \ +MSQueueExport.cpp MSQueueExport.h diff -Nru sumo-0.15.0~dfsg/src/microsim/output/Makefile.in sumo-0.16.0~dfsg/src/microsim/output/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/output/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/output/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -55,7 +55,10 @@ MSInstantInductLoop.$(OBJEXT) MSMeanData.$(OBJEXT) \ MSMeanData_Harmonoise.$(OBJEXT) MSMeanData_HBEFA.$(OBJEXT) \ MSMeanData_Net.$(OBJEXT) MSRouteProbe.$(OBJEXT) \ - MSVTypeProbe.$(OBJEXT) MSXMLRawOut.$(OBJEXT) + MSVTypeProbe.$(OBJEXT) MSXMLRawOut.$(OBJEXT) \ + MSFCDExport.$(OBJEXT) MSEmissionExport.$(OBJEXT) \ + MSVTKExport.$(OBJEXT) MSFullExport.$(OBJEXT) \ + MSQueueExport.$(OBJEXT) libmicrosimoutput_a_OBJECTS = $(am_libmicrosimoutput_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -106,6 +109,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -136,6 +140,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -170,6 +175,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -203,7 +209,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -239,7 +244,12 @@ MSMeanData_Net.cpp MSMeanData_Net.h \ MSRouteProbe.cpp MSRouteProbe.h \ MSVTypeProbe.cpp MSVTypeProbe.h \ -MSXMLRawOut.cpp MSXMLRawOut.h +MSXMLRawOut.cpp MSXMLRawOut.h \ +MSFCDExport.cpp MSFCDExport.h \ +MSEmissionExport.cpp MSEmissionExport.h \ +MSVTKExport.cpp MSVTKExport.h \ +MSFullExport.cpp MSFullExport.h \ +MSQueueExport.cpp MSQueueExport.h all: all-am @@ -292,13 +302,18 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDetectorControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSE2Collector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSE3Collector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEmissionExport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFCDExport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSFullExport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSInductLoop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSInstantInductLoop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMeanData.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMeanData_HBEFA.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMeanData_Harmonoise.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMeanData_Net.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSQueueExport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRouteProbe.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVTKExport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSVTypeProbe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSXMLRawOut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MS_E2_ZS_CollectorOverLanes.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: MSActuatedTrafficLightLogic.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSActuatedTrafficLightLogic.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An actuated (adaptive) traffic light logic /****************************************************************************/ @@ -32,6 +32,7 @@ #include #endif +#include #include #include #include @@ -55,27 +56,27 @@ MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, const Phases& phases, - unsigned int step, SUMOTime delay, const std::map ¶meter) + unsigned int step, SUMOTime delay, const std::map& parameter) : MSSimpleTrafficLightLogic(tlcontrol, id, programID, phases, step, delay), myContinue(false) { myMaxGap = SUMOReal(3.1); if (parameter.find("max-gap") != parameter.end()) { - myMaxGap = TplConvert::_2SUMOReal(parameter.find("max-gap")->second.c_str()); + myMaxGap = TplConvert::_2SUMOReal(parameter.find("max-gap")->second.c_str()); } myPassingTime = SUMOReal(1.9); if (parameter.find("passing-time") != parameter.end()) { - myPassingTime = TplConvert::_2SUMOReal(parameter.find("passing-time")->second.c_str()); + myPassingTime = TplConvert::_2SUMOReal(parameter.find("passing-time")->second.c_str()); } myDetectorGap = SUMOReal(3.0); if (parameter.find("detector-gap") != parameter.end()) { - myDetectorGap = TplConvert::_2SUMOReal(parameter.find("detector-gap")->second.c_str()); + myDetectorGap = TplConvert::_2SUMOReal(parameter.find("detector-gap")->second.c_str()); } } void MSActuatedTrafficLightLogic::init(NLDetectorBuilder& nb) { - SUMOReal det_offset = TplConvert::_2SUMOReal(myParameter.find("detector_offset")->second.c_str()); + SUMOReal det_offset = TplConvert::_2SUMOReal(myParameter.find("detector_offset")->second.c_str()); // change values for setting the loops and lanestate-detectors, here //SUMOTime inductLoopInterval = 1; // LaneVectorVector::const_iterator i2; @@ -86,7 +87,7 @@ for (i = lanes.begin(); i != lanes.end(); i++) { MSLane* lane = (*i); SUMOReal length = lane->getLength(); - SUMOReal speed = lane->getMaxSpeed(); + SUMOReal speed = lane->getSpeedLimit(); SUMOReal inductLoopPosition = myDetectorGap * speed; // check whether the lane is long enough SUMOReal ilpos = length - inductLoopPosition; @@ -156,7 +157,7 @@ const std::string& state = getCurrentPhaseDef().getState(); for (unsigned int i = 0; i < (unsigned int) state.size(); i++) { if (state[i] == LINKSTATE_TL_GREEN_MAJOR || state[i] == LINKSTATE_TL_GREEN_MINOR) { - const std::vector &lanes = getLanesAt(i); + const std::vector& lanes = getLanesAt(i); if (lanes.empty()) { break; } @@ -198,7 +199,7 @@ const std::string& state = getCurrentPhaseDef().getState(); for (unsigned int i = 0; i < (unsigned int) state.size(); i++) { if (state[i] == LINKSTATE_TL_GREEN_MAJOR || state[i] == LINKSTATE_TL_GREEN_MINOR) { - const std::vector &lanes = getLanesAt(i); + const std::vector& lanes = getLanesAt(i); if (lanes.empty()) { break; } diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSActuatedTrafficLightLogic.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSActuatedTrafficLightLogic.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An actuated (adaptive) traffic light logic /****************************************************************************/ @@ -74,7 +74,7 @@ const std::string& id, const std::string& programID, const MSSimpleTrafficLightLogic::Phases& phases, unsigned int step, SUMOTime delay, - const std::map ¶meter); + const std::map& parameter); /** @brief Initialises the tls with information about incoming lanes diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp 2012-02-16 15:57:37.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Wed, 01. Oct 2003 -/// @version $Id: MSAgentbasedTrafficLightLogic.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSAgentbasedTrafficLightLogic.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An agentbased traffic light logic /****************************************************************************/ @@ -32,6 +32,7 @@ #include #endif +#include #include #include #include @@ -54,32 +55,32 @@ MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, const Phases& phases, unsigned int step, SUMOTime delay, - const std::map ¶meter) + const std::map& parameter) : MSSimpleTrafficLightLogic(tlcontrol, id, programID, phases, step, delay), tSinceLastDecision(0), stepOfLastDecision(0) { tDecide = 1; if (parameter.find("decision-horizon") != parameter.end()) { - tDecide = (unsigned int) TplConvert::_2int(parameter.find("decision-horizon")->second.c_str()); + tDecide = (unsigned int) TplConvert::_2int(parameter.find("decision-horizon")->second.c_str()); } numberOfValues = 3; if (parameter.find("learn-horizon") != parameter.end()) { - numberOfValues = (unsigned int) TplConvert::_2int(parameter.find("learn-horizon")->second.c_str()); + numberOfValues = (unsigned int) TplConvert::_2int(parameter.find("learn-horizon")->second.c_str()); } tCycle = 90; if (parameter.find("tcycle") != parameter.end()) { - tCycle = (unsigned int) TplConvert::_2SUMOReal(parameter.find("tcycle")->second.c_str()); + tCycle = (unsigned int) TplConvert::_2SUMOReal(parameter.find("tcycle")->second.c_str()); } deltaLimit = 1; if (parameter.find("min-diff") != parameter.end()) { - deltaLimit = TplConvert::_2int(parameter.find("min-diff")->second.c_str()); + deltaLimit = TplConvert::_2int(parameter.find("min-diff")->second.c_str()); } } void MSAgentbasedTrafficLightLogic::init(NLDetectorBuilder& nb) { - SUMOReal det_offset = TplConvert::_2SUMOReal(myParameter.find("detector_offset")->second.c_str()); + SUMOReal det_offset = TplConvert::_2SUMOReal(myParameter.find("detector_offset")->second.c_str()); LaneVectorVector::const_iterator i2; LaneVector::const_iterator i; // build the detectors @@ -185,7 +186,7 @@ for (unsigned int i = 0; i < (unsigned int) state.size(); i++) { // finds the maximum QUEUE_LENGTH_AHEAD_OF_TRAFFIC_LIGHTS_IN_VEHICLES of all lanes that have green if (state[i] == LINKSTATE_TL_GREEN_MAJOR || state[i] == LINKSTATE_TL_GREEN_MINOR) { - const std::vector &lanes = getLanesAt(i); + const std::vector& lanes = getLanesAt(i); if (lanes.empty()) { break; } diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 01. Oct 2003 -/// @version $Id: MSAgentbasedTrafficLightLogic.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSAgentbasedTrafficLightLogic.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An agentbased traffic light logic /****************************************************************************/ @@ -39,7 +39,6 @@ #include "MSTrafficLightLogic.h" #include "MSSimpleTrafficLightLogic.h" #include -#include "MSSimpleTrafficLightLogic.h" // =========================================================================== @@ -86,7 +85,7 @@ const std::string& id, const std::string& programID, const MSSimpleTrafficLightLogic::Phases& phases, unsigned int step, SUMOTime delay, - const std::map ¶meter); + const std::map& parameter); /** @brief Initialises the tls with information about incoming lanes diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2012-09-25 22:01:38.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 08.05.2007 -/// @version $Id: MSOffTrafficLightLogic.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSOffTrafficLightLogic.cpp 12381 2012-06-08 09:28:48Z dkrajzew $ /// // A traffic lights logic which represents a tls in an off-mode /****************************************************************************/ @@ -28,7 +28,6 @@ #include #endif -#include #include #include #include diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2012-03-13 12:52:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSSimpleTrafficLightLogic.cpp 12075 2012-03-13 09:05:31Z namdre $ +/// @version $Id: MSSimpleTrafficLightLogic.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A fixed traffic light logic /****************************************************************************/ @@ -199,7 +199,7 @@ } -void +void MSSimpleTrafficLightLogic::setPhases(const Phases& phases, unsigned int step) { assert(step < phases.size()); deletePhases(); @@ -208,7 +208,7 @@ } -void +void MSSimpleTrafficLightLogic::deletePhases() { for (size_t i = 0; i < myPhases.size(); i++) { delete myPhases[i]; diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.cpp sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.cpp --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -8,7 +8,7 @@ /// @author Michael Behrisch /// @author Sascha Krieg /// @date Sept 2002 -/// @version $Id: MSTLLogicControl.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTLLogicControl.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A class that stores and controls tls and switching of their programs /****************************************************************************/ @@ -224,7 +224,7 @@ if (val.length() == 0) { return 0; } - return TplConvert::_2int(val.c_str()); + return TplConvert::_2int(val.c_str()); } @@ -379,10 +379,10 @@ int areasNo = getStretchAreaNo(myTo); for (int i = 0; i < areasNo; i++) { StretchBereichDef def = getStretchBereichDef(myTo, i + 1); - assert(def.end >= def.begin) ; + assert(def.end >= def.begin); deltaPossible += TIME2STEPS(def.end - def.begin); } - int stretchUmlaufAnz = (int) TplConvert::_2SUMOReal(myTo->getParameterValue("StretchUmlaufAnz").c_str()); + int stretchUmlaufAnz = (int) TplConvert::_2SUMOReal(myTo->getParameterValue("StretchUmlaufAnz").c_str()); deltaPossible = stretchUmlaufAnz * deltaPossible; if ((deltaPossible > deltaToCut) && (deltaToCut < (cycleTime / 2))) { cutLogic(step, gspTo, deltaToCut); @@ -447,7 +447,7 @@ SUMOTime durOfPhase = myTo->getPhase(currStep).duration; SUMOTime remainingStretchTime = allStretchTime; SUMOTime StretchTimeOfPhase = 0; - unsigned int stretchUmlaufAnz = (unsigned int) TplConvert::_2SUMOReal(myTo->getParameterValue("StretchUmlaufAnz").c_str()); + unsigned int stretchUmlaufAnz = (unsigned int) TplConvert::_2SUMOReal(myTo->getParameterValue("StretchUmlaufAnz").c_str()); SUMOReal facSum = 0; int areasNo = getStretchAreaNo(myTo); for (int x = 0; x < areasNo; x++) { @@ -466,10 +466,14 @@ SUMOReal fac = def.fac; SUMOReal actualfac = fac / facSum; facSum = facSum - fac; - StretchTimeOfPhase = TIME2STEPS(STEPS2TIME(remainingStretchTime) * actualfac + 0.5); + StretchTimeOfPhase = TIME2STEPS(int(STEPS2TIME(remainingStretchTime) * actualfac + 0.5)); remainingStretchTime = allStretchTime - StretchTimeOfPhase; } } + if (facSum == 0) { + WRITE_WARNING("The computed factor sum in WAUT '" + myWAUT.id + "' at time '" + toString(STEPS2TIME(step)) + "' equals zero;\n assuming an error in WAUT definition."); + return; + } durOfPhase = durOfPhase - diffToStart + StretchTimeOfPhase; myTo->changeStepAndDuration(myControl, step, currStep, durOfPhase); @@ -486,7 +490,7 @@ SUMOReal fac = def.fac; if ((beginOfPhase <= end) && (endOfPhase >= end)) { SUMOReal actualfac = fac / facSum; - StretchTimeOfPhase = TIME2STEPS(STEPS2TIME(remainingStretchTime) * actualfac + 0.5); + StretchTimeOfPhase = TIME2STEPS(int(STEPS2TIME(remainingStretchTime) * actualfac + 0.5)); facSum -= fac; durOfPhase += StretchTimeOfPhase; remainingStretchTime -= StretchTimeOfPhase; @@ -511,9 +515,9 @@ MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(MSTrafficLightLogic* from, int index) const { StretchBereichDef def; - def.begin = TplConvert::_2SUMOReal(from->getParameterValue("B" + toString(index) + ".begin").c_str()); - def.end = TplConvert::_2SUMOReal(from->getParameterValue("B" + toString(index) + ".end").c_str()); - def.fac = TplConvert::_2SUMOReal(from->getParameterValue("B" + toString(index) + ".factor").c_str()); + def.begin = TplConvert::_2SUMOReal(from->getParameterValue("B" + toString(index) + ".begin").c_str()); + def.end = TplConvert::_2SUMOReal(from->getParameterValue("B" + toString(index) + ".end").c_str()); + def.fac = TplConvert::_2SUMOReal(from->getParameterValue("B" + toString(index) + ".factor").c_str()); return def; } @@ -785,7 +789,7 @@ myCurrentlySwitched.push_back(p); } index++; - if (index == (int) myWAUTs[wautid]->switches.size()) { + if (index == static_cast(myWAUTs[wautid]->switches.size())) { return 0; } return myWAUTs[wautid]->switches[index].when - MSNet::getInstance()->getCurrentTimeStep(); diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.h sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.h --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTLLogicControl.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSTLLogicControl.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTLLogicControl.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A class that stores and controls tls and switching of their programs /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.cpp sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.cpp --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSTrafficLightLogic.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTrafficLightLogic.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The parent class for traffic light logics /****************************************************************************/ @@ -30,6 +30,7 @@ #include #endif +#include #include #include #include @@ -116,7 +117,8 @@ MSTrafficLightLogic::~MSTrafficLightLogic() { - mySwitchCommand->deschedule(this); + // no need to do something about mySwitchCommand here, + // it is handled by the event control } @@ -176,7 +178,7 @@ void -MSTrafficLightLogic::resetLinkStates(const std::map &vals) const { +MSTrafficLightLogic::resetLinkStates(const std::map& vals) const { for (LinkVectorVector::const_iterator i1 = myLinks.begin(); i1 != myLinks.end(); ++i1) { const LinkVector& l = (*i1); for (LinkVector::const_iterator i2 = l.begin(); i2 != l.end(); ++i2) { @@ -228,7 +230,7 @@ // ----------- Algorithm parameter handling void -MSTrafficLightLogic::setParameter(const std::map ¶ms) { +MSTrafficLightLogic::setParameter(const std::map& params) { myParameter = params; } diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.h sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.h --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSTrafficLightLogic.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTrafficLightLogic.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The parent class for traffic light logics /****************************************************************************/ @@ -135,7 +135,7 @@ /** @brief Resets the states of controlled links * @param[in] vals The state of controlled links to use */ - void resetLinkStates(const std::map &vals) const; + void resetLinkStates(const std::map& vals) const; /// @} @@ -334,7 +334,7 @@ /** @brief Inserts read parameter * @param[in] params The parameter to use */ - void setParameter(const std::map ¶ms); + void setParameter(const std::map& params); /** @brief Returns a named parameter diff -Nru sumo-0.15.0~dfsg/src/microsim/traffic_lights/Makefile.in sumo-0.16.0~dfsg/src/microsim/traffic_lights/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/traffic_lights/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/traffic_lights/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -104,6 +104,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -134,6 +135,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -168,6 +170,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -201,7 +204,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSBusStop.cpp sumo-0.16.0~dfsg/src/microsim/trigger/MSBusStop.cpp --- sumo-0.15.0~dfsg/src/microsim/trigger/MSBusStop.cpp 2012-02-15 00:02:39.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSBusStop.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MSBusStop.cpp /// @author Daniel Krajzewicz /// @date Mon, 13.12.2005 -/// @version $Id: MSBusStop.cpp 11889 2012-02-14 12:28:58Z dkrajzew $ +/// @version $Id: MSBusStop.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A lane area vehicles can halt at /****************************************************************************/ @@ -43,10 +43,10 @@ // method definitions // =========================================================================== MSBusStop::MSBusStop(const std::string& id, - const std::vector &lines, + const std::vector& lines, MSLane& lane, SUMOReal begPos, SUMOReal endPos) - : MSTrigger(id), myLines(lines), myLane(lane), + : Named(id), myLines(lines), myLane(lane), myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos) { computeLastFreePos(); } @@ -81,8 +81,8 @@ SUMOReal -MSBusStop::getLastFreePos(SUMOVehicle &forVehicle) const { - if(myLastFreePos!=myEndPos) { +MSBusStop::getLastFreePos(SUMOVehicle& forVehicle) const { + if (myLastFreePos != myEndPos) { return myLastFreePos - forVehicle.getVehicleType().getMinGap(); } return myLastFreePos; diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSBusStop.h sumo-0.16.0~dfsg/src/microsim/trigger/MSBusStop.h --- sumo-0.15.0~dfsg/src/microsim/trigger/MSBusStop.h 2012-02-15 00:02:42.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSBusStop.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MSBusStop.h /// @author Daniel Krajzewicz /// @date Mon, 13.12.2005 -/// @version $Id: MSBusStop.h 11889 2012-02-14 12:28:58Z dkrajzew $ +/// @version $Id: MSBusStop.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A lane area vehicles can halt at /****************************************************************************/ @@ -31,9 +31,10 @@ #endif #include +#include #include #include -#include "MSTrigger.h" +#include // =========================================================================== @@ -41,6 +42,7 @@ // =========================================================================== class MSLane; class SUMOVehicle; +class MSPerson; // =========================================================================== @@ -58,7 +60,7 @@ * Please note that using the last free space disallows vehicles to enter a * free space in between other vehicles. */ -class MSBusStop : public MSTrigger { +class MSBusStop : public Named { public: /** @brief Constructor * @@ -70,33 +72,33 @@ * @param[in] endPos End position of the bus stop on the lane */ MSBusStop(const std::string& id, - const std::vector &lines, MSLane& lane, - SUMOReal begPos, SUMOReal endPos) ; + const std::vector& lines, MSLane& lane, + SUMOReal begPos, SUMOReal endPos); /// @brief Destructor - virtual ~MSBusStop() ; + virtual ~MSBusStop(); /** @brief Returns the lane this bus stop is located at * * @return Reference to the lane the bus stop is located at */ - const MSLane& getLane() const ; + const MSLane& getLane() const; /** @brief Returns the begin position of this bus stop * * @return The position the bus stop begins at */ - SUMOReal getBeginLanePosition() const ; + SUMOReal getBeginLanePosition() const; /** @brief Returns the end position of this bus stop * * @return The position the bus stop ends at */ - SUMOReal getEndLanePosition() const ; + SUMOReal getEndLanePosition() const; /** @brief Called if a vehicle enters this stop @@ -110,7 +112,7 @@ * @param[in] what The end halting position of the vehicle * @see computeLastFreePos */ - void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) ; + void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end); /** @brief Called if a vehicle leaves this stop @@ -122,16 +124,33 @@ * @param[in] what The vehicle that leaves the bus stop * @see computeLastFreePos */ - void leaveFrom(SUMOVehicle* what) ; + void leaveFrom(SUMOVehicle* what); /** @brief Returns the last free position on this stop * * @return The last free position of this bus stop */ - SUMOReal getLastFreePos(SUMOVehicle &forVehicle) const ; + SUMOReal getLastFreePos(SUMOVehicle& forVehicle) const; + /** @brief Returns the number of persons waiting on this stop + */ + unsigned int getPersonNumber() const { + return static_cast(myWaitingPersons.size()); + } + + void addPerson(MSPerson* p) { + myWaitingPersons.push_back(p); + } + + void removePerson(MSPerson* p) { + std::vector::iterator i = std::find(myWaitingPersons.begin(), myWaitingPersons.end(), p); + if (i != myWaitingPersons.end()) { + myWaitingPersons.erase(i); + } + } + protected: /** @brief Computes the last free position on this stop * @@ -139,7 +158,7 @@ * It is stored in myLastFreePos. If no vehicle halts, the last free * position gets the value of myEndPos. */ - void computeLastFreePos() ; + void computeLastFreePos(); protected: @@ -161,6 +180,9 @@ /// @brief The last free position at this stop (variable) SUMOReal myLastFreePos; + /// @brief Persons waiting at this stop + std::vector myWaitingPersons; + private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.cpp sumo-0.16.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.cpp --- sumo-0.15.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2012-02-16 15:57:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: MSLaneSpeedTrigger.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSLaneSpeedTrigger.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Changes the speed allowed on a set of lanes /****************************************************************************/ @@ -45,7 +45,7 @@ #include #include "MSLaneSpeedTrigger.h" -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #include @@ -60,11 +60,16 @@ // method definitions // =========================================================================== MSLaneSpeedTrigger::MSLaneSpeedTrigger(const std::string& id, - const std::vector &destLanes, - const std::string& file) - : MSTrigger(id), SUMOSAXHandler(file), - myDestLanes(destLanes), myAmOverriding(false), myDidInit(false) { - myCurrentSpeed = destLanes[0]->getMaxSpeed(); + const std::vector& destLanes, + const std::string& file) : + MSTrigger(id), + SUMOSAXHandler(file), + myDestLanes(destLanes), + myCurrentSpeed(destLanes[0]->getSpeedLimit()), + myDefaultSpeed(destLanes[0]->getSpeedLimit()), + myAmOverriding(false), + mySpeedOverrideValue(destLanes[0]->getSpeedLimit()), + myDidInit(false) { if (file != "") { if (!XMLSubSys::runParser(*this, file)) { throw ProcessError(); @@ -85,8 +90,9 @@ // set the process to the begin myCurrentEntry = myLoadedSpeeds.begin(); // pass previous time steps - while ((*myCurrentEntry).first < MSNet::getInstance()->getCurrentTimeStep() && myCurrentEntry != myLoadedSpeeds.end()) { - processCommand(true, MSNet::getInstance()->getCurrentTimeStep()); + const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); + while ((*myCurrentEntry).first < now && myCurrentEntry != myLoadedSpeeds.end()) { + processCommand(true, now); } // add the processing to the event handler @@ -112,11 +118,11 @@ std::vector::iterator i; const SUMOReal speed = getCurrentSpeed(); for (i = myDestLanes.begin(); i != myDestLanes.end(); ++i) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* first = MSGlobals::gMesoNet->getSegmentForEdge((*i)->getEdge()); while (first != 0) { - first->setSpeed(speed, currentTime); + first->setSpeed(speed, currentTime, -1); first = first->getNextSegment(); } continue; @@ -156,8 +162,7 @@ return; } if (speed < 0) { - WRITE_ERROR("Wrong speed in vss '" + getID() + "'."); - return; + speed = myDefaultSpeed; } // set the values for the next step if they are valid if (myLoadedSpeeds.size() != 0 && myLoadedSpeeds.back().first == next) { @@ -212,14 +217,17 @@ if (myAmOverriding) { return mySpeedOverrideValue; } else { + const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); // ok, maybe the first shall not yet be the valid one - if (myCurrentEntry == myLoadedSpeeds.begin() && (*myCurrentEntry).first > MSNet::getInstance()->getCurrentTimeStep()) { + if (myCurrentEntry == myLoadedSpeeds.begin() && (*myCurrentEntry).first > now) { return myDefaultSpeed; } // try the loaded - if (myCurrentEntry != myLoadedSpeeds.end() && (*myCurrentEntry).first <= MSNet::getInstance()->getCurrentTimeStep()) { + if (myCurrentEntry != myLoadedSpeeds.end() && (*myCurrentEntry).first <= now) { return (*myCurrentEntry).second; } else { + // we have run past the end of the loaded steps or the current step is not yet active: + // -> use the value of the previous step return (*(myCurrentEntry - 1)).second; } } diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.h sumo-0.16.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.h --- sumo-0.15.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSLaneSpeedTrigger.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSLaneSpeedTrigger.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSLaneSpeedTrigger.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Changes the speed allowed on a set of lanes /****************************************************************************/ @@ -68,7 +68,7 @@ * @param[in] file Name of the file to read the speeds to set from */ MSLaneSpeedTrigger(const std::string& id, - const std::vector &destLanes, + const std::vector& destLanes, const std::string& file); diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTrigger.cpp sumo-0.16.0~dfsg/src/microsim/trigger/MSTrigger.cpp --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTrigger.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTrigger.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,50 @@ +/****************************************************************************/ +/// @file MSTrigger.cpp +/// @author Jakob Erdmann +/// @date Sept 2012 +/// @version $Id: MSTrigger.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// An abstract device that changes the state of the micro simulation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +// =========================================================================== +// included modules +// =========================================================================== +#include "MSTrigger.h" + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::set MSTrigger::myInstances; + + +// =========================================================================== +// method definitions +// =========================================================================== +MSTrigger::MSTrigger(const std::string& id) : + Named(id) { + myInstances.insert(this); +} + + +MSTrigger::~MSTrigger() { + myInstances.erase(this); +} + + +void MSTrigger::cleanup() { + while (!myInstances.empty()) { + delete *myInstances.begin(); + } +} diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTrigger.h sumo-0.16.0~dfsg/src/microsim/trigger/MSTrigger.h --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTrigger.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTrigger.h 2012-09-25 22:01:36.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: MSTrigger.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTrigger.h 12650 2012-09-03 10:29:05Z namdre $ /// // An abstract device that changes the state of the micro simulation /****************************************************************************/ @@ -31,6 +31,7 @@ #include #endif +#include #include @@ -50,12 +51,13 @@ * * @param[in] id The id of the trigger */ - MSTrigger(const std::string& id) : Named(id) { } - + MSTrigger(const std::string& id); /// @brief Destructor - virtual ~MSTrigger() { } + virtual ~MSTrigger(); + /// @brief properly deletes all trigger instances + static void cleanup(); private: /// @brief Invalidated copy constructor. @@ -64,6 +66,7 @@ /// @brief Invalidated assignment operator. MSTrigger& operator=(const MSTrigger&); + static std::set myInstances; }; diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredReader.cpp sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredReader.cpp --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredReader.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredReader.cpp 2012-10-10 23:02:23.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSTriggeredReader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTriggeredReader.cpp 12818 2012-10-10 08:33:30Z namdre $ /// // The basic class for classes that read triggers /****************************************************************************/ @@ -80,7 +80,7 @@ return 0; } } else { - // action could not been accomplished; try next time step + // action could not be accomplished; try next time step return DELTA_T; } } diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.cpp sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.cpp --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.cpp 2012-02-16 15:57:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 July 2005 -/// @version $Id: MSTriggeredRerouter.cpp 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSTriggeredRerouter.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Reroutes vehicles passing an edge /****************************************************************************/ @@ -51,7 +51,7 @@ #include #include "MSTriggeredRerouter.h" -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #endif @@ -62,18 +62,16 @@ // =========================================================================== -// method definitions +// static member defintion // =========================================================================== -bool MSTriggeredRerouter::myHaveWarnedAboutDeprecatedDestProbReroute = false; -bool MSTriggeredRerouter::myHaveWarnedAboutDeprecatedClosingReroute = false; -bool MSTriggeredRerouter::myHaveWarnedAboutDeprecatedRouteReroute = false; - +MSEdge MSTriggeredRerouter::mySpecialDest_keepDestination("MSTriggeredRerouter_keepDestination", -1, MSEdge::EDGEFUNCTION_UNKNOWN); +MSEdge MSTriggeredRerouter::mySpecialDest_terminateRoute("MSTriggeredRerouter_terminateRoute", -1, MSEdge::EDGEFUNCTION_UNKNOWN); // =========================================================================== // method definitions // =========================================================================== MSTriggeredRerouter::MSTriggeredRerouter(const std::string& id, - const std::vector &edges, + const std::vector& edges, SUMOReal prob, const std::string& file, bool off) : MSTrigger(id), MSMoveReminder(), SUMOSAXHandler(file), myProbability(prob), myUserProbability(prob), myAmInUserMode(false) { @@ -83,14 +81,14 @@ } // build actors for (std::vector::const_iterator j = edges.begin(); j != edges.end(); ++j) { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(**j); s->addDetector(this); continue; } #endif - const std::vector &destLanes = (*j)->getLanes(); + const std::vector& destLanes = (*j)->getLanes(); for (std::vector::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) { (*i)->addMoveReminder(this); } @@ -114,12 +112,7 @@ myCurrentIntervalBegin = attrs.getOptSUMOTimeReporting(SUMO_ATTR_BEGIN, 0, ok, -1); myCurrentIntervalEnd = attrs.getOptSUMOTimeReporting(SUMO_ATTR_END, 0, ok, -1); } - - if (element == SUMO_TAG_DEST_PROB_REROUTE__DEPRECATED && !myHaveWarnedAboutDeprecatedDestProbReroute) { - myHaveWarnedAboutDeprecatedDestProbReroute = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DEST_PROB_REROUTE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_DEST_PROB_REROUTE) + "'."); - } - if (element == SUMO_TAG_DEST_PROB_REROUTE || element == SUMO_TAG_DEST_PROB_REROUTE__DEPRECATED) { + if (element == SUMO_TAG_DEST_PROB_REROUTE) { // by giving probabilities of new destinations // get the destination edge std::string dest = attrs.getStringSecure(SUMO_ATTR_ID, ""); @@ -128,7 +121,13 @@ } MSEdge* to = MSEdge::dictionary(dest); if (to == 0) { - throw ProcessError("MSTriggeredRerouter " + getID() + ": Destination edge '" + dest + "' is not known."); + if (dest == "keepDestination") { + to = &mySpecialDest_keepDestination; + } else if (dest == "terminateRoute") { + to = &mySpecialDest_terminateRoute; + } else { + throw ProcessError("MSTriggeredRerouter " + getID() + ": Destination edge '" + dest + "' is not known."); + } } // get the probability to reroute bool ok = true; @@ -143,11 +142,7 @@ myCurrentEdgeProb.add(prob, to); } - if (element == SUMO_TAG_CLOSING_REROUTE__DEPRECATED && !myHaveWarnedAboutDeprecatedClosingReroute) { - myHaveWarnedAboutDeprecatedClosingReroute = true; - WRITE_WARNING("'" + toString(SUMO_TAG_CLOSING_REROUTE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_CLOSING_REROUTE) + "'."); - } - if (element == SUMO_TAG_CLOSING_REROUTE || element == SUMO_TAG_CLOSING_REROUTE) { + if (element == SUMO_TAG_CLOSING_REROUTE) { // by closing std::string closed_id = attrs.getStringSecure(SUMO_ATTR_ID, ""); if (closed_id == "") { @@ -160,11 +155,7 @@ myCurrentClosed.push_back(closed); } - if (element == SUMO_TAG_ROUTE_PROB_REROUTE__DEPRECATED && !myHaveWarnedAboutDeprecatedRouteReroute) { - myHaveWarnedAboutDeprecatedRouteReroute = true; - WRITE_WARNING("'" + toString(SUMO_TAG_ROUTE_PROB_REROUTE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_ROUTE_PROB_REROUTE) + "'."); - } - if (element == SUMO_TAG_ROUTE_PROB_REROUTE || element == SUMO_TAG_ROUTE_PROB_REROUTE__DEPRECATED) { + if (element == SUMO_TAG_ROUTE_PROB_REROUTE) { // by explicit rerouting using routes // check if route exists std::string routeStr = attrs.getStringSecure(SUMO_ATTR_ID, ""); @@ -217,7 +208,11 @@ const MSRoute& route = veh.getRoute(); while (i != myIntervals.end()) { if ((*i).begin <= time && (*i).end >= time) { - if ((*i).edgeProbs.getOverallProb() != 0 || (*i).routeProbs.getOverallProb() != 0 || route.containsAnyOf((*i).closed)) { + if ( + // affected by closingReroute, possibly combined with destProbReroute (route prob makes no sense) + route.containsAnyOf((*i).closed) || + // no closingReroute but destProbReroute or routeProbReroute + ((*i).closed.size() == 0 && (*i).edgeProbs.getOverallProb() + (*i).routeProbs.getOverallProb() > 0)) { return true; } } @@ -299,19 +294,30 @@ veh.replaceRoute(newRoute); return false; } + const MSEdge* newEdge = lastEdge; // ok, try using a new destination - const MSEdge* newEdge = rerouteDef.edgeProbs.getOverallProb() > 0 ? rerouteDef.edgeProbs.get() : route.getLastEdge(); - if (newEdge == 0) { - newEdge = lastEdge; + const bool destUnreachable = std::find(rerouteDef.closed.begin(), rerouteDef.closed.end(), lastEdge) != rerouteDef.closed.end(); + // if we have a closingReroute, only assign new destinations to vehicles which cannot reach their original destination + if (rerouteDef.closed.size() == 0 || destUnreachable) { + newEdge = rerouteDef.edgeProbs.getOverallProb() > 0 ? rerouteDef.edgeProbs.get() : route.getLastEdge(); + if (newEdge == &mySpecialDest_terminateRoute) { + newEdge = veh.getEdge(); + } else if (newEdge == &mySpecialDest_keepDestination || newEdge == lastEdge) { + if (destUnreachable) { + WRITE_WARNING("Cannot keep destination for vehicle '" + veh.getID() + "' due to closed edges. Terminating route."); + newEdge = veh.getEdge(); + } else { + newEdge = lastEdge; + } + } else if (newEdge == 0) { + assert(false); // this should never happen + newEdge = veh.getEdge(); + } } - // we have a new destination, let's replace the vehicle route - MSEdgeWeightsStorage empty; - MSNet::EdgeWeightsProxi proxi(empty, MSNet::getInstance()->getWeightsStorage()); - DijkstraRouterTT_ByProxi, MSNet::EdgeWeightsProxi> router(MSEdge::dictSize(), true, &proxi, &MSNet::EdgeWeightsProxi::getTravelTime); - router.prohibit(rerouteDef.closed); std::vector edges; - router.compute(veh.getEdge(), newEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edges); + MSNet::getInstance()->getRouterTT(rerouteDef.closed).compute( + veh.getEdge(), newEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edges); veh.replaceRouteEdges(edges); return false; } diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.h sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.h --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.h 2012-02-16 15:57:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredRerouter.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 July 2005 -/// @version $Id: MSTriggeredRerouter.h 11913 2012-02-16 15:05:59Z namdre $ +/// @version $Id: MSTriggeredRerouter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Reroutes vehicles passing an edge /****************************************************************************/ @@ -76,12 +76,12 @@ * @param[in] file The file to read the reroute definitions from */ MSTriggeredRerouter(const std::string& id, - const std::vector &edges, + const std::vector& edges, SUMOReal prob, const std::string& file, bool off); /** @brief Destructor */ - virtual ~MSTriggeredRerouter() ; + virtual ~MSTriggeredRerouter(); /** @@ -115,7 +115,7 @@ * @see MSMoveReminder::notifyEnter * @see MSMoveReminder::Notification */ - bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) ; + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); /// Returns whether a rerouting definition is valid for the given time and vehicle bool hasCurrentReroute(SUMOTime time, SUMOVehicle& veh) const; @@ -156,7 +156,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -165,7 +165,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} protected: @@ -191,9 +191,10 @@ RandomDistributor myCurrentRouteProb; //@} - static bool myHaveWarnedAboutDeprecatedDestProbReroute, - myHaveWarnedAboutDeprecatedClosingReroute, - myHaveWarnedAboutDeprecatedRouteReroute; + + /// @brief special destination values + static MSEdge mySpecialDest_keepDestination; + static MSEdge mySpecialDest_terminateRoute; private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.cpp sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.cpp --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.cpp 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSTriggeredXMLReader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTriggeredXMLReader.cpp 13109 2012-12-02 14:49:47Z behrisch $ /// // The basic class for classes that read XML-triggers /****************************************************************************/ @@ -66,7 +66,7 @@ bool MSTriggeredXMLReader::readNextTriggered() { - while (myHaveMore && myParser->parseNext(myToken)) { + while (myHaveMore && myParser->parseNext()) { if (nextRead()) { return true; } @@ -80,16 +80,13 @@ MSTriggeredXMLReader::myInit() { try { myParser = XMLSubSys::getSAXReader(*this); - if (!myParser->parseFirst(getFileName().c_str(), myToken)) { + if (!myParser->parseFirst(getFileName())) { throw ProcessError("Can not read XML-file '" + getFileName() + "'."); - } - } catch (SAXException& e) { - throw ProcessError(TplConvert::_2str(e.getMessage())); - - } catch (XMLException& e) { - throw ProcessError(TplConvert::_2str(e.getMessage())); - + } catch (XERCES_CPP_NAMESPACE::SAXException& e) { + throw ProcessError(TplConvert::_2str(e.getMessage())); + } catch (XERCES_CPP_NAMESPACE::XMLException& e) { + throw ProcessError(TplConvert::_2str(e.getMessage())); } if (readNextTriggered()) { @@ -105,4 +102,3 @@ /****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.h sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.h --- sumo-0.15.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.h 2012-01-07 20:14:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/MSTriggeredXMLReader.h 2012-11-05 00:02:22.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSTriggeredXMLReader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MSTriggeredXMLReader.h 12927 2012-11-04 06:47:13Z behrisch $ /// // The basic class for classes that read XML-triggers /****************************************************************************/ @@ -33,8 +33,8 @@ #endif #include -#include #include +#include #include "MSTriggeredReader.h" @@ -71,10 +71,7 @@ protected: /// The used SAX-parser - SAX2XMLReader* myParser; - - /// Position within the XML-file - XMLPScanToken myToken; + SUMOSAXReader* myParser; bool myHaveMore; diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/Makefile.am sumo-0.16.0~dfsg/src/microsim/trigger/Makefile.am --- sumo-0.15.0~dfsg/src/microsim/trigger/Makefile.am 2011-06-24 23:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/Makefile.am 2012-10-16 19:06:53.000000000 +0000 @@ -2,7 +2,7 @@ libmicrosimtrigger_a_SOURCES = MSBusStop.cpp MSBusStop.h \ MSLaneSpeedTrigger.cpp MSLaneSpeedTrigger.h \ -MSTrigger.h \ +MSTrigger.h MSTrigger.cpp \ MSTriggeredReader.cpp MSTriggeredReader.h \ MSTriggeredRerouter.cpp MSTriggeredRerouter.h \ MSTriggeredXMLReader.cpp MSTriggeredXMLReader.h diff -Nru sumo-0.15.0~dfsg/src/microsim/trigger/Makefile.in sumo-0.16.0~dfsg/src/microsim/trigger/Makefile.in --- sumo-0.15.0~dfsg/src/microsim/trigger/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/microsim/trigger/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -50,8 +50,9 @@ libmicrosimtrigger_a_AR = $(AR) $(ARFLAGS) libmicrosimtrigger_a_LIBADD = am_libmicrosimtrigger_a_OBJECTS = MSBusStop.$(OBJEXT) \ - MSLaneSpeedTrigger.$(OBJEXT) MSTriggeredReader.$(OBJEXT) \ - MSTriggeredRerouter.$(OBJEXT) MSTriggeredXMLReader.$(OBJEXT) + MSLaneSpeedTrigger.$(OBJEXT) MSTrigger.$(OBJEXT) \ + MSTriggeredReader.$(OBJEXT) MSTriggeredRerouter.$(OBJEXT) \ + MSTriggeredXMLReader.$(OBJEXT) libmicrosimtrigger_a_OBJECTS = $(am_libmicrosimtrigger_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -102,6 +103,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +134,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +169,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +203,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -222,7 +225,7 @@ noinst_LIBRARIES = libmicrosimtrigger.a libmicrosimtrigger_a_SOURCES = MSBusStop.cpp MSBusStop.h \ MSLaneSpeedTrigger.cpp MSLaneSpeedTrigger.h \ -MSTrigger.h \ +MSTrigger.h MSTrigger.cpp \ MSTriggeredReader.cpp MSTriggeredReader.h \ MSTriggeredRerouter.cpp MSTriggeredRerouter.h \ MSTriggeredXMLReader.cpp MSTriggeredXMLReader.h @@ -277,6 +280,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBusStop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLaneSpeedTrigger.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTrigger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTriggeredReader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTriggeredRerouter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTriggeredXMLReader.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/netbuild/Makefile.am sumo-0.16.0~dfsg/src/netbuild/Makefile.am --- sumo-0.15.0~dfsg/src/netbuild/Makefile.am 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/Makefile.am 2012-11-06 00:02:37.000000000 +0000 @@ -1,6 +1,7 @@ noinst_LIBRARIES = libnetbuild.a libnetbuild_a_SOURCES = NBAlgorithms.cpp NBAlgorithms.h \ +NBAlgorithms_Ramps.cpp NBAlgorithms_Ramps.h \ NBCapacity2Lanes.h NBConnection.cpp NBConnection.h \ NBConnectionDefs.h NBCont.h NBContHelper.cpp NBContHelper.h \ NBDistribution.cpp NBDistribution.h NBDistrict.cpp NBDistrict.h \ @@ -15,6 +16,7 @@ NBTrafficLightLogic.cpp NBTrafficLightLogic.h \ NBTrafficLightLogicCont.cpp NBTrafficLightLogicCont.h \ NBTypeCont.cpp NBTypeCont.h \ +NBSign.cpp NBSign.h \ NBOwnTLDef.cpp NBOwnTLDef.h \ NBLoadedTLDef.cpp NBLoadedTLDef.h \ NBLoadedSUMOTLDef.cpp NBLoadedSUMOTLDef.h \ diff -Nru sumo-0.15.0~dfsg/src/netbuild/Makefile.in sumo-0.16.0~dfsg/src/netbuild/Makefile.in --- sumo-0.15.0~dfsg/src/netbuild/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -50,15 +50,16 @@ libnetbuild_a_AR = $(AR) $(ARFLAGS) libnetbuild_a_LIBADD = am_libnetbuild_a_OBJECTS = NBAlgorithms.$(OBJEXT) \ - NBConnection.$(OBJEXT) NBContHelper.$(OBJEXT) \ - NBDistribution.$(OBJEXT) NBDistrict.$(OBJEXT) \ - NBDistrictCont.$(OBJEXT) NBEdge.$(OBJEXT) NBEdgeCont.$(OBJEXT) \ - NBFrame.$(OBJEXT) NBHelpers.$(OBJEXT) NBNode.$(OBJEXT) \ - NBNodeCont.$(OBJEXT) NBNodeShapeComputer.$(OBJEXT) \ - NBRequest.$(OBJEXT) NBTrafficLightDefinition.$(OBJEXT) \ + NBAlgorithms_Ramps.$(OBJEXT) NBConnection.$(OBJEXT) \ + NBContHelper.$(OBJEXT) NBDistribution.$(OBJEXT) \ + NBDistrict.$(OBJEXT) NBDistrictCont.$(OBJEXT) NBEdge.$(OBJEXT) \ + NBEdgeCont.$(OBJEXT) NBFrame.$(OBJEXT) NBHelpers.$(OBJEXT) \ + NBNode.$(OBJEXT) NBNodeCont.$(OBJEXT) \ + NBNodeShapeComputer.$(OBJEXT) NBRequest.$(OBJEXT) \ + NBTrafficLightDefinition.$(OBJEXT) \ NBTrafficLightLogic.$(OBJEXT) \ NBTrafficLightLogicCont.$(OBJEXT) NBTypeCont.$(OBJEXT) \ - NBOwnTLDef.$(OBJEXT) NBLoadedTLDef.$(OBJEXT) \ + NBSign.$(OBJEXT) NBOwnTLDef.$(OBJEXT) NBLoadedTLDef.$(OBJEXT) \ NBLoadedSUMOTLDef.$(OBJEXT) NBNetBuilder.$(OBJEXT) \ NBJoinedEdgesMap.$(OBJEXT) libnetbuild_a_OBJECTS = $(am_libnetbuild_a_OBJECTS) @@ -111,6 +112,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -141,6 +143,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -175,6 +178,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -208,7 +212,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -230,6 +233,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libnetbuild.a libnetbuild_a_SOURCES = NBAlgorithms.cpp NBAlgorithms.h \ +NBAlgorithms_Ramps.cpp NBAlgorithms_Ramps.h \ NBCapacity2Lanes.h NBConnection.cpp NBConnection.h \ NBConnectionDefs.h NBCont.h NBContHelper.cpp NBContHelper.h \ NBDistribution.cpp NBDistribution.h NBDistrict.cpp NBDistrict.h \ @@ -244,6 +248,7 @@ NBTrafficLightLogic.cpp NBTrafficLightLogic.h \ NBTrafficLightLogicCont.cpp NBTrafficLightLogicCont.h \ NBTypeCont.cpp NBTypeCont.h \ +NBSign.cpp NBSign.h \ NBOwnTLDef.cpp NBOwnTLDef.h \ NBLoadedTLDef.cpp NBLoadedTLDef.h \ NBLoadedSUMOTLDef.cpp NBLoadedSUMOTLDef.h \ @@ -299,6 +304,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBAlgorithms.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBAlgorithms_Ramps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBConnection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBContHelper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBDistribution.Po@am__quote@ @@ -317,6 +323,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBNodeShapeComputer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBOwnTLDef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBRequest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBSign.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBTrafficLightDefinition.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBTrafficLightLogic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBTrafficLightLogicCont.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms.cpp sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms.cpp 2012-03-13 12:52:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NBAlgorithms.cpp /// @author Daniel Krajzewicz /// @date 02. March 2012 -/// @version $Id: NBAlgorithms.cpp 12078 2012-03-13 11:35:39Z dkrajzew $ +/// @version $Id: NBAlgorithms.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Algorithms for network computation /****************************************************************************/ @@ -50,23 +50,23 @@ // --------------------------------------------------------------------------- // NBTurningDirectionsComputer // --------------------------------------------------------------------------- -void -NBTurningDirectionsComputer::computeTurnDirections(NBNodeCont &nc) { - for(std::map::const_iterator i=nc.begin(); i!=nc.end(); ++i) { +void +NBTurningDirectionsComputer::computeTurnDirections(NBNodeCont& nc) { + for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { computeTurnDirectionsForNode(i->second); } } -void -NBTurningDirectionsComputer::computeTurnDirectionsForNode(NBNode *node) { - const std::vector &incoming = node->getIncomingEdges(); - const std::vector &outgoing = node->getOutgoingEdges(); +void +NBTurningDirectionsComputer::computeTurnDirectionsForNode(NBNode* node) { + const std::vector& incoming = node->getIncomingEdges(); + const std::vector& outgoing = node->getOutgoingEdges(); std::vector combinations; - for(std::vector::const_iterator j=outgoing.begin(); j!=outgoing.end(); ++j) { - NBEdge *outedge = *j; - for(std::vector::const_iterator k=incoming.begin(); k!=incoming.end(); ++k) { + for (std::vector::const_iterator j = outgoing.begin(); j != outgoing.end(); ++j) { + NBEdge* outedge = *j; + for (std::vector::const_iterator k = incoming.begin(); k != incoming.end(); ++k) { NBEdge* e = *k; - if (e->getConnections().size()!=0 && !e->isConnectedTo(outedge)) { + if (e->getConnections().size() != 0 && !e->isConnectedTo(outedge)) { // has connections, but not to outedge; outedge will not be the turn direction // // @todo: this seems to be needed due to legacy issues; actually, we could regard @@ -78,10 +78,10 @@ // @todo: check whether NBHelpers::relAngle is properly defined and whether it should really be used, here SUMOReal angle = fabs(NBHelpers::relAngle(e->getAngleAtNode(node), outedge->getAngleAtNode(node))); - if(angle<160) { + if (angle < 160) { continue; } - if(e->getFromNode()==outedge->getToNode()) { + if (e->getFromNode() == outedge->getToNode()) { // they connect the same nodes; should be the turnaround direction // we'll assign a maximum number // @@ -105,11 +105,11 @@ std::sort(combinations.begin(), combinations.end(), combination_by_angle_sorter()); std::set seen; bool haveWarned = false; - for(std::vector::const_iterator j=combinations.begin(); j!=combinations.end(); ++j) { - if(seen.find((*j).from)!=seen.end() || seen.find((*j).to)!=seen.end() ) { + for (std::vector::const_iterator j = combinations.begin(); j != combinations.end(); ++j) { + if (seen.find((*j).from) != seen.end() || seen.find((*j).to) != seen.end()) { // do not regard already set edges - if((*j).angle>360&&!haveWarned) { - WRITE_WARNING("Ambiguity in turnarounds computation at node '" + node->getID() +"'."); + if ((*j).angle > 360 && !haveWarned) { + WRITE_WARNING("Ambiguity in turnarounds computation at node '" + node->getID() + "'."); haveWarned = true; } continue; @@ -126,16 +126,16 @@ // --------------------------------------------------------------------------- // NBNodesEdgesSorter // --------------------------------------------------------------------------- -void -NBNodesEdgesSorter::sortNodesEdges(NBNodeCont &nc, bool leftHand) { - for(std::map::const_iterator i=nc.begin(); i!=nc.end(); ++i) { - NBNode *n = (*i).second; +void +NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand) { + for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { + NBNode* n = (*i).second; if (n->myAllEdges.size() == 0) { continue; } - std::vector &allEdges = (*i).second->myAllEdges; - std::vector &incoming = (*i).second->myIncomingEdges; - std::vector &outgoing = (*i).second->myOutgoingEdges; + std::vector& allEdges = (*i).second->myAllEdges; + std::vector& incoming = (*i).second->myIncomingEdges; + std::vector& outgoing = (*i).second->myOutgoingEdges; // sort the edges std::sort(allEdges.begin(), allEdges.end(), edge_by_junction_angle_sorter(n)); std::sort(incoming.begin(), incoming.end(), edge_by_junction_angle_sorter(n)); @@ -152,7 +152,7 @@ void -NBNodesEdgesSorter::swapWhenReversed(const NBNode * const n, bool leftHand, +NBNodesEdgesSorter::swapWhenReversed(const NBNode* const n, bool leftHand, const std::vector::iterator& i1, const std::vector::iterator& i2) { NBEdge* e1 = *i1; @@ -174,10 +174,10 @@ // --------------------------------------------------------------------------- // NBNodeTypeComputer // --------------------------------------------------------------------------- -void -NBNodeTypeComputer::computeNodeTypes(NBNodeCont &nc) { - for(std::map::const_iterator i=nc.begin(); i!=nc.end(); ++i) { - NBNode *n = (*i).second; +void +NBNodeTypeComputer::computeNodeTypes(NBNodeCont& nc) { + for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { + NBNode* n = (*i).second; // the type may already be set from the data if (n->myType != NODETYPE_UNKNOWN) { continue; @@ -201,9 +201,11 @@ continue; } // @todo check against a legal document - SUMOReal s1 = (*i)->getSpeed() * (SUMOReal) 3.6; - SUMOReal s2 = (*j)->getSpeed() * (SUMOReal) 3.6; - if(fabs(s1-s2)>(SUMOReal) 9.5 || s1>=(SUMOReal) 49. || s2>=(SUMOReal) 49.) { + const SUMOReal s1 = (*i)->getSpeed() * (SUMOReal) 3.6; + const SUMOReal s2 = (*j)->getSpeed() * (SUMOReal) 3.6; + const int p1 = (*i)->getPriority(); + const int p2 = (*j)->getPriority(); + if (fabs(s1 - s2) > (SUMOReal) 9.5 || MAX2(s1, s2) >= (SUMOReal) 49. || p1 != p2) { type = NODETYPE_PRIORITY_JUNCTION; break; } @@ -219,9 +221,9 @@ // NBEdgePriorityComputer // --------------------------------------------------------------------------- void -NBEdgePriorityComputer::computeEdgePriorities(NBNodeCont &nc) { - for(std::map::const_iterator i=nc.begin(); i!=nc.end(); ++i) { - NBNode *n = (*i).second; +NBEdgePriorityComputer::computeEdgePriorities(NBNodeCont& nc) { + for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { + NBNode* n = (*i).second; // preset all junction's edge priorities to zero for (EdgeVector::iterator j = n->myAllEdges.begin(); j != n->myAllEdges.end(); ++j) { (*j)->setJunctionPriority(n, 0); @@ -239,7 +241,7 @@ void -NBEdgePriorityComputer::setPriorityJunctionPriorities(NBNode &n) { +NBEdgePriorityComputer::setPriorityJunctionPriorities(NBNode& n) { if (n.myIncomingEdges.size() == 0 || n.myOutgoingEdges.size() == 0) { return; } @@ -283,12 +285,12 @@ if (bestIncoming.size() == 1) { // let's mark this road as the best NBEdge* best1 = extractAndMarkFirst(n, bestIncoming); - if(counterIncomingEdges.find(best1)!=counterIncomingEdges.end()) { + if (counterIncomingEdges.find(best1) != counterIncomingEdges.end()) { // ok, look, what we want is the opposit of the straight continuation edge // but, what if such an edge does not exist? By now, we'll determine it // geometrically - NBEdge *s = counterIncomingEdges.find(best1)->second; - if(GeomHelper::getMinAngleDiff(best1->getAngleAtNode(&n), s->getAngleAtNode(&n))>180-45) { + NBEdge* s = counterIncomingEdges.find(best1)->second; + if (GeomHelper::getMinAngleDiff(best1->getAngleAtNode(&n), s->getAngleAtNode(&n)) > 180 - 45) { s->setJunctionPriority(&n, 1); } } @@ -296,9 +298,9 @@ // mark the best outgoing as the continuation sort(bestOutgoing.begin(), bestOutgoing.end(), NBContHelper::edge_similar_direction_sorter(best1)); best1 = extractAndMarkFirst(n, bestOutgoing); - if(counterOutgoingEdges.find(best1)!=counterOutgoingEdges.end()) { - NBEdge *s = counterOutgoingEdges.find(best1)->second; - if(GeomHelper::getMinAngleDiff(best1->getAngleAtNode(&n), s->getAngleAtNode(&n))>180-45) { + if (counterOutgoingEdges.find(best1) != counterOutgoingEdges.end()) { + NBEdge* s = counterOutgoingEdges.find(best1)->second; + if (GeomHelper::getMinAngleDiff(best1->getAngleAtNode(&n), s->getAngleAtNode(&n)) > 180 - 45) { s->setJunctionPriority(&n, 1); } } @@ -350,7 +352,7 @@ NBEdge* -NBEdgePriorityComputer::extractAndMarkFirst(NBNode &n, std::vector& s) { +NBEdgePriorityComputer::extractAndMarkFirst(NBNode& n, std::vector& s) { if (s.size() == 0) { return 0; } @@ -362,7 +364,7 @@ bool -NBEdgePriorityComputer::samePriority(const NBEdge*const e1, const NBEdge*const e2) { +NBEdgePriorityComputer::samePriority(const NBEdge* const e1, const NBEdge* const e2) { if (e1 == e2) { return true; } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms.h sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms.h --- sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms.h 2012-03-13 12:52:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NBAlgorithms.h /// @author Daniel Krajzewicz /// @date 02. March 2012 -/// @version $Id: NBAlgorithms.h 12078 2012-03-13 11:35:39Z dkrajzew $ +/// @version $Id: NBAlgorithms.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Algorithms for network computation /****************************************************************************/ @@ -54,7 +54,7 @@ /** @brief Computes turnaround destinations for all edges (if exist) * @param[in] nc The container of nodes to loop along */ - static void computeTurnDirections(NBNodeCont &nc); + static void computeTurnDirections(NBNodeCont& nc); /** @brief Computes turnaround destinations for all incoming edges of the given nodes (if any) * @param[in] node The node for which to compute turnaround destinations @@ -70,8 +70,8 @@ * opposite direction. */ struct Combination { - NBEdge *from; - NBEdge *to; + NBEdge* from; + NBEdge* to; SUMOReal angle; }; @@ -83,10 +83,10 @@ public: explicit combination_by_angle_sorter() { } int operator()(const Combination& c1, const Combination& c2) const { - if (c1.angle!=c2.angle) { + if (c1.angle != c2.angle) { return c1.angle > c2.angle; } - if (c1.from!=c2.from) { + if (c1.from != c2.from) { return c1.from->getID() < c2.from->getID(); } return c1.to->getID() < c2.to->getID(); @@ -108,7 +108,7 @@ * @param[in] nc The container of nodes to loop along * @param[in] leftHand Whether the network is left-handed */ - static void sortNodesEdges(NBNodeCont &nc, bool leftHand); + static void sortNodesEdges(NBNodeCont& nc, bool leftHand); private: /** @brief Assures correct order for same-angle opposite-direction edges @@ -117,9 +117,9 @@ * @param[in] i1 Pointer to first edge * @param[in] i2 Pointer to second edge */ - static void swapWhenReversed(const NBNode * const n, bool leftHand, - const std::vector::iterator& i1, - const std::vector::iterator& i2); + static void swapWhenReversed(const NBNode* const n, bool leftHand, + const std::vector::iterator& i1, + const std::vector::iterator& i2); /** @class edge_by_junction_angle_sorter @@ -173,7 +173,7 @@ /** @brief Computes node types * @param[in] nc The container of nodes to loop along */ - static void computeNodeTypes(NBNodeCont &nc); + static void computeNodeTypes(NBNodeCont& nc); }; @@ -190,27 +190,27 @@ /** @brief Computes edge priorities within a node * @param[in] nc The container of nodes to loop along */ - static void computeEdgePriorities(NBNodeCont &nc); + static void computeEdgePriorities(NBNodeCont& nc); private: /** @brief Sets the priorites in case of a priority junction * @param[in] n The node to set edges' priorities */ - static void setPriorityJunctionPriorities(NBNode &n); + static void setPriorityJunctionPriorities(NBNode& n); /** @brief Sets the priorites in case of a priority junction * @param[in] n The node to set edges' priorities * @param[in] s The vector of edges to get and mark the first from * @return The vector's first edge */ - static NBEdge* extractAndMarkFirst(NBNode &n, std::vector& s); + static NBEdge* extractAndMarkFirst(NBNode& n, std::vector& s); /** @brief Returns whether both edges have the same priority * @param[in] e1 The first edge * @param[in] e2 The second edge * Whether both edges have the same priority */ - static bool samePriority(const NBEdge*const e1, const NBEdge*const e2); + static bool samePriority(const NBEdge* const e1, const NBEdge* const e2); }; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms_Ramps.cpp sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms_Ramps.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms_Ramps.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms_Ramps.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,432 @@ +/****************************************************************************/ +/// @file NBAlgorithms_Ramps.cpp +/// @author Daniel Krajzewicz +/// @date 29. March 2012 +/// @version $Id: NBAlgorithms_Ramps.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Algorithms for highway on-/off-ramps computation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include "NBNetBuilder.h" +#include "NBNodeCont.h" +#include "NBNode.h" +#include "NBEdge.h" +#include "NBAlgorithms_Ramps.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// static members +// =========================================================================== +const std::string NBRampsComputer::ADDED_ON_RAMP_EDGE("-AddedOnRampEdge"); + +// =========================================================================== +// method definitions +// =========================================================================== +// --------------------------------------------------------------------------- +// NBRampsComputer +// --------------------------------------------------------------------------- +void +NBRampsComputer::computeRamps(NBNetBuilder& nb, OptionsCont& oc) { + SUMOReal minHighwaySpeed = oc.getFloat("ramps.min-highway-speed"); + SUMOReal maxRampSpeed = oc.getFloat("ramps.max-ramp-speed"); + SUMOReal rampLength = oc.getFloat("ramps.ramp-length"); + bool dontSplit = oc.getBool("ramps.no-split"); + std::set incremented; + // check whether on-off ramps shall be guessed + if (oc.getBool("ramps.guess")) { + NBNodeCont& nc = nb.getNodeCont(); + NBEdgeCont& ec = nb.getEdgeCont(); + NBDistrictCont& dc = nb.getDistrictCont(); + std::set potOnRamps; + std::set potOffRamps; + for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { + NBNode* cur = (*i).second; + if (mayNeedOnRamp(cur, minHighwaySpeed, maxRampSpeed)) { + potOnRamps.insert(cur); + } + if (mayNeedOffRamp(cur, minHighwaySpeed, maxRampSpeed)) { + potOffRamps.insert(cur); + } + } + for (std::set::const_iterator i = potOnRamps.begin(); i != potOnRamps.end(); ++i) { + buildOnRamp(*i, nc, ec, dc, rampLength, dontSplit, incremented); + } + for (std::set::const_iterator i = potOffRamps.begin(); i != potOffRamps.end(); ++i) { + buildOffRamp(*i, nc, ec, dc, rampLength, dontSplit, incremented); + } + } + // check whether on-off ramps shall be guessed + if (oc.isSet("ramps.set")) { + std::vector edges = oc.getStringVector("ramps.set"); + NBNodeCont& nc = nb.getNodeCont(); + NBEdgeCont& ec = nb.getEdgeCont(); + NBDistrictCont& dc = nb.getDistrictCont(); + for (std::vector::iterator i = edges.begin(); i != edges.end(); ++i) { + NBEdge* e = ec.retrieve(*i); + if (e == 0) { + WRITE_WARNING("Can not build on ramp on edge '" + *i + "' - the edge is not known."); + continue; + } + NBNode* from = e->getFromNode(); + if (from->getIncomingEdges().size() == 2 && from->getOutgoingEdges().size() == 1) { + buildOnRamp(from, nc, ec, dc, rampLength, dontSplit, incremented); + } + // load edge again to check offramps + e = ec.retrieve(*i); + if (e == 0) { + WRITE_WARNING("Can not build off ramp on edge '" + *i + "' - the edge is not known."); + continue; + } + NBNode* to = e->getToNode(); + if (to->getIncomingEdges().size() == 1 && to->getOutgoingEdges().size() == 2) { + buildOffRamp(to, nc, ec, dc, rampLength, dontSplit, incremented); + } + } + } +} + + +bool +NBRampsComputer::mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) { + if (cur->getOutgoingEdges().size() != 1 || cur->getIncomingEdges().size() != 2) { + return false; + } + NBEdge* potHighway, *potRamp, *cont; + getOnRampEdges(cur, &potHighway, &potRamp, &cont); + // may be an on-ramp + return fulfillsRampConstraints(potHighway, potRamp, cont, minHighwaySpeed, maxRampSpeed); +} + + +bool +NBRampsComputer::mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) { + if (cur->getIncomingEdges().size() != 1 || cur->getOutgoingEdges().size() != 2) { + return false; + } + // may be an off-ramp + NBEdge* potHighway, *potRamp, *prev; + getOffRampEdges(cur, &potHighway, &potRamp, &prev); + return fulfillsRampConstraints(potHighway, potRamp, prev, minHighwaySpeed, maxRampSpeed); +} + + +void +NBRampsComputer::buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set& incremented) { + NBEdge* potHighway, *potRamp, *cont; + getOnRampEdges(cur, &potHighway, &potRamp, &cont); + // compute the number of lanes to append + const unsigned int firstLaneNumber = potHighway->getNumLanes(); + int toAdd = (potRamp->getNumLanes() + firstLaneNumber) - cont->getNumLanes(); + NBEdge* first = cont; + NBEdge* last = cont; + NBEdge* curr = cont; + if (toAdd > 0 && find(incremented.begin(), incremented.end(), cont) == incremented.end()) { + SUMOReal currLength = 0; + while (curr != 0 && currLength + curr->getGeometry().length() - POSITION_EPS < rampLength) { + if (find(incremented.begin(), incremented.end(), curr) == incremented.end()) { + curr->incLaneNo(toAdd); + curr->invalidateConnections(true); + incremented.insert(curr); + moveRampRight(curr, toAdd); + currLength += curr->getLength(); // !!! loaded length? + last = curr; + } + NBNode* nextN = curr->getToNode(); + if (nextN->getOutgoingEdges().size() == 1) { + curr = nextN->getOutgoingEdges()[0]; + if (curr->getNumLanes() != firstLaneNumber) { + // the number of lanes changes along the computation; we'll stop... + curr = 0; + } + } else { + // ambigous; and, in fact, what should it be? ...stop + curr = 0; + } + } + // check whether a further split is necessary + if (curr != 0 && !dontSplit && currLength - POSITION_EPS < rampLength && curr->getNumLanes() == firstLaneNumber && find(incremented.begin(), incremented.end(), curr) == incremented.end()) { + // there is enough place to build a ramp; do it + bool wasFirst = first == curr; + NBNode* rn = new NBNode(curr->getID() + "-AddedOnRampNode", curr->getGeometry().positionAtLengthPosition(rampLength - currLength)); + if (!nc.insert(rn)) { + throw ProcessError("Ups - could not build on-ramp for edge '" + curr->getID() + "' (node could not be build)!"); + } + std::string name = curr->getID(); + bool ok = ec.splitAt(dc, curr, rn, curr->getID() + ADDED_ON_RAMP_EDGE, curr->getID(), curr->getNumLanes() + toAdd, curr->getNumLanes()); + if (!ok) { + WRITE_ERROR("Ups - could not build on-ramp for edge '" + curr->getID() + "'!"); + return; + } + //ec.retrieve(name)->invalidateConnections(); + curr = ec.retrieve(name + ADDED_ON_RAMP_EDGE); + curr->invalidateConnections(true); + incremented.insert(curr); + last = curr; + moveRampRight(curr, toAdd); + if (wasFirst) { + first = curr; + } + } + } + // set connections from ramp/highway to added ramp + if (!potHighway->addLane2LaneConnections(0, first, potRamp->getNumLanes(), MIN2(first->getNumLanes() - potRamp->getNumLanes(), potHighway->getNumLanes()), NBEdge::L2L_VALIDATED, true, true)) { + throw ProcessError("Could not set connection!"); + } + if (!potRamp->addLane2LaneConnections(0, first, 0, potRamp->getNumLanes(), NBEdge::L2L_VALIDATED, true, true)) { + throw ProcessError("Could not set connection!"); + } + // patch ramp geometry + PositionVector p = potRamp->getGeometry(); + p.pop_back(); + p.push_back(first->getLaneShape(0)[0]); + potRamp->setGeometry(p); + // set connections from added ramp to following highway + NBNode* nextN = last->getToNode(); + if (nextN->getOutgoingEdges().size() == 1) { + NBEdge* next = nextN->getOutgoingEdges()[0];//const EdgeVector& o1 = cont->getToNode()->getOutgoingEdges(); + if (next->getNumLanes() < last->getNumLanes()) { + last->addLane2LaneConnections(last->getNumLanes() - next->getNumLanes(), next, 0, next->getNumLanes(), NBEdge::L2L_VALIDATED); + } + } +} + + +void +NBRampsComputer::buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set& incremented) { + NBEdge* potHighway, *potRamp, *prev; + getOffRampEdges(cur, &potHighway, &potRamp, &prev); + // compute the number of lanes to append + const unsigned int firstLaneNumber = potHighway->getNumLanes(); + int toAdd = (potRamp->getNumLanes() + firstLaneNumber) - prev->getNumLanes(); + NBEdge* first = prev; + NBEdge* last = prev; + NBEdge* curr = prev; + if (toAdd > 0 && find(incremented.begin(), incremented.end(), prev) == incremented.end()) { + SUMOReal currLength = 0; + while (curr != 0 && currLength + curr->getGeometry().length() - POSITION_EPS < rampLength) { + if (find(incremented.begin(), incremented.end(), curr) == incremented.end()) { + curr->incLaneNo(toAdd); + curr->invalidateConnections(true); + incremented.insert(curr); + moveRampRight(curr, toAdd); + currLength += curr->getLength(); // !!! loaded length? + last = curr; + } + NBNode* prevN = curr->getFromNode(); + if (prevN->getIncomingEdges().size() == 1) { + curr = prevN->getIncomingEdges()[0]; + if (curr->getNumLanes() != firstLaneNumber) { + // the number of lanes changes along the computation; we'll stop... + curr = 0; + } + } else { + // ambigous; and, in fact, what should it be? ...stop + curr = 0; + } + } + // check whether a further split is necessary + if (curr != 0 && !dontSplit && currLength - POSITION_EPS < rampLength && curr->getNumLanes() == firstLaneNumber && find(incremented.begin(), incremented.end(), curr) == incremented.end()) { + // there is enough place to build a ramp; do it + bool wasFirst = first == curr; + Position pos = curr->getGeometry().positionAtLengthPosition(curr->getGeometry().length() - (rampLength - currLength)); + NBNode* rn = new NBNode(curr->getID() + "-AddedOffRampNode", pos); + if (!nc.insert(rn)) { + throw ProcessError("Ups - could not build on-ramp for edge '" + curr->getID() + "' (node could not be build)!"); + } + std::string name = curr->getID(); + bool ok = ec.splitAt(dc, curr, rn, curr->getID(), curr->getID() + "-AddedOffRampEdge", curr->getNumLanes(), curr->getNumLanes() + toAdd); + if (!ok) { + WRITE_ERROR("Ups - could not build on-ramp for edge '" + curr->getID() + "'!"); + return; + } + curr = ec.retrieve(name + "-AddedOffRampEdge"); + curr->invalidateConnections(true); + incremented.insert(curr); + last = curr; + moveRampRight(curr, toAdd); + if (wasFirst) { + first = curr; + } + } + } + // set connections from added ramp to ramp/highway + if (!first->addLane2LaneConnections(potRamp->getNumLanes(), potHighway, 0, MIN2(first->getNumLanes() - 1, potHighway->getNumLanes()), NBEdge::L2L_VALIDATED, true)) { + throw ProcessError("Could not set connection!"); + } + if (!first->addLane2LaneConnections(0, potRamp, 0, potRamp->getNumLanes(), NBEdge::L2L_VALIDATED, false)) { + throw ProcessError("Could not set connection!"); + } + // patch ramp geometry + PositionVector p = potRamp->getGeometry(); + p.pop_front(); + p.push_front(first->getLaneShape(0)[-1]); + potRamp->setGeometry(p); + // set connections from previous highway to added ramp + NBNode* prevN = last->getFromNode(); + if (prevN->getIncomingEdges().size() == 1) { + NBEdge* prev = prevN->getIncomingEdges()[0];//const EdgeVector& o1 = cont->getToNode()->getOutgoingEdges(); + if (prev->getNumLanes() < last->getNumLanes()) { + last->addLane2LaneConnections(last->getNumLanes() - prev->getNumLanes(), last, 0, prev->getNumLanes(), NBEdge::L2L_VALIDATED); + } + } +} + + +void +NBRampsComputer::moveRampRight(NBEdge* ramp, int addedLanes) { + if (ramp->getLaneSpreadFunction() != LANESPREAD_CENTER) { + return; + } + try { + PositionVector g = ramp->getGeometry(); + SUMOReal factor = SUMO_const_laneWidthAndOffset * (SUMOReal)(addedLanes - 1) + SUMO_const_halfLaneAndOffset * (SUMOReal)(addedLanes % 2); + g.move2side(factor); + ramp->setGeometry(g); + } catch (InvalidArgument&) { + WRITE_WARNING("For edge '" + ramp->getID() + "': could not compute shape."); + } +} + + +bool +NBRampsComputer::determinedBySpeed(NBEdge** potHighway, NBEdge** potRamp) { + if (fabs((*potHighway)->getSpeed() - (*potRamp)->getSpeed()) < .1) { + return false; + } + if ((*potHighway)->getSpeed() < (*potRamp)->getSpeed()) { + std::swap(*potHighway, *potRamp); + } + return true; +} + + +bool +NBRampsComputer::determinedByLaneNumber(NBEdge** potHighway, NBEdge** potRamp) { + if ((*potHighway)->getNumLanes() == (*potRamp)->getNumLanes()) { + return false; + } + if ((*potHighway)->getNumLanes() < (*potRamp)->getNumLanes()) { + std::swap(*potHighway, *potRamp); + } + return true; +} + + +void +NBRampsComputer::getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other) { + *other = n->getOutgoingEdges()[0]; + const std::vector& edges = n->getIncomingEdges(); + assert(edges.size() == 2); + *potHighway = edges[0]; + *potRamp = edges[1]; + /* + // heuristic: highway is faster than ramp + if(determinedBySpeed(potHighway, potRamp)) { + return; + } + // heuristic: highway has more lanes than ramp + if(determinedByLaneNumber(potHighway, potRamp)) { + return; + } + */ + // heuristic: ramp comes from right + const std::vector& edges2 = n->getEdges(); + std::vector::const_iterator i = std::find(edges2.begin(), edges2.end(), *other); + NBContHelper::nextCW(edges2, i); + if ((*i) == *potHighway) { + std::swap(*potHighway, *potRamp); + } +} + + +void +NBRampsComputer::getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other) { + *other = n->getIncomingEdges()[0]; + const std::vector& edges = n->getOutgoingEdges(); + *potHighway = edges[0]; + *potRamp = edges[1]; + assert(edges.size() == 2); + /* + // heuristic: highway is faster than ramp + if(determinedBySpeed(potHighway, potRamp)) { + return; + } + // heuristic: highway has more lanes than ramp + if(determinedByLaneNumber(potHighway, potRamp)) { + return; + } + */ + // heuristic: ramp goes to right + const std::vector& edges2 = n->getEdges(); + std::vector::const_iterator i = std::find(edges2.begin(), edges2.end(), *other); + NBContHelper::nextCW(edges2, i); + if ((*i) == *potRamp) { + std::swap(*potHighway, *potRamp); + } +} + + +bool +NBRampsComputer::fulfillsRampConstraints( + NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) { + // do not build ramps on rail edges + if (isRailway(potHighway->getPermissions()) || isRailway(potRamp->getPermissions())) { + return false; + } + // do not build ramps on connectors + if (potHighway->isMacroscopicConnector() || potRamp->isMacroscopicConnector() || other->isMacroscopicConnector()) { + return false; + } + // check whether a lane is missing + if (potHighway->getNumLanes() + potRamp->getNumLanes() <= other->getNumLanes()) { + return false; + } + // check conditions + // is it really a highway? + SUMOReal maxSpeed = MAX3(potHighway->getSpeed(), other->getSpeed(), potRamp->getSpeed()); + if (maxSpeed < minHighwaySpeed) { + return false; + } + /* + if (potHighway->getSpeed() < minHighwaySpeed || other->getSpeed() < minHighwaySpeed) { + return false; + } + */ + // is it really a ramp? + if (maxRampSpeed > 0 && maxRampSpeed < potRamp->getSpeed()) { + return false; + } + return true; +} + + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms_Ramps.h sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms_Ramps.h --- sumo-0.15.0~dfsg/src/netbuild/NBAlgorithms_Ramps.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBAlgorithms_Ramps.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,141 @@ +/****************************************************************************/ +/// @file NBAlgorithms_Ramps.h +/// @author Daniel Krajzewicz +/// @date 29. March 2012 +/// @version $Id: NBAlgorithms_Ramps.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Algorithms for highway on-/off-ramps computation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef NBAlgorithms_Ramps_h +#define NBAlgorithms_Ramps_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class NBNetBuilder; +class OptionsCont; +class NBNode; +class NBEdgeCont; +class NBDistrictCont; + + +// =========================================================================== +// class definitions +// =========================================================================== +// --------------------------------------------------------------------------- +// NBAlgorithms_Ramps +// --------------------------------------------------------------------------- +/* @class NBRampsComputer + * @brief Computes highway on-/off-ramps (if wished) + */ +class NBRampsComputer { +public: + /** @brief Computes highway on-/off-ramps (if wished) + * @param[in, changed] nb The network builder which contains the current network representation + * @param[in] oc The options container + */ + static void computeRamps(NBNetBuilder& nb, OptionsCont& oc); + + /// @brief suffix for newly generated on-ramp edges + static const std::string ADDED_ON_RAMP_EDGE; + +private: + /** @brief Determines whether the given node may be an on-ramp begin + * @param[in] cur The node to check + * @param[in] minHighwaySpeed The minimum speed limit a highway must have for being a highway + * @param[in] maxRampSpeed The maximum speed limit a ramp must have for being a ramp + * @return Whether the node is assumed to be an on-ramp begin + */ + static bool mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed); + + + /** @brief Determines whether the given node may be an off-ramp end + * @param[in] cur The node to check + * @param[in] minHighwaySpeed The minimum speed limit a highway must have for being a highway + * @param[in] maxRampSpeed The maximum speed limit a ramp must have for being a ramp + * @return Whether the node is assumed to be an off-ramp end + */ + static bool mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed); + + + /** @brief Builds an on-ramp starting at the given node + * @param[in] cur The node at which the on-ramp shall begin + * @param[in] nc The container of nodes + * @param[in] ec The container of edges + * @param[in] dc The container of districts + * @param[in] rampLength The wished ramp length + * @param[in] dontSplit Whether no edges shall be split + * @param[in, filled] incremented The list of edges which lane number was already incremented + */ + static void buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set& incremented); + + + /** @brief Builds an off-ramp ending at the given node + * @param[in] cur The node at which the off-ramp shall end + * @param[in] nc The container of nodes + * @param[in] ec The container of edges + * @param[in] dc The container of districts + * @param[in] rampLength The wished ramp length + * @param[in] dontSplit Whether no edges shall be split + * @param[in, filled] incremented The list of edges which lane number was already incremented + */ + static void buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set& incremented); + + + static void getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other); + static void getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other); + static bool determinedBySpeed(NBEdge** potHighway, NBEdge** potRamp); + static bool determinedByLaneNumber(NBEdge** potHighway, NBEdge** potRamp); + + /** @brief Checks whether an on-/off-ramp can be bult here + * + * - none of the participating edges must be a macroscopic connector + * - ramp+highways together must have more lanes than the continuation + * - speeds must match the defined swells + * @param[in] potHighway The highway part to check + * @param[in] potRamp The ramp part to check + * @param[in] other The successor/predecessor edge + * @param[in] minHighwaySpeed The minimum speed limit a highway must have for being a highway + * @param[in] maxRampSpeed The maximum speed limit a ramp must have for being a ramp + * @return Whether a ramp can be built here + */ + static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed); + + + /** @brief Moves the ramp to the right, as new lanes were added + * @param[in] ramp The ramp to move + * @param[in] addedLanes The number of added lanes + */ + static void moveRampRight(NBEdge* ramp, int addedLanes); + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBConnection.cpp sumo-0.16.0~dfsg/src/netbuild/NBConnection.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBConnection.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBConnection.cpp 2012-09-25 22:01:56.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBConnection.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBConnection.cpp 12574 2012-08-21 12:23:51Z dkrajzew $ /// // The class holds a description of a connection between two edges /****************************************************************************/ @@ -193,7 +193,7 @@ return myFrom; } // try to get the edge - return ec.retrievePossiblySplitted(myFromID, myToID, true); + return ec.retrievePossiblySplit(myFromID, myToID, true); } @@ -205,7 +205,7 @@ return myTo; } // try to get the edge - return ec.retrievePossiblySplitted(myToID, myFromID, false); + return ec.retrievePossiblySplit(myToID, myFromID, false); } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBContHelper.cpp sumo-0.16.0~dfsg/src/netbuild/NBContHelper.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBContHelper.cpp 2012-03-06 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBContHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBContHelper.cpp 12015 2012-03-05 14:53:20Z dkrajzew $ +/// @version $Id: NBContHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Some methods for traversing lists of edges /****************************************************************************/ @@ -67,7 +67,7 @@ std::ostream& -NBContHelper::out(std::ostream& os, const std::vector &v) { +NBContHelper::out(std::ostream& os, const std::vector& v) { for (std::vector::const_iterator i = v.begin(); i != v.end(); i++) { os << *i; } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBContHelper.h sumo-0.16.0~dfsg/src/netbuild/NBContHelper.h --- sumo-0.15.0~dfsg/src/netbuild/NBContHelper.h 2012-03-06 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBContHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: NBContHelper.h 12015 2012-03-05 14:53:20Z dkrajzew $ +/// @version $Id: NBContHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Some methods for traversing lists of edges /****************************************************************************/ @@ -70,7 +70,7 @@ static SUMOReal getMinSpeed(const EdgeVector& edges); /** writes the vector of bools to the given stream */ - static std::ostream& out(std::ostream& os, const std::vector &v); + static std::ostream& out(std::ostream& os, const std::vector& v); /** @@ -190,6 +190,10 @@ /// @brief The related node const NBNode* const myNode; + private: + /// @brief Invalidated assignment operator + edge_opposite_direction_sorter& operator=(const edge_opposite_direction_sorter& s); + }; // --------------------------- diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBDistrict.h sumo-0.16.0~dfsg/src/netbuild/NBDistrict.h --- sumo-0.15.0~dfsg/src/netbuild/NBDistrict.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBDistrict.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBDistrict.h 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: NBDistrict.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A class representing a single district /****************************************************************************/ @@ -187,7 +187,7 @@ /** @brief Returns the weights of the sources * @return The source weights */ - const std::vector &getSourceWeights() const { + const std::vector& getSourceWeights() const { return mySourceWeights; } @@ -195,7 +195,7 @@ /** @brief Returns the sources * @return The source edges */ - const std::vector &getSourceEdges() const { + const std::vector& getSourceEdges() const { return mySources; } @@ -203,7 +203,7 @@ /** @brief Returns the weights of the sinks * @return The sink weights */ - const std::vector &getSinkWeights() const { + const std::vector& getSinkWeights() const { return mySinkWeights; } @@ -211,7 +211,7 @@ /** @brief Returns the sinks * @return The sink edges */ - const std::vector &getSinkEdges() const { + const std::vector& getSinkEdges() const { return mySinks; } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBDistrictCont.h sumo-0.16.0~dfsg/src/netbuild/NBDistrictCont.h --- sumo-0.15.0~dfsg/src/netbuild/NBDistrictCont.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBDistrictCont.h 2012-09-25 22:01:56.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBDistrictCont.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBDistrictCont.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A container for districts /****************************************************************************/ @@ -60,11 +60,11 @@ class NBDistrictCont { public: /// @brief Constructor - NBDistrictCont() ; + NBDistrictCont(); /// @brief Destructor - ~NBDistrictCont() ; + ~NBDistrictCont(); /** @brief Adds a district to the dictionary @@ -72,7 +72,7 @@ * @param[in] district The district to add * @return false if the districts already was in the dictionary */ - bool insert(NBDistrict* const district) ; + bool insert(NBDistrict* const district); /** @brief Returns the districts with the given id @@ -80,7 +80,7 @@ * @param[in] id The id of the district to retrieve * @return The district with the given id if there was one having it, 0 otherwise */ - NBDistrict* retrieve(const std::string& id) const ; + NBDistrict* retrieve(const std::string& id) const; /** @brief Returns the pointer to the begin of the stored districts @@ -100,7 +100,7 @@ /** @brief Returns the number of districts inside the container */ - size_t size() const ; + size_t size() const; /** @brief Adds a source to the named district @@ -116,7 +116,7 @@ * @return Whether the source could be added (the district exists and the suorce was not added to it before) */ bool addSource(const std::string& dist, NBEdge* const source, - SUMOReal weight) ; + SUMOReal weight); /** @brief Adds a sink to the named district @@ -132,7 +132,7 @@ * @return Whether the source could be added (the district exists and the suorce was not added to it before) */ bool addSink(const std::string& dist, NBEdge* const destination, - SUMOReal weight) ; + SUMOReal weight); /** @brief Removes the given edge from the lists of sources and sinks in all stored districts @@ -143,7 +143,7 @@ * @see NBDistrict::removeFromSinksAndSources * @param[in] e The edge to remove from sinks/sources */ - void removeFromSinksAndSources(NBEdge* const e) ; + void removeFromSinksAndSources(NBEdge* const e); private: diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBEdge.cpp sumo-0.16.0~dfsg/src/netbuild/NBEdge.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBEdge.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdge.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: NBEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Methods for the representation of a single edge /****************************************************************************/ @@ -229,7 +229,6 @@ const std::string& streetName, LaneSpreadFunction spread, bool tryIgnoreNodePositions) { - // connections may still be valid if (myFrom != from) { myFrom->removeEdge(this, false); } @@ -256,6 +255,25 @@ void +NBEdge::reinitNodes(NBNode* from, NBNode* to) { + // connections may still be valid + if (from == 0 || to == 0) { + throw ProcessError("At least one of edge's '" + myID + "' nodes is not known."); + } + if (myFrom != from) { + myFrom->removeEdge(this, false); + myFrom = from; + myFrom->addOutgoingEdge(this); + } + if (myTo != to) { + myTo->removeEdge(this, false); + myTo = to; + myTo->addIncomingEdge(this); + } +} + + +void NBEdge::init(unsigned int noLanes, bool tryIgnoreNodePositions) { if (noLanes == 0) { throw ProcessError("Edge '" + myID + "' needs at least one lane."); @@ -385,14 +403,14 @@ } -PositionVector +PositionVector NBEdge::startShapeAt(const PositionVector& laneShape, const NBNode* startNode, unsigned int laneIndex) const { - const std::string error = "Could not find a way to attach lane '" + getLaneID(laneIndex) + - "' at node shape of '" + startNode->getID() + "'."; + const std::string error = "Could not find a way to attach lane '" + getLaneID(laneIndex) + + "' at node shape of '" + startNode->getID() + "'."; const PositionVector& nodeShape = startNode->getShape(); Line lb = laneShape.getBegLine(); - // this doesn't look reasonable @todo use lb.extrapolateFirstBy(100.0); - lb.extrapolateBy(100.0); + // this doesn't look reasonable @todo use lb.extrapolateFirstBy(100.0); + lb.extrapolateBy(100.0); if (nodeShape.intersects(laneShape)) { // shape intersects directly std::vector pbv = laneShape.intersectsAtLengths2D(nodeShape); @@ -771,8 +789,8 @@ } } -void -NBEdge::replaceInConnections(NBEdge* which, const std::vector &origConns) { +void +NBEdge::replaceInConnections(NBEdge* which, const std::vector& origConns) { std::map laneMap; int minLane = -1; int maxLane = -1; @@ -783,44 +801,44 @@ continue; } wasConnected = true; - if((*i).fromLane!=-1) { + if ((*i).fromLane != -1) { int fromLane = (*i).fromLane; laneMap[(*i).toLane] = fromLane; - if(minLane==-1||minLane>fromLane) { - minLane= fromLane; + if (minLane == -1 || minLane > fromLane) { + minLane = fromLane; } - if(maxLane==-1||maxLane conns = origConns; - for(std::vector::iterator i=conns.begin(); i!=conns.end(); ++i) { - if((*i).toEdge==which) { + for (std::vector::iterator i = conns.begin(); i != conns.end(); ++i) { + if ((*i).toEdge == which) { continue; } - int fromLane = (*i).fromLane; - int toUse = -1; - if(laneMap.find(fromLane)==laneMap.end()) { - if(fromLane>=0 && fromLane<=minLane) { - toUse = minLane; - } - if(fromLane>=0 && fromLane>=maxLane) { - toUse = maxLane; - } - } else { - toUse = laneMap[fromLane]; + int fromLane = (*i).fromLane; + int toUse = -1; + if (laneMap.find(fromLane) == laneMap.end()) { + if (fromLane >= 0 && fromLane <= minLane) { + toUse = minLane; } - if(toUse==-1) { - toUse = 0; + if (fromLane >= 0 && fromLane >= maxLane) { + toUse = maxLane; } - setConnection(toUse, (*i).toEdge, (*i).toLane, L2L_COMPUTED, false, (*i).mayDefinitelyPass); + } else { + toUse = laneMap[fromLane]; + } + if (toUse == -1) { + toUse = 0; + } + setConnection(toUse, (*i).toEdge, (*i).toLane, L2L_COMPUTED, false, (*i).mayDefinitelyPass); } } @@ -891,13 +909,15 @@ NBEdge::buildInnerEdges(const NBNode& n, unsigned int noInternalNoSplits, unsigned int& lno, unsigned int& splitNo) { std::string innerID = ":" + n.getID(); for (std::vector::iterator i = myConnections.begin(); i != myConnections.end(); ++i) { - if ((*i).toEdge == 0) { + Connection& con = *i; + con.haveVia = false; // reset first since this may be called multiple times + if (con.toEdge == 0) { continue; } - PositionVector shape = n.computeInternalLaneShape(this, (*i).fromLane, (*i).toEdge, (*i).toLane); + PositionVector shape = n.computeInternalLaneShape(this, con.fromLane, con.toEdge, con.toLane); - LinkDirection dir = n.getDirection(this, (*i).toEdge); + LinkDirection dir = n.getDirection(this, con.toEdge); std::pair > crossingPositions(-1, std::vector()); std::string foeInternalLanes; std::set tmpFoeIncomingLanes; @@ -906,14 +926,14 @@ case LINKDIR_PARTLEFT: case LINKDIR_TURN: { unsigned int index = 0; - const std::vector &incoming = n.getIncomingEdges(); + const std::vector& incoming = n.getIncomingEdges(); for (EdgeVector::const_iterator i2 = incoming.begin(); i2 != incoming.end(); ++i2) { - const std::vector &elv = (*i2)->getConnections(); + const std::vector& elv = (*i2)->getConnections(); for (std::vector::const_iterator k2 = elv.begin(); k2 != elv.end(); k2++) { if ((*k2).toEdge == 0) { continue; } - bool needsCont = n.needsCont(this, (*i).toEdge, *i2, (*k2).toEdge, *k2); + bool needsCont = n.needsCont(this, con.toEdge, *i2, (*k2).toEdge, *k2); // compute the crossing point if (needsCont) { crossingPositions.second.push_back(index); @@ -930,7 +950,7 @@ } } // compute foe internal lanes - if (n.foes(this, (*i).toEdge, *i2, (*k2).toEdge)) { + if (n.foes(this, con.toEdge, *i2, (*k2).toEdge)) { if (foeInternalLanes.length() != 0) { foeInternalLanes += " "; } @@ -938,7 +958,8 @@ } // compute foe incoming lanes NBEdge* e = getToNode()->getOppositeIncoming(this); - if (e == *i2 && needsCont && !n.forbids(this, (*i).toEdge, *i2, (*k2).toEdge, true) ) { + if ((e == *i2 && needsCont && !n.forbids(this, con.toEdge, *i2, (*k2).toEdge, true)) + || (dir == LINKDIR_TURN && this != *i2 && con.toEdge == (*k2).toEdge)) { tmpFoeIncomingLanes.insert((*i2)->getID() + "_" + toString((*k2).fromLane)); } index++; @@ -958,39 +979,40 @@ // compute the maximum speed allowed // see !!! for an explanation (with a_lat_mean ~0.3) SUMOReal vmax = (SUMOReal) 0.3 * (SUMOReal) 9.80778 * - getLaneShape((*i).fromLane).getEnd().distanceTo( - (*i).toEdge->getLaneShape((*i).toLane).getBegin()) + getLaneShape(con.fromLane).getEnd().distanceTo( + con.toEdge->getLaneShape(con.toLane).getBegin()) / (SUMOReal) 2.0 / (SUMOReal) PI; - vmax = MIN2(vmax, ((getSpeed() + (*i).toEdge->getSpeed()) / (SUMOReal) 2.0)); - vmax = (getSpeed() + (*i).toEdge->getSpeed()) / (SUMOReal) 2.0; + vmax = MIN2(vmax, ((getSpeed() + con.toEdge->getSpeed()) / (SUMOReal) 2.0)); + vmax = (getSpeed() + con.toEdge->getSpeed()) / (SUMOReal) 2.0; // - Position end = (*i).toEdge->getLaneShape((*i).toLane).getBegin(); - Position beg = getLaneShape((*i).fromLane).getEnd(); + Position end = con.toEdge->getLaneShape(con.toLane).getBegin(); + Position beg = getLaneShape(con.fromLane).getEnd(); assert(shape.size() >= 2); // get internal splits if any if (crossingPositions.first >= 0) { std::pair split = shape.splitAt(crossingPositions.first); - (*i).id = innerID + "_" + toString(lno); - (*i).vmax = vmax; - (*i).shape = split.first; - (*i).foeInternalLanes = foeInternalLanes; + con.id = innerID + "_" + toString(lno); + con.vmax = vmax; + con.shape = split.first; + con.foeInternalLanes = foeInternalLanes; + con.foeIncomingLanes = ""; // reset first because this may be called multiple times for (std::set::iterator q = tmpFoeIncomingLanes.begin(); q != tmpFoeIncomingLanes.end(); ++q) { - if ((*i).foeIncomingLanes.length() != 0) { - (*i).foeIncomingLanes += " "; + if (con.foeIncomingLanes.length() != 0) { + con.foeIncomingLanes += " "; } - (*i).foeIncomingLanes += *q; + con.foeIncomingLanes += *q; } - (*i).viaID = innerID + "_" + toString(splitNo + noInternalNoSplits); - (*i).viaVmax = vmax; - (*i).viaShape = split.second; - (*i).haveVia = true; + con.viaID = innerID + "_" + toString(splitNo + noInternalNoSplits); + con.viaVmax = vmax; + con.viaShape = split.second; + con.haveVia = true; splitNo++; } else { - (*i).id = innerID + "_" + toString(lno); - (*i).vmax = vmax; - (*i).shape = shape; + con.id = innerID + "_" + toString(lno); + con.vmax = vmax; + con.shape = shape; } @@ -1020,7 +1042,7 @@ SUMOReal -NBEdge::getAngleAtNode(const NBNode * const atNode) const { +NBEdge::getAngleAtNode(const NBNode* const atNode) const { if (atNode == myFrom) { return myGeom.getBegLine().atan2DegreeAngle(); } else { @@ -1053,7 +1075,7 @@ try { myLanes[i].shape = computeLaneShape(i); } catch (InvalidArgument& e) { - WRITE_WARNING("In edge '" + getID() + "': lane shape could not been determined (" + e.what() + ")"); + WRITE_WARNING("In edge '" + getID() + "': lane shape could not be determined (" + e.what() + ")"); myLanes[i].shape = myGeom; } } @@ -1298,7 +1320,7 @@ } // precompute priorities; needed as some kind of assumptions for // priorities of directions (see preparePriorities) - std::vector *priorities = preparePriorities(outgoing); + std::vector* priorities = preparePriorities(outgoing); // compute the sum of priorities (needed for normalisation) unsigned int prioSum = computePrioritySum(priorities); @@ -1351,7 +1373,7 @@ // (conversion from virtual to real edges is done) ToEdgeConnectionsAdder adder(transition); Bresenham::compute(&adder, static_cast(myLanes.size()), noVirtual); - const std::map > &l2eConns = adder.getBuiltConnections(); + const std::map >& l2eConns = adder.getBuiltConnections(); myConnections.clear(); for (std::map >::const_iterator i = l2eConns.begin(); i != l2eConns.end(); ++i) { const std::vector lanes = (*i).second; @@ -1367,10 +1389,10 @@ } -std::vector * +std::vector* NBEdge::preparePriorities(const EdgeVector* outgoing) { // copy the priorities first - std::vector *priorities = new std::vector(); + std::vector* priorities = new std::vector(); if (outgoing->size() == 0) { return priorities; } @@ -1410,7 +1432,7 @@ unsigned int -NBEdge::computePrioritySum(std::vector *priorities) { +NBEdge::computePrioritySum(std::vector* priorities) { unsigned int sum = 0; for (std::vector::iterator i = priorities->begin(); i != priorities->end(); i++) { sum += int(*i); @@ -1554,10 +1576,10 @@ bool NBEdge::setControllingTLInformation(const NBConnection& c, const std::string& tlID) { - int fromLane = c.getFromLane(); + const int fromLane = c.getFromLane(); NBEdge* toEdge = c.getTo(); - int toLane = c.getToLane(); - int tlIndex = c.getTLIndex(); + const int toLane = c.getToLane(); + const int tlIndex = c.getTLIndex(); // check whether the connection was not set as not to be controled previously TLSDisabledConnection tpl; tpl.fromLane = fromLane; @@ -1604,7 +1626,7 @@ (*i).tlLinkNo = tlIndex; no++; } else { - if ((*i).tlID != tlID && (*i).tlLinkNo == tlIndex) { + if ((*i).tlID != tlID && static_cast((*i).tlLinkNo) == tlIndex) { WRITE_WARNING("The lane " + toString((*i).fromLane) + " on edge " + getID() + " already had a traffic light signal."); hadError = true; } @@ -1851,7 +1873,7 @@ NBEdge::disallowVehicleClass(int lane, SUMOVehicleClass vclass) { if (lane < 0) { // all lanes are meant... for (unsigned int i = 0; i < myLanes.size(); i++) { - allowVehicleClass((int) i, vclass); + disallowVehicleClass((int) i, vclass); } } else { assert(lane < (int) myLanes.size()); @@ -1921,7 +1943,7 @@ } -void +void NBEdge::setPermissions(SVCPermissions permissions, int lane) { if (lane < 0) { for (unsigned int i = 0; i < myLanes.size(); i++) { @@ -1935,7 +1957,7 @@ } -void +void NBEdge::setPreferredVehicleClass(SVCPermissions permissions, int lane) { if (lane < 0) { for (unsigned int i = 0; i < myLanes.size(); i++) { @@ -1949,7 +1971,7 @@ } -SVCPermissions +SVCPermissions NBEdge::getPermissions(int lane) const { if (lane < 0) { SVCPermissions result = 0; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBEdge.h sumo-0.16.0~dfsg/src/netbuild/NBEdge.h --- sumo-0.15.0~dfsg/src/netbuild/NBEdge.h 2012-03-08 00:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBEdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdge.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NBEdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The representation of a single edge during network building /****************************************************************************/ @@ -38,6 +38,7 @@ #include #include "NBCont.h" #include +#include #include #include #include @@ -46,6 +47,7 @@ #include #include #include "NBHelpers.h" +#include "NBSign.h" // =========================================================================== @@ -66,7 +68,7 @@ * @class NBEdge * @brief The representation of a single edge during network building */ -class NBEdge : public Named { +class NBEdge : public Named, public Parameterised { /** used for the computation of connections to following edges */ friend class NBEdgeSuccessorBuilder; friend class NBEdgeCont; @@ -119,8 +121,8 @@ * @brief An (internal) definition of a single lane of an edge */ struct Lane { - Lane(NBEdge* e) : - speed(e->getSpeed()), permissions(SVCFreeForAll), preferred(0), + Lane(NBEdge* e) : + speed(e->getSpeed()), permissions(SVCFreeForAll), preferred(0), offset(e->getOffset()), width(e->getWidth()) {} /// @brief The lane's shape PositionVector shape; @@ -134,6 +136,8 @@ SUMOReal offset; /// @brief This lane's width SUMOReal width; + /// @brief An original ID, if given (@todo: is only seldom used, should be stored somewhere else, probably) + std::string origID; }; @@ -167,6 +171,8 @@ bool mayDefinitelyPass; + std::string origID; + std::string id; PositionVector shape; SUMOReal vmax; @@ -218,7 +224,7 @@ SUMOReal speed, unsigned int nolanes, int priority, SUMOReal width, SUMOReal offset, const std::string& streetName = "", - LaneSpreadFunction spread = LANESPREAD_RIGHT) ; + LaneSpreadFunction spread = LANESPREAD_RIGHT); /** @brief Constructor @@ -248,7 +254,7 @@ PositionVector geom, const std::string& streetName = "", LaneSpreadFunction spread = LANESPREAD_RIGHT, - bool tryIgnoreNodePositions = false) ; + bool tryIgnoreNodePositions = false); /** @brief Constructor * @@ -266,7 +272,7 @@ /** @brief Destructor */ - ~NBEdge() ; + ~NBEdge(); /** @brief Resets initial values @@ -289,8 +295,13 @@ PositionVector geom, SUMOReal width, SUMOReal offset, const std::string& streetName, LaneSpreadFunction spread = LANESPREAD_RIGHT, - bool tryIgnoreNodePositions = false) ; + bool tryIgnoreNodePositions = false); + /** @brief Resets nodes but keeps all other values the same (used when joining) + * @param[in] from The node the edge starts at + * @param[in] to The node the edge ends at + */ + void reinitNodes(NBNode* from, NBNode* to); /// @name Applying offset @@ -300,7 +311,7 @@ * @param[in] xoff The x-offset to apply * @param[in] yoff The y-offset to apply */ - void reshiftPosition(SUMOReal xoff, SUMOReal yoff) ; + void reshiftPosition(SUMOReal xoff, SUMOReal yoff); /// @} @@ -441,7 +452,7 @@ /** @brief Returns the lane definitions * @return The stored lane definitions */ - const std::vector &getLanes() const { + const std::vector& getLanes() const { return myLanes; } //@} @@ -486,7 +497,7 @@ * @todo Recheck usage, disallow access * @see computeLaneShapes */ - void setGeometry(const PositionVector& g, bool inner = false) ; + void setGeometry(const PositionVector& g, bool inner = false); /** @brief Adds a further geometry point @@ -498,7 +509,7 @@ * @param[in] index The position at which the point shall be added * @param[in] p The point to add */ - void addGeometryPoint(int index, const Position& p) ; + void addGeometryPoint(int index, const Position& p); /** @brief Recomputeds the lane shapes to terminate at the node shape @@ -506,24 +517,24 @@ * calculated and the lane shorted accordingly. The edge length is then set * to the average of all lane lenghts (which may differ). This average length is used as the lane * length when writing the network. - * @note All lanes of an edge in a sumo net must have the same nominal length + * @note All lanes of an edge in a sumo net must have the same nominal length * but may differ in actual geomtric length. - * @note Depends on previous call to NBNodeCont::computeNodeShapes + * @note Depends on previous call to NBNodeCont::computeNodeShapes */ - void computeEdgeShape() ; + void computeEdgeShape(); /** @brief Returns the shape of the nth lane * @return The shape of the lane given by its index (counter from right) */ - const PositionVector& getLaneShape(unsigned int i) const ; + const PositionVector& getLaneShape(unsigned int i) const; /** @brief (Re)sets how the lanes lateral offset shall be computed * @param[in] spread The type of lateral offset to apply * @see LaneSpreadFunction */ - void setLaneSpreadFunction(LaneSpreadFunction spread) ; + void setLaneSpreadFunction(LaneSpreadFunction spread); /** @brief Returns how this edge's lanes' lateral offset is computed @@ -665,7 +676,7 @@ /** @brief Returns the connections * @return This edge's connections to following edges */ - const std::vector &getConnections() const { + const std::vector& getConnections() const { return myConnections; } @@ -673,18 +684,18 @@ /** @brief Returns the connections * @return This edge's connections to following edges */ - std::vector &getConnections() { + std::vector& getConnections() { return myConnections; } - /** @brief Returns the list of outgoing edges without the turnaround sorted in clockwise direction + /** @brief Returns the list of outgoing edges without the turnaround sorted in clockwise direction * @return Connected edges, sorted clockwise */ const EdgeVector* getConnectedSorted(); - /** @brief Returns the list of outgoing edges unsorted + /** @brief Returns the list of outgoing edges unsorted * @return Connected edges */ EdgeVector getConnectedEdges() const; @@ -724,7 +735,7 @@ void invalidateConnections(bool reallowSetting = false); void replaceInConnections(NBEdge* which, NBEdge* by, unsigned int laneOff); - void replaceInConnections(NBEdge* which, const std::vector &origConns); + void replaceInConnections(NBEdge* which, const std::vector& origConns); void copyConnectionsFrom(NBEdge* src); /// @} @@ -735,7 +746,7 @@ * @param[in] edge The edge which may be the turnaround direction * @return Whether the given edge is this edge's turnaround direction */ - bool isTurningDirectionAt(const NBNode* n, const NBEdge* const edge) const ; + bool isTurningDirectionAt(const NBNode* n, const NBEdge* const edge) const; void setTurningDestination(NBEdge* e); @@ -774,7 +785,7 @@ /// @} - + /** @brief Sets the junction priority of the edge * @param[in] node The node for which the edge's priority is given @@ -839,7 +850,7 @@ * of this edge to the leftmost lane of myTurnDestination). * @param[in] noTLSControlled Whether the turnaround shall not be connected if this edge is controlled by a tls */ - void appendTurnaround(bool noTLSControlled) ; + void appendTurnaround(bool noTLSControlled); @@ -857,7 +868,7 @@ bool lanesWereAssigned() const; - bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const ; + bool mayBeTLSControlled(int fromLane, NBEdge* toEdge, int toLane) const; /// Returns if the link could be set as to be controlled bool setControllingTLInformation(const NBConnection& c, const std::string& tlID); @@ -876,7 +887,7 @@ bool expandableBy(NBEdge* possContinuation) const; void append(NBEdge* continuation); - bool hasSignalisedConnectionTo(const NBEdge* const e) const ; + bool hasSignalisedConnectionTo(const NBEdge* const e) const; void moveOutgoingConnectionsFrom(NBEdge* e, unsigned int laneOff); @@ -891,13 +902,13 @@ /** @brief Returns the angle of the edge's geometry at the given node - * - * The angle is signed, regards direction, and starts at 12 o'clock + * + * The angle is signed, regards direction, and starts at 12 o'clock * (north->south), proceeds positive clockwise. * @param[in] node The node for which the edge's angle shall be returned * @return This edge's angle at the given node */ - SUMOReal getAngleAtNode(const NBNode * const node) const; + SUMOReal getAngleAtNode(const NBNode* const node) const; void incLaneNo(unsigned int by); @@ -953,6 +964,14 @@ void buildInnerEdges(const NBNode& n, unsigned int noInternalNoSplits, unsigned int& lno, unsigned int& splitNo); + inline const std::vector& getSigns() const { + return mySigns; + } + + inline void addSign(NBSign sign) { + mySigns.push_back(sign); + } + private: /** @@ -977,9 +996,9 @@ ~ToEdgeConnectionsAdder() { } /// executes a bresenham - step - void execute(const unsigned int lane, const unsigned int virtEdge) ; + void execute(const unsigned int lane, const unsigned int virtEdge); - const std::map > &getBuiltConnections() const { + const std::map >& getBuiltConnections() const { return myConnections; } @@ -1041,7 +1060,7 @@ std::pair laneOffset(const Position& from, const Position& to, SUMOReal lanewidth, unsigned int lane) throw(InvalidArgument); - void computeLaneShapes() ; + void computeLaneShapes(); @@ -1061,7 +1080,7 @@ * @param[in] noLanes The number of lanes this edge has * @param[in] tryIgnoreNodePositions Does not add node geometries if geom.size()>=2 */ - void init(unsigned int noLanes, bool tryIgnoreNodePositions) ; + void init(unsigned int noLanes, bool tryIgnoreNodePositions); /** divides the lanes on the outgoing edges */ @@ -1069,11 +1088,11 @@ /** recomputes the priorities and manipulates them for a distribution of lanes on edges which is more like in real-life */ - std::vector *preparePriorities( + std::vector* preparePriorities( const EdgeVector* outgoing); /** computes the sum of the given list's entries (sic!) */ - unsigned int computePrioritySum(std::vector *priorities); + unsigned int computePrioritySum(std::vector* priorities); /// @name Setting and getting connections @@ -1095,7 +1114,6 @@ */ PositionVector startShapeAt(const PositionVector& laneShape, const NBNode* startNode, unsigned int laneIndex) const; - private: /** @brief The building step * @see EdgeBuildingStep @@ -1177,6 +1195,10 @@ std::string myStreetName; + /// @brief the street signs along this edge + std::vector mySigns; + + public: /** * @class tls_disable_finder diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBEdgeCont.cpp sumo-0.16.0~dfsg/src/netbuild/NBEdgeCont.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBEdgeCont.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBEdgeCont.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdgeCont.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: NBEdgeCont.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for edges, including some functionality operating on multiple edges /****************************************************************************/ @@ -53,7 +53,6 @@ #include "NBDistrictCont.h" #include #include "NBTypeCont.h" -#include #include #include #include @@ -66,11 +65,11 @@ // =========================================================================== // method definitions // =========================================================================== -NBEdgeCont::NBEdgeCont(NBTypeCont& tc) : - myEdgesSplit(0), - myTypeCont(tc), +NBEdgeCont::NBEdgeCont(NBTypeCont& tc) : + myEdgesSplit(0), myVehicleClasses2Keep(0), - myVehicleClasses2Remove(0) + myVehicleClasses2Remove(0), + myTypeCont(tc) {} @@ -119,7 +118,7 @@ // !!! throw something if length<4 || length%2!=0? std::vector poly; for (std::vector::iterator i = polyS.begin(); i != polyS.end(); ++i) { - poly.push_back(TplConvert::_2SUMOReal((*i).c_str())); // !!! may throw something anyhow... + poly.push_back(TplConvert::_2SUMOReal((*i).c_str())); // !!! may throw something anyhow... } if (poly.size() < 4) { throw ProcessError("Invalid boundary: need at least 2 coordinates"); @@ -181,8 +180,8 @@ } -bool -NBEdgeCont::ignoreFilterMatch(NBEdge *edge) { +bool +NBEdgeCont::ignoreFilterMatch(NBEdge* edge) { // remove edges which allow a speed below a set one (set using "keep-edges.min-speed") if (edge->getSpeed() < myEdgesMinSpeed) { return true; @@ -250,9 +249,7 @@ NBEdge* -NBEdgeCont::retrievePossiblySplitted(const std::string& id, - const std::string& hint, - bool incoming) const { +NBEdgeCont::retrievePossiblySplit(const std::string& id, const std::string& hint, bool incoming) const { // try to retrieve using the given name (iterative) NBEdge* edge = retrieve(id); if (edge != 0) { @@ -286,7 +283,7 @@ NBEdge* -NBEdgeCont::retrievePossiblySplitted(const std::string& id, SUMOReal pos) const { +NBEdgeCont::retrievePossiblySplit(const std::string& id, SUMOReal pos) const { // check whether the edge was not split, yet NBEdge* edge = retrieve(id); if (edge != 0) { @@ -349,7 +346,7 @@ } -void +void NBEdgeCont::rename(NBEdge* edge, const std::string& newID) { if (myEdges.count(newID) != 0) { throw ProcessError("Attempt to rename edge using existing id '" + newID + "'"); @@ -556,7 +553,7 @@ void -NBEdgeCont::appendTurnarounds(const std::set &ids, bool noTLSControlled) { +NBEdgeCont::appendTurnarounds(const std::set& ids, bool noTLSControlled) { for (std::set::const_iterator it = ids.begin(); it != ids.end(); it++) { myEdges[*it]->appendTurnaround(noTLSControlled); } @@ -678,6 +675,42 @@ // ----- other +void +NBEdgeCont::addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass) { + myConnections.push_back(PostProcessConnection(from, fromLane, to, toLane, mayDefinitelyPass)); +} + + +void +NBEdgeCont::recheckPostProcessConnections() { + for (std::vector::const_iterator i = myConnections.begin(); i != myConnections.end(); ++i) { + NBEdge* from = retrieve((*i).from); + NBEdge* to = retrieve((*i).to); + if (from != 0 && to != 0) { + if (!from->addLane2LaneConnection((*i).fromLane, to, (*i).toLane, NBEdge::L2L_USER, false, (*i).mayDefinitelyPass)) { + WRITE_WARNING("Could not insert connection between '" + (*i).from + "' and '" + (*i).to + "' after build."); + } + } + } + // during loading we also kept some ambiguous connections in hope they might be valid after processing + // we need to make sure that all invalid connections are removed now + for (EdgeCont::iterator it = myEdges.begin(); it != myEdges.end(); ++it) { + NBEdge* edge = it->second; + NBNode* to = edge->getToNode(); + // make a copy because we may delete connections + std::vector connections = edge->getConnections(); + for (std::vector::iterator it_con = connections.begin(); it_con != connections.end(); ++it_con) { + NBEdge::Connection& c = *it_con; + if (c.toEdge != 0 && c.toEdge->getFromNode() != to) { + WRITE_WARNING("Found and removed invalid connection from " + edge->getID() + + " to " + c.toEdge->getID() + " via " + to->getID()); + edge->removeFromConnections(c.toEdge); + } + } + } +} + + EdgeVector NBEdgeCont::getGeneratedFrom(const std::string& id) const { size_t len = id.length(); @@ -721,7 +754,7 @@ void -NBEdgeCont::guessRoundabouts(std::vector > &marked) { +NBEdgeCont::guessRoundabouts(std::vector >& marked) { // step 1: keep only those edges which have no turnarounds std::set candidates; for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { @@ -731,74 +764,102 @@ candidates.insert(e); } } + // step 2: std::set visited; for (std::set::const_iterator i = candidates.begin(); i != candidates.end(); ++i) { - std::set loopEdges; - // start with a random edge, keep it as "begin" - NBEdge* begin = (*i); - if (find(visited.begin(), visited.end(), begin) != visited.end()) { + EdgeVector loopEdges; + // start with a random edge (this doesn't have to be a roundabout edge) + // loop over connected edges (using always the leftmost one) + // and keep the list in loopEdges + // continue until we loop back onto a loopEdges and extract the loop + NBEdge* e = (*i); + if (visited.count(e) > 0) { // already seen continue; } - NBEdge* e = (*i); - // loop over connected edges (using always the leftmost one) - bool noLoop = false; + loopEdges.push_back(e); + bool doLoop = true; do { visited.insert(e); - EdgeVector edges = e->getToNode()->getEdges(); + const EdgeVector& edges = e->getToNode()->getEdges(); if (edges.size() < 2) { - noLoop = true; + doLoop = false; break; } EdgeVector::const_iterator me = find(edges.begin(), edges.end(), e); NBContHelper::nextCW(edges, me); NBEdge* left = *me; - loopEdges.insert(left); - if (left == begin) { - break; - } - if (find(candidates.begin(), candidates.end(), left) == candidates.end()) { - noLoop = true; + EdgeVector::const_iterator loopClosed = find(loopEdges.begin(), loopEdges.end(), left); + const size_t loopSize = loopEdges.end() - loopClosed; + if (loopSize > 0) { + // loop found + if (loopSize < 3) { + doLoop = false; // need at least 3 edges for a roundabout + } else if (loopSize < loopEdges.size()) { + // remove initial edges not belonging to the loop + EdgeVector(loopEdges.begin() + (loopEdges.size() - loopSize), loopEdges.end()).swap(loopEdges); + } break; } - if (find(visited.begin(), visited.end(), left) != visited.end()) { - noLoop = true; - break; + if (visited.count(left) > 0) { + doLoop = false; + } else { + // keep going + loopEdges.push_back(left); + e = left; } - e = left; - } while (true); + } while (doLoop); // mark collected edges in the case a loop (roundabout) was found - if (!noLoop) { - for (std::set::const_iterator j = loopEdges.begin(); j != loopEdges.end(); ++j) { - + if (doLoop) { + std::set loopEdgesSet(loopEdges.begin(), loopEdges.end()); + for (std::set::const_iterator j = loopEdgesSet.begin(); j != loopEdgesSet.end(); ++j) { // disable turnarounds on incoming edges - const EdgeVector& incoming = (*j)->getToNode()->getIncomingEdges(); - const EdgeVector& outgoing = (*j)->getToNode()->getOutgoingEdges(); + NBNode* node = (*j)->getToNode(); + const EdgeVector& incoming = node->getIncomingEdges(); for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); ++k) { - if (loopEdges.find(*k) != loopEdges.end()) { + NBEdge* inEdge = *k; + if (loopEdgesSet.count(inEdge) > 0) { continue; } - if ((*k)->getStep() >= NBEdge::LANES2LANES_USER) { + if ((inEdge)->getStep() >= NBEdge::LANES2LANES_USER) { continue; } - for (EdgeVector::const_iterator l = outgoing.begin(); l != outgoing.end(); ++l) { - if (loopEdges.find(*l) != loopEdges.end()) { - (*k)->addEdge2EdgeConnection(*l); - } else { - (*k)->removeFromConnections(*l, -1); - } - } + inEdge->removeFromConnections(inEdge->getTurnDestination(), -1); } - - // let the connections to succeeding roundabout edge have a higher priority - (*j)->setJunctionPriority((*j)->getToNode(), 1000); + (*j)->setJunctionPriority(node, 1000); } - marked.push_back(loopEdges); + marked.push_back(loopEdgesSet); } } } +void +NBEdgeCont::generateStreetSigns() { + for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) { + NBEdge* e = i->second; + // is this a "real" junction? + // XXX nyi + //continue + const SUMOReal offset = e->getLength() - 3; + switch (e->getToNode()->getType()) { + case NODETYPE_PRIORITY_JUNCTION: + // yield or major? + if (e->getJunctionPriority(e->getToNode()) > 0) { + e->addSign(NBSign(NBSign::SIGN_TYPE_PRIORITY, offset)); + } else { + e->addSign(NBSign(NBSign::SIGN_TYPE_YIELD, offset)); + } + break; + case NODETYPE_RIGHT_BEFORE_LEFT: + e->addSign(NBSign(NBSign::SIGN_TYPE_RIGHT_BEFORE_LEFT, offset)); + break; + default: + break; + } + } +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBEdgeCont.h sumo-0.16.0~dfsg/src/netbuild/NBEdgeCont.h --- sumo-0.15.0~dfsg/src/netbuild/NBEdgeCont.h 2012-03-08 00:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBEdgeCont.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdgeCont.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NBEdgeCont.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for edges, including some functionality operating on multiple edges /****************************************************************************/ @@ -68,11 +68,11 @@ /** @brief Constructor * @param[in] tc The net builded; used to obtain types */ - NBEdgeCont(NBTypeCont& tc) ; + NBEdgeCont(NBTypeCont& tc); /// @brief Destructor - ~NBEdgeCont() ; + ~NBEdgeCont(); /** @brief Initialises the storage by applying given options @@ -87,7 +87,7 @@ /** @brief Deletes all edges */ - void clear() ; + void clear(); @@ -108,7 +108,7 @@ * @param[in] ignorePrunning Whether this edge must not be prunned * @return Whether the edge was valid (no edge with the same id is already known) */ - bool insert(NBEdge* edge, bool ignorePrunning = false) ; + bool insert(NBEdge* edge, bool ignorePrunning = false); /** @brief Returns the edge that has the given id @@ -119,7 +119,7 @@ * @param[in] bool Whether extracted edges shall be retrieved as well * @return The edge with the given id, 0 if no such edge exists */ - NBEdge* retrieve(const std::string& id, bool retrieveExtracted = false) const ; + NBEdge* retrieve(const std::string& id, bool retrieveExtracted = false) const; /** @brief Tries to retrieve an edge, even if it is splitted @@ -134,8 +134,7 @@ * @return The searched edge * @todo Recheck usage */ - NBEdge* retrievePossiblySplitted(const std::string& id, - const std::string& hint, bool incoming) const ; + NBEdge* retrievePossiblySplit(const std::string& id, const std::string& hint, bool incoming) const; /** @brief Tries to retrieve an edge, even if it is splitted @@ -148,7 +147,7 @@ * @return The searched edge * @todo Recheck usage */ - NBEdge* retrievePossiblySplitted(const std::string& id, SUMOReal pos) const ; + NBEdge* retrievePossiblySplit(const std::string& id, SUMOReal pos) const; /** @brief Removes the given edge from the container (deleting it) @@ -157,7 +156,7 @@ * @param[in] edge The edge to remove * @todo Recheck whether the district cont is needed - if districts are processed using an external tool */ - void erase(NBDistrictCont& dc, NBEdge* edge) ; + void erase(NBDistrictCont& dc, NBEdge* edge); /** @brief Removes the given edge from the container like erase but does not @@ -167,6 +166,7 @@ * @param[in] edge The edge to remove * @param[in] remember Whether to keep this edge for future reference * @todo Recheck whether the district cont is needed - if districts are processed using an external tool + * @todo Recheck whether this is used at all and why */ void extract(NBDistrictCont& dc, NBEdge* edge, bool remember = false); @@ -205,7 +205,7 @@ * @exception ProcessError If connections between the edges can not be built * @see NBEdge::splitAt(NBDistrictCont &, NBEdge *, NBNode *, const std::string &, const std::string &, unsigned int , unsigned int) */ - bool splitAt(NBDistrictCont& dc, NBEdge* edge, NBNode* node) ; + bool splitAt(NBDistrictCont& dc, NBEdge* edge, NBNode* node); /** @brief Splits the edge at the position nearest to the given node using the given modifications @@ -230,7 +230,7 @@ */ bool splitAt(NBDistrictCont& dc, NBEdge* edge, NBNode* node, const std::string& firstEdgeName, const std::string& secondEdgeName, - unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge) ; + unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge); /** @brief Splits the edge at the position nearest to the given node using the given modifications @@ -247,7 +247,7 @@ */ bool splitAt(NBDistrictCont& dc, NBEdge* edge, SUMOReal edgepos, NBNode* node, const std::string& firstEdgeName, const std::string& secondEdgeName, - unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge) ; + unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge); /// @} @@ -267,7 +267,7 @@ * @return All ids of known edges * @todo Recheck usage, probably, filling a given vector would be better... */ - std::vector getAllNames() const ; + std::vector getAllNames() const; /** @brief Returns the number of edge splits @@ -313,7 +313,7 @@ * @todo Recheck whether a visitor-pattern should be used herefor * @see NBEdge::sortOutgoingLanesConnections */ - void sortOutgoingLanesConnections() ; + void sortOutgoingLanesConnections(); /** @brief Computes for each edge the approached edges @@ -324,7 +324,7 @@ * @todo Recheck whether a visitor-pattern should be used herefor * @see NBEdge::computeEdge2Edges */ - void computeEdge2Edges(bool noLeftMovers) ; + void computeEdge2Edges(bool noLeftMovers); /** @brief Computes for each edge which lanes approach the next edges @@ -334,7 +334,7 @@ * @todo Recheck whether a visitor-pattern should be used herefor * @see NBEdge::computeLanes2Edges */ - void computeLanes2Edges() ; + void computeLanes2Edges(); /** @brief Rechecks whether all lanes have a successor for each of the stored edges @@ -344,7 +344,7 @@ * @todo Recheck whether a visitor-pattern should be used herefor * @see NBEdge::recheckLanes */ - void recheckLanes() ; + void recheckLanes(); /** @brief Appends turnarounds to all edges stored in the container @@ -355,7 +355,7 @@ * @todo Recheck whether a visitor-pattern should be used herefor * @see NBEdge::appendTurnaround */ - void appendTurnarounds(bool noTLSControlled) ; + void appendTurnarounds(bool noTLSControlled); /** @brief Appends turnarounds to all edges stored in the container @@ -364,7 +364,7 @@ * @param[in] noTLSControlled Whether the turnaround shall not be connected if the edge is controlled by a tls * @see NBEdge::appendTurnaround */ - void appendTurnarounds(const std::set &ids, bool noTLSControlled); + void appendTurnarounds(const std::set& ids, bool noTLSControlled); /** @brief Computes the shapes of all edges stored in the container @@ -375,7 +375,7 @@ * @todo Recheck usage * @see NBEdge::computeEdgeShape */ - void computeEdgeShapes() ; + void computeEdgeShapes(); /** @brief Computes the shapes of all lanes of all edges stored in the container @@ -386,7 +386,7 @@ * @todo Recheck usage * @see NBEdge::computeLaneShapes */ - void recomputeLaneShapes() ; + void recomputeLaneShapes(); /** @brief Clears information about controlling traffic lights for all connenections of all edges @@ -402,14 +402,14 @@ * @todo Recheck and describe usage */ void joinSameNodeConnectingEdges(NBDistrictCont& dc, - NBTrafficLightLogicCont& tlc, EdgeVector edges) ; + NBTrafficLightLogicCont& tlc, EdgeVector edges); /** @brief Rechecks whether the lane spread is proper * * @todo Recheck usage; check whether this is really needed and whether it works at all */ - void recheckLaneSpread() ; + void recheckLaneSpread(); /// @} @@ -417,7 +417,7 @@ /** @brief Determines which edges belong to roundabouts and increases their priority * @param[out] marked Edges which belong to a roundabout are stored here */ - void guessRoundabouts(std::vector > &marked) ; + void guessRoundabouts(std::vector >& marked); /** @brief Returns whether the built edges are left-handed @@ -447,6 +447,28 @@ void rename(NBEdge* edge, const std::string& newID); + + /// @name Connections handling + /// @{ + + /** @brief Adds a connection which could not be set during loading + * @param[in] from The id of the edge the connection starts at + * @param[in] fromLane The number of the lane the connection starts at + * @param[in] to The id of the edge the connection ends at + * @param[in] toLane The number of the lane the connection ends at + * @param[in] mayDefinitelyPass Whether the connection may be passed without braking + */ + void addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass); + + + /** @brief Try to set any stored connections + */ + void recheckPostProcessConnections(); + /// @} + + /// @brief assigns street signs to edges based on toNode types + void generateStreetSigns(); + private: /** @brief Returns the edges which have been built by splitting the edge of the given id * @@ -454,14 +476,45 @@ * @return List of all edges which have been built by splitting the original edge * @todo Recheck usage */ - EdgeVector getGeneratedFrom(const std::string& id) const ; + EdgeVector getGeneratedFrom(const std::string& id) const; /// @brief Returns true if this edge matches one of the removal criteria - bool ignoreFilterMatch(NBEdge *edge); + bool ignoreFilterMatch(NBEdge* edge); private: + /** @struct PostProcessConnection + * @brief A structure representing a connection between two lanes + */ + struct PostProcessConnection { + public: + /** @brief Constructor + * @param[in] from The id of the edge the connection starts at + * @param[in] fromLane The number of the lane the connection starts at + * @param[in] to The id of the edge the connection ends at + * @param[in] toLane The number of the lane the connection ends at + * @param[in] mayDefinitelyPass Whether the connection may be passed without braking + */ + PostProcessConnection(const std::string& from_, int fromLane_, const std::string& to_, int toLane_, bool mayDefinitelyPass_) + : from(from_), fromLane(fromLane_), to(to_), toLane(toLane_), mayDefinitelyPass(mayDefinitelyPass_) + { } + /// @brief The id of the edge the connection starts at + std::string from; + /// @brief The number of the lane the connection starts at + int fromLane; + /// @brief The id of the edge the connection ends at + std::string to; + /// @brief The number of the lane the connection ends at + int toLane; + /// @brief Whether the connection may be passed without braking + bool mayDefinitelyPass; + }; + + /// @brief The list of connections to recheck + std::vector myConnections; + + /// @brief The type of the dictionary where an edge may be found by its id typedef std::map EdgeCont; @@ -510,7 +563,6 @@ /// @brief Boundary within which an edge must be located in order to be kept PositionVector myPrunningBoundary; - /// @} diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBFrame.cpp sumo-0.16.0~dfsg/src/netbuild/NBFrame.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBFrame.cpp 2012-03-02 00:03:39.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBFrame.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 09.05.2011 -/// @version $Id: NBFrame.cpp 11985 2012-03-01 13:52:27Z namdre $ +/// @version $Id: NBFrame.cpp 13112 2012-12-03 07:46:39Z namdre $ /// // Sets and checks options for netbuild /****************************************************************************/ @@ -132,9 +132,9 @@ oc.addDescription("junctions.join", "Processing", "Joins junctions that are close to each other (recommended for OSM import)"); - oc.doRegister("junctions.join-dist", new Option_Float(15)); + oc.doRegister("junctions.join-dist", new Option_Float(10)); oc.addDescription("junctions.join-dist", "Processing", - "Determines the maximal distance for joining junctions (defaults to 15)"); + "Determines the maximal distance for joining junctions (defaults to 10)"); if (!forNetgen) { oc.doRegister("junctions.join-exclude", new Option_String()); @@ -175,6 +175,10 @@ oc.addSynonyme("tls.join", "try-join-tls", true); oc.addDescription("tls.join", "TLS Building", "Tries to cluster tls-controlled nodes"); // !!! describe + oc.doRegister("tls.join-dist", new Option_Float(20)); + oc.addDescription("tls.join-dist", "Processing", + "Determines the maximal distance for joining traffic lights (defaults to 20)"); + // computational oc.doRegister("tls.green.time", new Option_Integer(31)); oc.addSynonyme("tls.green.time", "traffic-light-green", true); @@ -206,7 +210,7 @@ // edge pruning oc.doRegister("keep-edges.min-speed", new Option_Float()); oc.addSynonyme("keep-edges.min-speed", "edges-min-speed", true); - oc.addDescription("keep-edges.min-speed", "Edge Removal", "Only keep edges with speed > FLOAT"); + oc.addDescription("keep-edges.min-speed", "Edge Removal", "Only keep edges with speed in meters/second > FLOAT"); oc.doRegister("remove-edges.explicit", new Option_String()); oc.addSynonyme("remove-edges.explicit", "remove-edges"); @@ -282,6 +286,10 @@ oc.doRegister("ramps.set", new Option_String()); oc.addSynonyme("ramps.set", "ramp-guess.explicite", true); oc.addDescription("ramps.set", "Ramp Guessing", "Tries to handle the given edges as ramps"); + + oc.doRegister("ramps.no-split", new Option_Bool(false)); + oc.addSynonyme("ramps.no-split", "ramp-guess.no-split", true); + oc.addDescription("ramps.no-split", "Ramp Guessing", "Avoids edge splitting"); } } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.cpp sumo-0.16.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NBLoadedSUMOTLDef.h /// @author Jakob Erdmann /// @date Mar 2011 -/// @version $Id: NBLoadedSUMOTLDef.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBLoadedSUMOTLDef.cpp 13116 2012-12-03 09:23:15Z namdre $ /// // A complete traffic light logic loaded from a sumo-net. (opted to reimplement // since NBLoadedTLDef is quite vissim specific) @@ -49,17 +49,18 @@ // =========================================================================== NBLoadedSUMOTLDef::NBLoadedSUMOTLDef(const std::string& id, const std::string& programID, SUMOTime offset) : - NBTrafficLightDefinition(id, programID), + NBTrafficLightDefinition(id, programID, offset), myTLLogic(0) { - myTLLogic = new NBTrafficLightLogic(id, programID, 0); - myTLLogic->setOffset(offset); + myTLLogic = new NBTrafficLightLogic(id, programID, 0, offset); } NBLoadedSUMOTLDef::NBLoadedSUMOTLDef(NBTrafficLightDefinition* def, NBTrafficLightLogic* logic) : - NBTrafficLightDefinition(def->getID(), def->getProgramID()), + NBTrafficLightDefinition(def->getID(), def->getProgramID(), def->getOffset()), myTLLogic(new NBTrafficLightLogic(logic)), - myOriginalNodes(def->getNodes().begin(), def->getNodes().end()) { + myOriginalNodes(def->getNodes().begin(), def->getNodes().end()) +{ + assert(def->getOffset() == logic->getOffset()); myControlledLinks = def->getControlledLinks(); } @@ -119,7 +120,7 @@ // edges the links are starting at, respectively for (NBConnectionVector::const_iterator it = myControlledLinks.begin(); it != myControlledLinks.end(); it++) { const NBConnection& c = *it; - assert(c.getTLIndex() < myTLLogic->getNumLinks()); + assert(c.getTLIndex() < (int)myTLLogic->getNumLinks()); NBEdge* edge = c.getFrom(); edge->setControllingTLInformation(c, getID()); } @@ -160,11 +161,23 @@ void NBLoadedSUMOTLDef::removeConnection(const NBConnection& conn, bool reconstruct) { - NBConnectionVector::iterator it = find(myControlledLinks.begin(), myControlledLinks.end(), conn); + NBConnectionVector::iterator it = myControlledLinks.begin(); + // find the connection but ignore its TLIndex since it might have been + // invalidated by an earlier removal + for (; it != myControlledLinks.end(); ++it) { + if (it->getFrom() == conn.getFrom() && + it->getTo() == conn.getTo() && + it->getFromLane() == conn.getFromLane() && + it->getToLane() == conn.getToLane()) { + break; + } + } if (it == myControlledLinks.end()) { - throw ProcessError("Attempt to remove nonexistant connection"); + // a traffic light doesn't always controll all connections at a junction + // especially when using the option --tls.join + return; } - const int removed = conn.getTLIndex(); + const int removed = it->getTLIndex(); // remove the connection myControlledLinks.erase(it); if (reconstruct) { @@ -194,5 +207,12 @@ } } + +void +NBLoadedSUMOTLDef::setOffset(SUMOTime offset) { + myOffset = offset; + myTLLogic->setOffset(offset); +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.h sumo-0.16.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.h --- sumo-0.15.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBLoadedSUMOTLDef.h 2012-12-04 00:02:28.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NBLoadedSUMOTLDef.h /// @author Jakob Erdmann /// @date Mar 2011 -/// @version $Id: NBLoadedSUMOTLDef.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBLoadedSUMOTLDef.h 13116 2012-12-03 09:23:15Z namdre $ /// // A complete traffic light logic loaded from a sumo-net. (opted to reimplement // since NBLoadedTLDef is quite vissim specific) @@ -66,12 +66,12 @@ /// @brief Destructor - ~NBLoadedSUMOTLDef() ; + ~NBLoadedSUMOTLDef(); /** @brief Informs edges about being controlled by a tls * @param[in] ec The container of edges */ - void setTLControllingInformation(const NBEdgeCont& ec) const ; + void setTLControllingInformation(const NBEdgeCont& ec) const; /** @brief Replaces occurences of the removed edge in incoming/outgoing edges of all definitions * @param[in] removed The removed edge @@ -79,7 +79,7 @@ * @param[in] outgoing The edges to use instead if an outgoing edge was removed */ void remapRemoved(NBEdge* removed, - const EdgeVector& incoming, const EdgeVector& outgoing) ; + const EdgeVector& incoming, const EdgeVector& outgoing); /** @brief Replaces a removed edge/lane @@ -89,7 +89,7 @@ * @param[in] byLane This edge's lane to insert instead */ void replaceRemoved(NBEdge* removed, int removedLane, - NBEdge* by, int byLane) ; + NBEdge* by, int byLane); /** @brief Adds a phase to the logic * the new phase is inserted at the end of the list of already added phases @@ -116,6 +116,11 @@ return myTLLogic; } + /** @brief Sets the offset of this tls + * @param[in] offset The offset of this cycle + */ + void setOffset(SUMOTime offset); + protected: /** @brief Collects the links participating in this traffic light @@ -130,7 +135,7 @@ * @return The computed logic */ NBTrafficLightLogic* myCompute(const NBEdgeCont& ec, - unsigned int brakingTime) ; + unsigned int brakingTime); bool amInvalid() const; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBLoadedTLDef.cpp sumo-0.16.0~dfsg/src/netbuild/NBLoadedTLDef.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBLoadedTLDef.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBLoadedTLDef.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: NBLoadedTLDef.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: NBLoadedTLDef.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A loaded (complete) traffic light logic /****************************************************************************/ @@ -72,8 +72,7 @@ void -NBLoadedTLDef::SignalGroup::setYellowTimes(SUMOTime tRedYellow, - SUMOTime tYellow) { +NBLoadedTLDef::SignalGroup::setYellowTimes(SUMOTime tRedYellow, SUMOTime tYellow) { myTRedYellow = tRedYellow; myTYellow = tYellow; } @@ -81,14 +80,16 @@ void NBLoadedTLDef::SignalGroup::sortPhases() { - sort(myPhases.begin(), myPhases.end(), - phase_by_time_sorter()); + sort(myPhases.begin(), myPhases.end(), phase_by_time_sorter()); } void -NBLoadedTLDef::SignalGroup::patchTYellow(SUMOTime tyellow) { - if (myTYellow < tyellow) { +NBLoadedTLDef::SignalGroup::patchTYellow(SUMOTime tyellow, bool forced) { + if (myTYellow < 0) { + // was not set before (was not loaded) + myTYellow = tyellow; + } else if (forced && myTYellow < tyellow) { WRITE_WARNING("TYellow of signal group '" + getID() + "' was less than the computed one; patched (was:" + toString(myTYellow) + ", is:" + toString(tyellow) + ")"); myTYellow = tyellow; } @@ -97,8 +98,7 @@ std::vector NBLoadedTLDef::SignalGroup::getTimes(SUMOTime cycleDuration) const { - // within the phase container, we should have the green and red phases - // add their times + // within the phase container, we should have the green and red phases add their times std::vector ret; // !!! time vector for (std::vector::const_iterator i = myPhases.begin(); i != myPhases.end(); i++) { ret.push_back((SUMOReal)(*i).myTime); @@ -109,7 +109,7 @@ if ((*i).myColor == TLCOLOR_RED) { SUMOTime time = (SUMOTime)(*i).myTime + myTYellow; if (time > cycleDuration) { - time = time - cycleDuration ; + time = time - cycleDuration; } ret.push_back((SUMOReal) time); } @@ -266,16 +266,19 @@ * NBLoadedTLDef::Phase-methods * ----------------------------------------------------------------------- */ NBLoadedTLDef::NBLoadedTLDef(const std::string& id, - const std::vector &junctions) - : NBTrafficLightDefinition(id, junctions, DefaultProgramID) {} + const std::vector& junctions, SUMOTime offset) + : NBTrafficLightDefinition(id, junctions, DefaultProgramID, offset) +{} -NBLoadedTLDef::NBLoadedTLDef(const std::string& id, NBNode* junction) - : NBTrafficLightDefinition(id, junction, DefaultProgramID) {} +NBLoadedTLDef::NBLoadedTLDef(const std::string& id, NBNode* junction, SUMOTime offset) + : NBTrafficLightDefinition(id, junction, DefaultProgramID, offset) +{} -NBLoadedTLDef::NBLoadedTLDef(const std::string& id) - : NBTrafficLightDefinition(id, DefaultProgramID) {} +NBLoadedTLDef::NBLoadedTLDef(const std::string& id, SUMOTime offset) + : NBTrafficLightDefinition(id, DefaultProgramID, offset) +{} NBLoadedTLDef::~NBLoadedTLDef() { @@ -296,9 +299,7 @@ // needed later group->sortPhases(); // patch the yellow time for this group - if (OptionsCont::getOptions().getBool("tls.yellow.patch-small")) { - group->patchTYellow(brakingTime); - } + group->patchTYellow(brakingTime, OptionsCont::getOptions().getBool("tls.yellow.patch-small")); // copy the now valid times into the container // both the given red and green phases are added and also the // yellow times @@ -326,7 +327,7 @@ duration = (unsigned int)((*(l + 1)) - (*l)); } else { // get from the differenc to the first switching time - duration = (unsigned int)(myCycleDuration - (*l) + * (switchTimes.begin())) ; + duration = (unsigned int)(myCycleDuration - (*l) + * (switchTimes.begin())); } // no information about yellow times will be generated assert((*l) >= 0); @@ -336,6 +337,7 @@ if (MsgHandler::getWarningInstance()->wasInformed()) { WRITE_WARNING("During computation of traffic light '" + getID() + "'."); } + logic->setOffset(myOffset); logic->closeBuilding(); return logic; } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBLoadedTLDef.h sumo-0.16.0~dfsg/src/netbuild/NBLoadedTLDef.h --- sumo-0.15.0~dfsg/src/netbuild/NBLoadedTLDef.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBLoadedTLDef.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: NBLoadedTLDef.h 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: NBLoadedTLDef.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A loaded (complete) traffic light logic /****************************************************************************/ @@ -56,95 +56,96 @@ /** @brief Constructor * @param[in] id The id of the signal group */ - SignalGroup(const std::string& id) ; + SignalGroup(const std::string& id); /// @brief Destructor - ~SignalGroup() ; + ~SignalGroup(); /** @brief Inserts a controlled connection * @param[in] c The connection to be controlled by this signal group */ - void addConnection(const NBConnection& c) ; + void addConnection(const NBConnection& c); /** @brief Sets the begin of a phase * @param[in] time The time at which the phase starts * @param[in] color The color of this signal starting at the given time */ - void addPhaseBegin(SUMOTime time, TLColor color) ; + void addPhaseBegin(SUMOTime time, TLColor color); /** @brief Sets the times for redyellow and yellow * @param[in] tRedYellowe The duration of the redyellow phase * @param[in] tYellow The duration of the yellow phase */ - void setYellowTimes(SUMOTime tRedYellowe, SUMOTime tYellow) ; + void setYellowTimes(SUMOTime tRedYellowe, SUMOTime tYellow); /** @brief Returns the times at which the signal switches * @param[in] cycleDuration The duration of the complete cycle * @return The switch times of this signal */ - std::vector getTimes(SUMOTime cycleDuration) const ; + std::vector getTimes(SUMOTime cycleDuration) const; /** @brief Sorts the phases */ - void sortPhases() ; + void sortPhases(); /** @brief Returns the number of links (connection) controlled by this signal * @return The number of links controlled by this signal */ - unsigned int getLinkNo() const ; + unsigned int getLinkNo() const; /** @brief Returns whether vehicles on controlled links may drive at the given time * @param[in] time The regarded time * @return Whether vehicles may drive at this time */ - bool mayDrive(SUMOTime time) const ; + bool mayDrive(SUMOTime time) const; /** @brief Returns whether controlled links have yellow at the given time * @param[in] time The regarded time * @return Whether controlled links are yellow at this time */ - bool hasYellow(SUMOTime time) const ; + bool hasYellow(SUMOTime time) const; /** @brief Returns whether the given connection is controlled by this signal * @param[in] from The connection's start edge * @param[in] from The connection's end edge * @return Whether the connection is controlled by this signal */ - bool containsConnection(NBEdge* from, NBEdge* to) const ; + bool containsConnection(NBEdge* from, NBEdge* to) const; /** @brief Returns whether this signal controls the given edge * @param[in] from The incoming edge * @return Whether this edge is controlled by this signal */ - bool containsIncoming(NBEdge* from) const ; + bool containsIncoming(NBEdge* from) const; /** @brief Replaces the given incoming edge by the others given * @param[in] which The edge to replace * @param[in] by The replacements */ - void remapIncoming(NBEdge* which, const EdgeVector& by) ; + void remapIncoming(NBEdge* which, const EdgeVector& by); /** @brief Returns whether this signal controls a connection where the given edge is the destination * @param[in] from The outgoing edge * @return Whether this edge's predecessing edge is controlled by this signal */ - bool containsOutgoing(NBEdge* to) const ; + bool containsOutgoing(NBEdge* to) const; /** @brief Replaces the given outgoing edge by the others given * @param[in] which The edge to replace * @param[in] by The replacements */ - void remapOutgoing(NBEdge* which, const EdgeVector& by) ; + void remapOutgoing(NBEdge* which, const EdgeVector& by); /** @brief Returns the connection at the given index * @param[in] pos The position within this signal * @return The connection at the given index */ - const NBConnection& getConnection(unsigned int pos) const ; + const NBConnection& getConnection(unsigned int pos) const; /** @brief Sets the yellow time * @param[in] tyellow The yellow time to set + * @param[in] forced Whether resetting tyellow was forced by the user by setting "tls.yellow.patch-small" */ - void patchTYellow(SUMOTime tyellow) ; + void patchTYellow(SUMOTime tyellow, bool forced); /** @brief Replaces a removed edge/lane * @param[in] removed The edge to replace @@ -152,7 +153,7 @@ * @param[in] by The edge to insert instead * @param[in] byLane This edge's lane to insert instead */ - void remap(NBEdge* removed, int removedLane, NBEdge* by, int byLane) ; + void remap(NBEdge* removed, int removedLane, NBEdge* by, int byLane); /** @class PhaseDef * @brief Definition of a single, loaded phase @@ -207,26 +208,29 @@ /** @brief Constructor * @param[in] id The id of the tls * @param[in] junctions Junctions controlled by this tls + * @param[in] offset The offset of the plan */ NBLoadedTLDef(const std::string& id, - const std::vector &junctions) ; + const std::vector& junctions, SUMOTime offset); /** @brief Constructor * @param[in] id The id of the tls * @param[in] junction The junction controlled by this tls + * @param[in] offset The offset of the plan */ - NBLoadedTLDef(const std::string& id, NBNode* junction) ; + NBLoadedTLDef(const std::string& id, NBNode* junction, SUMOTime offset); /** @brief Constructor * @param[in] id The id of the tls + * @param[in] offset The offset of the plan */ - NBLoadedTLDef(const std::string& id) ; + NBLoadedTLDef(const std::string& id, SUMOTime offset); /// @brief Destructor - ~NBLoadedTLDef() ; + ~NBLoadedTLDef(); /** @brief Returns the signal group which is responsible for the given connection @@ -234,19 +238,19 @@ * @param[in] to The connection's end edge * @return The signal group which controls the given connection */ - SignalGroup* findGroup(NBEdge* from, NBEdge* to) const ; + SignalGroup* findGroup(NBEdge* from, NBEdge* to) const; /** @brief Sets the duration of a cycle * @param[in] cycleDur The duration of the cycle */ - void setCycleDuration(unsigned int cycleDur) ; + void setCycleDuration(unsigned int cycleDur); /** @brief Adds a signal group * @param[in] id The id of the signal group */ - void addSignalGroup(const std::string& id) ; + void addSignalGroup(const std::string& id); /** @brief Adds a connection to a signal group @@ -254,7 +258,7 @@ * @param[in] connection The connection to add */ bool addToSignalGroup(const std::string& groupid, - const NBConnection& connection) ; + const NBConnection& connection); /** @brief Adds a list of connections to a signal group @@ -262,7 +266,7 @@ * @param[in] connections The connections to add */ bool addToSignalGroup(const std::string& groupid, - const NBConnectionVector& connections) ; + const NBConnectionVector& connections); /** @brief Sets the information about the begin of a phase @@ -271,7 +275,7 @@ * @param[in] color The color of the signal during this phase */ void addSignalGroupPhaseBegin(const std::string& groupid, - SUMOTime time, TLColor color) ; + SUMOTime time, TLColor color); /** @brief Sets the times the light is yellow or red/yellow @@ -280,7 +284,7 @@ * @param[in] tYellow The duration of yellow */ void setSignalYellowTimes(const std::string& groupid, - SUMOTime tRedYellow, SUMOTime tYellow) ; + SUMOTime tRedYellow, SUMOTime tYellow); /// @name Public methods from NBTrafficLightDefinition-interface @@ -290,7 +294,7 @@ * @param[in] ec The container of edges * @see NBTrafficLightDefinition::setTLControllingInformation */ - void setTLControllingInformation(const NBEdgeCont& ec) const ; + void setTLControllingInformation(const NBEdgeCont& ec) const; /** @brief Replaces occurences of the removed edge in incoming/outgoing edges of all definitions @@ -300,7 +304,7 @@ * @see NBTrafficLightDefinition::remapRemoved */ void remapRemoved(NBEdge* removed, - const EdgeVector& incoming, const EdgeVector& outgoing) ; + const EdgeVector& incoming, const EdgeVector& outgoing); /// @} @@ -315,20 +319,20 @@ * @see NBTrafficLightDefinition::myCompute */ NBTrafficLightLogic* myCompute(const NBEdgeCont& ec, - unsigned int brakingTime) ; + unsigned int brakingTime); /** @brief Collects the nodes participating in this traffic light * @see NBTrafficLightDefinition::collectNodes */ - void collectNodes() ; + void collectNodes(); /** @brief Collects the links participating in this traffic light * @exception ProcessError If a link could not be found * @see NBTrafficLightDefinition::collectLinks */ - void collectLinks() ; + void collectLinks(); /** @brief Returns the information whether a connection must brake, given a phase @@ -341,7 +345,7 @@ bool mustBrake(const NBEdgeCont& ec, const NBConnection& possProhibited, const std::string& state, - unsigned int strmpos) const ; + unsigned int strmpos) const; /** @brief Replaces a removed edge/lane @@ -352,7 +356,7 @@ * @see NBTrafficLightDefinition::replaceRemoved */ void replaceRemoved(NBEdge* removed, int removedLane, - NBEdge* by, int byLane) ; + NBEdge* by, int byLane); /// @} private: @@ -361,7 +365,7 @@ * @param[in] time The time to build the phase for * @return The phase of this tls for the given time */ - std::string buildPhaseState(const NBEdgeCont& ec, unsigned int time) const ; + std::string buildPhaseState(const NBEdgeCont& ec, unsigned int time) const; private: diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNetBuilder.cpp sumo-0.16.0~dfsg/src/netbuild/NBNetBuilder.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBNetBuilder.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNetBuilder.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date 20 Nov 2001 -/// @version $Id: NBNetBuilder.cpp 12069 2012-03-12 14:39:00Z dkrajzew $ +/// @version $Id: NBNetBuilder.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Instance responsible for building networks /****************************************************************************/ @@ -50,8 +50,9 @@ #include #include #include - #include "NBAlgorithms.h" +#include "NBAlgorithms_Ramps.h" + #ifdef CHECK_MEMORY_LEAKS #include @@ -100,7 +101,7 @@ void NBNetBuilder::compute(OptionsCont& oc, - const std::set &explicitTurnarounds, + const std::set& explicitTurnarounds, bool removeUnwishedNodes) { GeoConvHelper& geoConvHelper = GeoConvHelper::getProcessing(); @@ -114,6 +115,13 @@ unsigned int numJoined = myNodeCont.joinLoadedClusters(myDistrictCont, myEdgeCont, myTLLCont); if (oc.getBool("junctions.join")) { PROGRESS_BEGIN_MESSAGE("Joining junction clusters"); + // preliminary geometry computations to determine the length of edges + // This depends on turning directions and sorting of edge list + // in case junctions are joined geometry computations have to be repeated + NBTurningDirectionsComputer::computeTurnDirections(myNodeCont); + NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand")); + myNodeCont.computeNodeShapes(oc.getBool("lefthand")); + myEdgeCont.computeEdgeShapes(); numJoined += myNodeCont.joinJunctions(oc.getFloat("junctions.join-dist"), myDistrictCont, myEdgeCont, myTLLCont); PROGRESS_DONE_MESSAGE(); } @@ -150,7 +158,7 @@ WRITE_MESSAGE(" " + toString(no) + " nodes removed."); } // @note: removing geometry can create similar edges so "Joining" must come afterwards - // @note: likewise splitting can destroy similarities so "Joining" must come before + // @note: likewise splitting can destroy similarities so "Joining" must come before PROGRESS_BEGIN_MESSAGE("Joining similar edges"); myJoinedEdges.init(myEdgeCont); myNodeCont.joinSimilarEdges(myDistrictCont, myEdgeCont, myTLLCont); @@ -164,10 +172,13 @@ // guess ramps if ((oc.exists("ramps.guess") && oc.getBool("ramps.guess")) || (oc.exists("ramps.set") && oc.isSet("ramps.set"))) { PROGRESS_BEGIN_MESSAGE("Guessing and setting on-/off-ramps"); - myNodeCont.guessRamps(oc, myEdgeCont, myDistrictCont); + NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand")); + NBRampsComputer::computeRamps(*this, oc); PROGRESS_DONE_MESSAGE(); } + // check whether any not previously setable connections may be set now + myEdgeCont.recheckPostProcessConnections(); // MOVE TO ORIGIN if (!oc.getBool("offset.disable-normalization") && oc.isDefault("offset.x") && oc.isDefault("offset.y")) { @@ -204,29 +215,6 @@ } } - // GUESS TLS POSITIONS - PROGRESS_BEGIN_MESSAGE("Assigning nodes to traffic lights"); - if (oc.isSet("tls.set")) { - std::vector tlControlledNodes = oc.getStringVector("tls.set"); - for (std::vector::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) { - NBNode* node = myNodeCont.retrieve(*i); - if (node == 0) { - WRITE_WARNING("Building a tl-logic for node '" + *i + "' is not possible." + "\n The node '" + *i + "' is not known."); - } else { - myNodeCont.setAsTLControlled(node, myTLLCont); - } - } - } - myNodeCont.guessTLs(oc, myTLLCont); - PROGRESS_DONE_MESSAGE(); - // - if (oc.getBool("tls.join")) { - PROGRESS_BEGIN_MESSAGE("Joining traffic light nodes"); - myNodeCont.joinTLS(myTLLCont); - PROGRESS_DONE_MESSAGE(); - } - - // CONNECTIONS COMPUTATION // PROGRESS_BEGIN_MESSAGE("Computing turning directions"); @@ -245,16 +233,16 @@ NBEdgePriorityComputer::computeEdgePriorities(myNodeCont); PROGRESS_DONE_MESSAGE(); // + PROGRESS_BEGIN_MESSAGE("Computing approached edges"); + myEdgeCont.computeEdge2Edges(oc.getBool("no-left-connections")); + PROGRESS_DONE_MESSAGE(); + // if (oc.getBool("roundabouts.guess")) { PROGRESS_BEGIN_MESSAGE("Guessing and setting roundabouts"); myEdgeCont.guessRoundabouts(myRoundabouts); PROGRESS_DONE_MESSAGE(); } // - PROGRESS_BEGIN_MESSAGE("Computing approached edges"); - myEdgeCont.computeEdge2Edges(oc.getBool("no-left-connections")); - PROGRESS_DONE_MESSAGE(); - // PROGRESS_BEGIN_MESSAGE("Computing approaching lanes"); myEdgeCont.computeLanes2Edges(); PROGRESS_DONE_MESSAGE(); @@ -288,6 +276,29 @@ PROGRESS_DONE_MESSAGE(); + // GUESS TLS POSITIONS + PROGRESS_BEGIN_MESSAGE("Assigning nodes to traffic lights"); + if (oc.isSet("tls.set")) { + std::vector tlControlledNodes = oc.getStringVector("tls.set"); + for (std::vector::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) { + NBNode* node = myNodeCont.retrieve(*i); + if (node == 0) { + WRITE_WARNING("Building a tl-logic for node '" + *i + "' is not possible." + "\n The node '" + *i + "' is not known."); + } else { + myNodeCont.setAsTLControlled(node, myTLLCont); + } + } + } + myNodeCont.guessTLs(oc, myTLLCont); + PROGRESS_DONE_MESSAGE(); + // + if (oc.getBool("tls.join")) { + PROGRESS_BEGIN_MESSAGE("Joining traffic light nodes"); + myNodeCont.joinTLS(myTLLCont, oc.getFloat("tls.join-dist")); + PROGRESS_DONE_MESSAGE(); + } + + // COMPUTING RIGHT-OF-WAY AND TRAFFIC LIGHT PROGRAMS // PROGRESS_BEGIN_MESSAGE("Computing traffic light control information"); @@ -306,7 +317,12 @@ progCount = "(" + toString(numbers.second) + " programs) "; } WRITE_MESSAGE(" " + toString(numbers.first) + " traffic light(s) " + progCount + "computed."); - + // + if (oc.isSet("street-sign-output")) { + PROGRESS_BEGIN_MESSAGE("Generating street signs"); + myEdgeCont.generateStreetSigns(); + PROGRESS_DONE_MESSAGE(); + } // FINISHING INNER EDGES if (!oc.getBool("no-internal-links")) { diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNetBuilder.h sumo-0.16.0~dfsg/src/netbuild/NBNetBuilder.h --- sumo-0.15.0~dfsg/src/netbuild/NBNetBuilder.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNetBuilder.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: NBNetBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBNetBuilder.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Instance responsible for building networks /****************************************************************************/ @@ -114,10 +114,10 @@ public: /// @brief Constructor - NBNetBuilder() ; + NBNetBuilder(); /// @brief Destructor - ~NBNetBuilder() ; + ~NBNetBuilder(); /** @brief Initialises the storage by applying given options @@ -128,7 +128,7 @@ * @param[in] oc The options container to read options from * @exception ProcessError If something fails (message is included) */ - void applyOptions(OptionsCont& oc) ; + void applyOptions(OptionsCont& oc); /** @brief Performs the network building steps @@ -139,7 +139,7 @@ * @exception ProcessError (recheck) */ void compute(OptionsCont& oc, - const std::set &explicitTurnarounds = std::set(), + const std::set& explicitTurnarounds = std::set(), bool removeUnwishedNodes = true); @@ -190,7 +190,7 @@ /** @brief Returns the determined roundabouts * @return The list of roundabout edges */ - const std::vector > &getRoundabouts() const { + const std::vector >& getRoundabouts() const { return myRoundabouts; } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNode.cpp sumo-0.16.0~dfsg/src/netbuild/NBNode.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBNode.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNode.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNode.cpp 12069 2012-03-12 14:39:00Z dkrajzew $ +/// @version $Id: NBNode.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The representation of a single node /****************************************************************************/ @@ -101,7 +101,7 @@ std::vector approachingLanes = incomingEdge->getConnectionLanes(myCurrentOutgoing); assert(approachingLanes.size() != 0); - std::deque *approachedLanes = spread(approachingLanes, dest); + std::deque* approachedLanes = spread(approachingLanes, dest); assert(approachedLanes->size() <= myCurrentOutgoing->getNumLanes()); // set lanes for (unsigned int i = 0; i < approachedLanes->size(); i++) { @@ -115,10 +115,10 @@ } -std::deque * -NBNode::ApproachingDivider::spread(const std::vector &approachingLanes, +std::deque* +NBNode::ApproachingDivider::spread(const std::vector& approachingLanes, int dest) const { - std::deque *ret = new std::deque(); + std::deque* ret = new std::deque(); unsigned int noLanes = (unsigned int) approachingLanes.size(); // when only one lane is approached, we check, whether the SUMOReal-value // is assigned more to the left or right lane @@ -622,17 +622,18 @@ } // special case b): // two in, one out, the outgoing has the same number of lanes as the sum of the incoming - // and a high speed, too // --> highway on-ramp bool check = false; if (myIncomingEdges.size() == 2 && myOutgoingEdges.size() == 1) { check = myIncomingEdges[0]->getNumLanes() + myIncomingEdges[1]->getNumLanes() == myOutgoingEdges[0]->getNumLanes(); check &= (myIncomingEdges[0]->getStep() <= NBEdge::LANES2EDGES); check &= (myIncomingEdges[1]->getStep() <= NBEdge::LANES2EDGES); + check &= myIncomingEdges[0] != myOutgoingEdges[0]; + check &= myIncomingEdges[1] != myOutgoingEdges[0]; + check &= myIncomingEdges[0]->isConnectedTo(myOutgoingEdges[0]); + check &= myIncomingEdges[1]->isConnectedTo(myOutgoingEdges[0]); } - if (check - && myIncomingEdges[0] != myOutgoingEdges[0] - && myIncomingEdges[0]->isConnectedTo(myOutgoingEdges[0])) { + if (check) { NBEdge* inc1 = myIncomingEdges[0]; NBEdge* inc2 = myIncomingEdges[1]; // for internal: check which one is the rightmost @@ -640,14 +641,40 @@ SUMOReal a2 = inc2->getAngleAtNode(this); SUMOReal ccw = GeomHelper::getCCWAngleDiff(a1, a2); SUMOReal cw = GeomHelper::getCWAngleDiff(a1, a2); - if (ccw < cw) { + if (ccw > cw) { std::swap(inc1, inc2); } - // inc1->addLane2LaneConnections(0, myOutgoingEdges[0], 0, inc1->getNumLanes(), NBEdge::L2L_VALIDATED, true, true); inc2->addLane2LaneConnections(0, myOutgoingEdges[0], inc1->getNumLanes(), inc2->getNumLanes(), NBEdge::L2L_VALIDATED, true, true); return; } + // special case c): + // one in, two out, the incoming has the same number of lanes as the sum of the outgoing + // --> highway off-ramp + check = false; + if (myIncomingEdges.size() == 1 && myOutgoingEdges.size() == 2) { + check = myIncomingEdges[0]->getNumLanes() == myOutgoingEdges[1]->getNumLanes() + myOutgoingEdges[0]->getNumLanes(); + check &= (myIncomingEdges[0]->getStep() <= NBEdge::LANES2EDGES); + check &= myIncomingEdges[0] != myOutgoingEdges[0]; + check &= myIncomingEdges[0] != myOutgoingEdges[1]; + check &= myIncomingEdges[0]->isConnectedTo(myOutgoingEdges[0]); + check &= myIncomingEdges[0]->isConnectedTo(myOutgoingEdges[1]); + } + if (check) { + NBEdge* out1 = myOutgoingEdges[0]; + NBEdge* out2 = myOutgoingEdges[1]; + // for internal: check which one is the rightmost + SUMOReal a1 = out1->getAngleAtNode(this); + SUMOReal a2 = out2->getAngleAtNode(this); + SUMOReal ccw = GeomHelper::getCCWAngleDiff(a1, a2); + SUMOReal cw = GeomHelper::getCWAngleDiff(a1, a2); + if (ccw < cw) { + std::swap(out1, out2); + } + myIncomingEdges[0]->addLane2LaneConnections(0, out1, 0, out1->getNumLanes(), NBEdge::L2L_VALIDATED, true, true); + myIncomingEdges[0]->addLane2LaneConnections(out1->getNumLanes(), out2, 0, out2->getNumLanes(), NBEdge::L2L_VALIDATED, false, true); + return; + } // go through this node's outgoing edges // for every outgoing edge, compute the distribution of the node's @@ -860,6 +887,9 @@ if (find(edges.begin(), edges.end(), e) != edges.end()) { edges.erase(find(edges.begin(), edges.end(), e)); } + if (edges.size() == 0) { + return 0; + } if (e->getToNode() == this) { sort(edges.begin(), edges.end(), NBContHelper::edge_opposite_direction_sorter(e, this)); } else { @@ -1015,7 +1045,7 @@ if ((*i) == from) { continue; } - const std::vector &connections = (*i)->getConnections(); + const std::vector& connections = (*i)->getConnections(); for (std::vector::const_iterator j = connections.begin(); j != connections.end(); ++j) { if ((*j).toEdge == to && ((*j).toLane < 0 || (*j).toLane == toLane)) { return true; @@ -1189,19 +1219,23 @@ } -std::string -NBNode::stateCode(const NBEdge* incoming, NBEdge* outgoing, int fromlane, bool mayDefinitelyPass) const { +LinkState +NBNode::getLinkState(const NBEdge* incoming, NBEdge* outgoing, int fromlane, + bool mayDefinitelyPass, const std::string& tlID) const { + if (tlID != "") { + return LINKSTATE_TL_OFF_BLINKING; + } if (outgoing == 0) { // always off - return toString(LINKSTATE_TL_OFF_NOSIGNAL); + return LINKSTATE_TL_OFF_NOSIGNAL; } if (myType == NODETYPE_RIGHT_BEFORE_LEFT) { - return toString(LINKSTATE_EQUAL); // all the same + return LINKSTATE_EQUAL; // all the same } if ((!incoming->isInnerEdge() && mustBrake(incoming, outgoing, fromlane)) && !mayDefinitelyPass) { - return toString(LINKSTATE_MINOR); // minor road + return LINKSTATE_MINOR; // minor road } - // traffic lights are not regardedm here - return toString(LINKSTATE_MAJOR); + // traffic lights are not regarded here + return LINKSTATE_MAJOR; } @@ -1357,7 +1391,7 @@ NBNode::buildInnerEdges() { unsigned int noInternalNoSplits = 0; for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) { - const std::vector &elv = (*i)->getConnections(); + const std::vector& elv = (*i)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == 0) { continue; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNode.h sumo-0.16.0~dfsg/src/netbuild/NBNode.h --- sumo-0.15.0~dfsg/src/netbuild/NBNode.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNode.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Yun-Pang Wang /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNode.h 12069 2012-03-12 14:39:00Z dkrajzew $ +/// @version $Id: NBNode.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The representation of a single node /****************************************************************************/ @@ -104,17 +104,17 @@ * @param[in] currentOutgoing The outgoing edge */ ApproachingDivider(EdgeVector* approaching, - NBEdge* currentOutgoing) ; + NBEdge* currentOutgoing); /// @brief Destructor - ~ApproachingDivider() ; + ~ApproachingDivider(); /** the bresenham-callback */ - void execute(const unsigned int src, const unsigned int dest) ; + void execute(const unsigned int src, const unsigned int dest); /** the method that spreads the wished number of lanes from the the lane given by the bresenham-call to both left and right */ - std::deque *spread(const std::vector &approachingLanes, int dest) const; + std::deque* spread(const std::vector& approachingLanes, int dest) const; }; @@ -123,7 +123,7 @@ * @param[in] id The id of the node * @param[in] position The position of the node */ - NBNode(const std::string& id, const Position& position) ; + NBNode(const std::string& id, const Position& position); /** @brief Constructor @@ -131,7 +131,7 @@ * @param[in] position The position of the node * @param[in] type The type of the node */ - NBNode(const std::string& id, const Position& position, SumoXMLNodeType type) ; + NBNode(const std::string& id, const Position& position, SumoXMLNodeType type); /** @brief Constructor @@ -139,11 +139,11 @@ * @param[in] position The position of the node * @param[in] district The district this district node represents */ - NBNode(const std::string& id, const Position& position, NBDistrict* district) ; + NBNode(const std::string& id, const Position& position, NBDistrict* district); /// @brief Destructor - ~NBNode() ; + ~NBNode(); /** @brief Resets initial values @@ -208,14 +208,14 @@ /** @brief Adds a traffic light to the list of traffic lights that control this node * @param[in] tld The traffic light that controls this node */ - void addTrafficLight(NBTrafficLightDefinition* tlDef) ; + void addTrafficLight(NBTrafficLightDefinition* tlDef); /** @brief Removes the given traffic light from this node */ - void removeTrafficLight(NBTrafficLightDefinition* tlDef) ; + void removeTrafficLight(NBTrafficLightDefinition* tlDef); /** @brief Removes all references to traffic lights that control this tls */ - void removeTrafficLights() ; + void removeTrafficLights(); /** @brief Returns whether this node is controlled by any tls @@ -229,13 +229,13 @@ /** @brief Returns whether this node is controlled by a tls that spans over more than one node * @return Whether a "joined" traffic light was assigned to this node */ - bool isJoinedTLSControlled() const ; + bool isJoinedTLSControlled() const; /** @brief Returns the traffic lights that were assigned to this node * @return The set of tls that control this node */ - const std::set &getControllingTLS() const { + const std::set& getControllingTLS() const { return myTrafficLights; } /// @} @@ -299,14 +299,14 @@ * @param[in] e The edge * @return Whether the given edge is one of this node's incoming edges */ - bool hasIncoming(const NBEdge* const e) const ; + bool hasIncoming(const NBEdge* const e) const; /** @brief Returns whether the given edge starts at this node * @param[in] e The edge * @return Whether the given edge is one of this node's outgoing edges */ - bool hasOutgoing(const NBEdge* const e) const ; + bool hasOutgoing(const NBEdge* const e) const; NBEdge* getOppositeIncoming(NBEdge* e) const; @@ -336,7 +336,7 @@ * @param[in] from The outgoing edge (the end of the connection) * @return Whether the described connection is a left-mover */ - bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const ; + bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const; /** @brief Returns the information whether the described flow must let any other flow pass @@ -345,7 +345,7 @@ * @param[in] toLane The lane the connection ends at * @return Whether the described connection must brake (has higher priorised foes) */ - bool mustBrake(const NBEdge* const from, const NBEdge* const to, int toLane) const ; + bool mustBrake(const NBEdge* const from, const NBEdge* const to, int toLane) const; /** @brief Returns the information whether "prohibited" flow must let "prohibitor" flow pass @@ -358,7 +358,7 @@ */ bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo, const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo, - bool regardNonSignalisedLowerPriority) const ; + bool regardNonSignalisedLowerPriority) const; /** @brief Returns the information whether the given flows cross @@ -369,7 +369,7 @@ * @return Whether both stream are foes (cross) */ bool foes(const NBEdge* const from1, const NBEdge* const to1, - const NBEdge* const from2, const NBEdge* const to2) const ; + const NBEdge* const from2, const NBEdge* const to2) const; /** @brief Returns the representation of the described stream's direction @@ -377,9 +377,10 @@ * @param[in] outgoing The edge the stream ends at * @return The direction of the stream */ - LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing) const ; + LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing) const; - std::string stateCode(const NBEdge* incoming, NBEdge* outgoing, int fromLane, bool mayDefinitelyPass) const ; + LinkState getLinkState(const NBEdge* incoming, NBEdge* outgoing, + int fromLane, bool mayDefinitelyPass, const std::string& tlID) const; void computeNodeShape(bool leftHand); diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNodeCont.cpp sumo-0.16.0~dfsg/src/netbuild/NBNodeCont.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBNodeCont.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNodeCont.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -8,7 +8,7 @@ /// @author Michael Behrisch /// @author Sascha Krieg /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNodeCont.cpp 12069 2012-03-12 14:39:00Z dkrajzew $ +/// @version $Id: NBNodeCont.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Container for nodes during the netbuilding process /****************************************************************************/ @@ -243,7 +243,7 @@ UNUSED_PARAMETER(tc); // Warn of isolated edges, i.e. a single edge with no connection to another edge int edgeCounter = 0; - const std::vector &edgeNames = ec.getAllNames(); + const std::vector& edgeNames = ec.getAllNames(); for (std::vector::const_iterator it = edgeNames.begin(); it != edgeNames.end(); ++it) { // Test whether this node starts at a dead end, i.e. it has only one adjacent node // to which an edge exists and from which an edge may come. @@ -415,7 +415,7 @@ if (visited.find(s) != visited.end()) { continue; } - if (n->getPosition().distanceTo(s->getPosition()) < maxDist) { + if (e->getLoadedLength() < maxDist) { toProc.push_back(s); } } @@ -429,7 +429,7 @@ void -NBNodeCont::addJoinExclusion(const std::vector &ids, bool check) { +NBNodeCont::addJoinExclusion(const std::vector& ids, bool check) { for (std::vector::const_iterator it = ids.begin(); it != ids.end(); it++) { // error handling has to take place here since joinExclusions could be // loaded from multiple files / command line @@ -503,7 +503,7 @@ } // iteratively remove the fringe bool pruneFringe = true; - while(pruneFringe) { + while (pruneFringe) { pruneFringe = false; for (std::set::iterator j = cluster.begin(); j != cluster.end();) { std::set::iterator check = j; @@ -511,12 +511,12 @@ ++j; // remove nodes with degree <= 2 at fringe of the cluster (at least one edge leads to a non-cluster node) if ( - (n->getIncomingEdges().size() <= 1 && n->getOutgoingEdges().size() <= 1 ) && - ((n->getIncomingEdges().size() == 0 || - (n->getIncomingEdges().size() == 1) && cluster.count(n->getIncomingEdges()[0]->getFromNode()) == 0) || - (n->getOutgoingEdges().size() == 0 || - (n->getOutgoingEdges().size() == 1) && cluster.count(n->getOutgoingEdges()[0]->getToNode()) == 0)) - ) { + (n->getIncomingEdges().size() <= 1 && n->getOutgoingEdges().size() <= 1) && + ((n->getIncomingEdges().size() == 0 || + (n->getIncomingEdges().size() == 1 && cluster.count(n->getIncomingEdges()[0]->getFromNode()) == 0)) || + (n->getOutgoingEdges().size() == 0 || + (n->getOutgoingEdges().size() == 1 && cluster.count(n->getOutgoingEdges()[0]->getToNode()) == 0))) + ) { cluster.erase(check); pruneFringe = true; // other nodes could belong to the fringe now } @@ -548,7 +548,7 @@ } NBNode* newNode = retrieve(id); if (setTL) { - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, newNode); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, newNode, 0); if (!tlc.insert(tlDef)) { // actually, nothing should fail here delete tlDef; @@ -557,19 +557,19 @@ } // collect edges std::set allEdges; - for (std::set::const_iterator j=cluster.begin(); j!=cluster.end(); ++j) { - const std::vector &edges = (*j)->getEdges(); + for (std::set::const_iterator j = cluster.begin(); j != cluster.end(); ++j) { + const std::vector& edges = (*j)->getEdges(); allEdges.insert(edges.begin(), edges.end()); } // remap and remove edges which are completely within the new intersection - for(std::set::iterator j=allEdges.begin(); j!=allEdges.end();) { - NBEdge *e = (*j); - NBNode *from = e->getFromNode(); - NBNode *to = e->getToNode(); - if(cluster.count(from) > 0 && cluster.count(to) > 0) { - for(std::set::iterator l=allEdges.begin(); l!=allEdges.end(); ++l) { - if(e != *l) { + for (std::set::iterator j = allEdges.begin(); j != allEdges.end();) { + NBEdge* e = (*j); + NBNode* from = e->getFromNode(); + NBNode* to = e->getToNode(); + if (cluster.count(from) > 0 && cluster.count(to) > 0) { + for (std::set::iterator l = allEdges.begin(); l != allEdges.end(); ++l) { + if (e != *l) { (*l)->replaceInConnections(e, e->getConnections()); } } @@ -581,18 +581,16 @@ } // remap edges which are incoming / outgoing - for(std::set::iterator j=allEdges.begin(); j!=allEdges.end(); ++j) { - NBEdge *e = (*j); + for (std::set::iterator j = allEdges.begin(); j != allEdges.end(); ++j) { + NBEdge* e = (*j); std::vector conns = e->getConnections(); - PositionVector g = e->getGeometry(); const bool outgoing = cluster.count(e->getFromNode()) > 0; - NBNode *from = outgoing ? newNode : e->getFromNode(); - NBNode *to = outgoing ? e->getToNode() : newNode; - e->reinit(from, to, e->getTypeID(), e->getSpeed(), - e->getNumLanes(), e->getPriority(), e->getGeometry(), - e->getWidth(), e->getOffset(), e->getStreetName(), e->getLaneSpreadFunction()); - e->setGeometry(g); - for(std::vector::iterator k=conns.begin(); k!=conns.end(); ++k) { + NBNode* from = outgoing ? newNode : e->getFromNode(); + NBNode* to = outgoing ? e->getToNode() : newNode; + e->reinitNodes(from, to); + // re-add connections which previously existed and may still valid. + // connections to removed edges will be ignored + for (std::vector::iterator k = conns.begin(); k != conns.end(); ++k) { e->addLane2LaneConnection((*k).fromLane, (*k).toEdge, (*k).toLane, NBEdge::L2L_USER, false, (*k).mayDefinitelyPass); } } @@ -601,7 +599,7 @@ } -void +void NBNodeCont::registerJoinedCluster(const std::set& cluster) { std::set ids; for (std::set::const_iterator j = cluster.begin(); j != cluster.end(); j++) { @@ -635,7 +633,7 @@ // ----------- (Helper) methods for guessing/computing traffic lights bool -NBNodeCont::shouldBeTLSControlled(const std::set &c) const { +NBNodeCont::shouldBeTLSControlled(const std::set& c) const { unsigned int noIncoming = 0; unsigned int noOutgoing = 0; bool tooFast = false; @@ -699,14 +697,13 @@ } // guess joined tls first, if wished - if (oc.getBool("tls-guess.joining")) { + if (oc.getBool("tls.join")) { // get node clusters - SUMOReal MAXDIST = 25; std::vector > cands; - generateNodeClusters(MAXDIST, cands); + generateNodeClusters(oc.getFloat("tls.join-dist"), cands); // check these candidates (clusters) whether they should be controlled by a tls for (std::vector >::iterator i = cands.begin(); i != cands.end();) { - std::set &c = (*i); + std::set& c = (*i); // regard only junctions which are not yet controlled and are not // forbidden to be controlled for (std::set::iterator j = c.begin(); j != c.end();) { @@ -731,7 +728,7 @@ nodes.push_back(*j); } std::string id = "joinedG_" + toString(index++); - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, nodes); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, nodes, 0); if (!tlc.insert(tlDef)) { // actually, nothing should fail here WRITE_WARNING("Could not build guessed, joined tls"); @@ -763,13 +760,12 @@ void -NBNodeCont::joinTLS(NBTrafficLightLogicCont& tlc) { - SUMOReal MAXDIST = 25; +NBNodeCont::joinTLS(NBTrafficLightLogicCont& tlc, SUMOReal maxdist) { std::vector > cands; - generateNodeClusters(MAXDIST, cands); + generateNodeClusters(maxdist, cands); unsigned int index = 0; for (std::vector >::iterator i = cands.begin(); i != cands.end(); ++i) { - std::set &c = (*i); + std::set& c = (*i); for (std::set::iterator j = c.begin(); j != c.end();) { if (!(*j)->isTLControlled()) { c.erase(j++); @@ -792,7 +788,7 @@ for (std::set::iterator j = c.begin(); j != c.end(); j++) { nodes.push_back(*j); } - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, nodes); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, nodes, 0); if (!tlc.insert(tlDef)) { // actually, nothing should fail here WRITE_WARNING("Could not build a joined tls."); @@ -808,7 +804,7 @@ if (id == "") { id = node->getID(); } - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, node); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, node, 0); if (!tlc.insert(tlDef)) { // actually, nothing should fail here WRITE_WARNING("Building a tl-logic for node '" + id + "' twice is not possible."); @@ -866,388 +862,6 @@ } -bool -NBNodeCont::mayNeedOnRamp(OptionsCont& oc, NBNode* cur) const { - if (cur->getIncomingEdges().size() == 2 && cur->getOutgoingEdges().size() == 1) { - // may be an on-ramp - NBEdge* pot_highway = cur->getIncomingEdges()[0]; - NBEdge* pot_ramp = cur->getIncomingEdges()[1]; - NBEdge* cont = cur->getOutgoingEdges()[0]; - - // do not build ramps on connectors - if (pot_highway->isMacroscopicConnector() || pot_ramp->isMacroscopicConnector() || cont->isMacroscopicConnector()) { - return false; - } - - // check whether a lane is missing - if (pot_highway->getNumLanes() + pot_ramp->getNumLanes() <= cont->getNumLanes()) { - return false; - } - - // assign highway/ramp properly - if (pot_highway->getSpeed() < pot_ramp->getSpeed()) { - std::swap(pot_highway, pot_ramp); - } else if (pot_highway->getSpeed() == pot_ramp->getSpeed() - && - pot_highway->getNumLanes() < pot_ramp->getNumLanes()) { - - std::swap(pot_highway, pot_ramp); - } - - // check conditions - // is it really a highway? - SUMOReal minHighwaySpeed = oc.getFloat("ramps.min-highway-speed"); - if (pot_highway->getSpeed() < minHighwaySpeed || cont->getSpeed() < minHighwaySpeed) { - return false; - } - // is it really a ramp? - SUMOReal maxRampSpeed = oc.getFloat("ramps.max-ramp-speed"); - if (maxRampSpeed > 0 && maxRampSpeed < pot_ramp->getSpeed()) { - return false; - } - - // ok, may be - return true; - } - return false; -} - - -bool -NBNodeCont::buildOnRamp(OptionsCont& oc, NBNode* cur, - NBEdgeCont& ec, NBDistrictCont& dc, - EdgeVector& incremented) { - NBEdge* pot_highway = cur->getIncomingEdges()[0]; - NBEdge* pot_ramp = cur->getIncomingEdges()[1]; - NBEdge* cont = cur->getOutgoingEdges()[0]; - bool bEdgeDeleted = false; - - // assign highway/ramp properly - if (pot_highway->getSpeed() < pot_ramp->getSpeed()) { - std::swap(pot_highway, pot_ramp); - } else if (pot_highway->getSpeed() == pot_ramp->getSpeed() - && - pot_highway->getNumLanes() < pot_ramp->getNumLanes()) { - - std::swap(pot_highway, pot_ramp); - } - - // compute the number of lanes to append - int toAdd = (pot_ramp->getNumLanes() + pot_highway->getNumLanes()) - cont->getNumLanes(); - if (toAdd <= 0) { - return false; - } - - // - if (cont->getGeometry().length() - POSITION_EPS <= oc.getFloat("ramps.ramp-length")) { - // the edge is shorter than the wished ramp - // append a lane only - if (find(incremented.begin(), incremented.end(), cont) == incremented.end()) { - cont->incLaneNo(toAdd); - incremented.push_back(cont); - if (!pot_highway->addLane2LaneConnections(0, cont, pot_ramp->getNumLanes(), - MIN2(cont->getNumLanes() - pot_ramp->getNumLanes(), pot_highway->getNumLanes()), NBEdge::L2L_VALIDATED, true, true)) { - throw ProcessError("Could not set connection!"); - } - if (!pot_ramp->addLane2LaneConnections(0, cont, 0, pot_ramp->getNumLanes(), NBEdge::L2L_VALIDATED, true, true)) { - throw ProcessError("Could not set connection!"); - } - // - cont->invalidateConnections(true); - const EdgeVector& o1 = cont->getToNode()->getOutgoingEdges(); - if (o1.size() == 1 && o1[0]->getNumLanes() < cont->getNumLanes()) { - cont->addLane2LaneConnections(cont->getNumLanes() - o1[0]->getNumLanes(), - o1[0], 0, o1[0]->getNumLanes(), NBEdge::L2L_VALIDATED); - } - // - if (cont->getLaneSpreadFunction() == LANESPREAD_CENTER) { - try { - PositionVector g = cont->getGeometry(); - g.move2side(SUMO_const_laneWidthAndOffset); - cont->setGeometry(g); - } catch (InvalidArgument&) { - WRITE_WARNING("For edge '" + cont->getID() + "': could not compute shape."); - } - } - } - PositionVector p = pot_ramp->getGeometry(); - p.pop_back(); - p.push_back(cont->getFromNode()->getPosition()); - pot_ramp->setGeometry(p); - } else { - bEdgeDeleted = true; - // there is enough place to build a ramp; do it - NBNode* rn = - new NBNode(cont->getID() + "-AddedOnRampNode", - cont->getGeometry().positionAtLengthPosition( - oc.getFloat("ramps.ramp-length"))); - if (!insert(rn)) { - throw ProcessError("Ups - could not build on-ramp for edge '" + pot_highway->getID() + "' (node could not be build)!"); - } - std::string name = cont->getID(); - bool ok = ec.splitAt(dc, cont, rn, - cont->getID() + "-AddedOnRampEdge", cont->getID(), - cont->getNumLanes() + toAdd, cont->getNumLanes()); - if (!ok) { - WRITE_ERROR("Ups - could not build on-ramp for edge '" + pot_highway->getID() + "'!"); - return true; - } else { - NBEdge* added_ramp = ec.retrieve(name + "-AddedOnRampEdge"); - NBEdge* added = ec.retrieve(name); - incremented.push_back(added_ramp); - if (added_ramp->getNumLanes() != added->getNumLanes()) { - int off = added_ramp->getNumLanes() - added->getNumLanes(); - if (!added_ramp->addLane2LaneConnections(off, added, 0, added->getNumLanes(), NBEdge::L2L_VALIDATED, true)) { - throw ProcessError("Could not set connection!"); - } - if (added_ramp->getLaneSpreadFunction() == LANESPREAD_CENTER) { - try { - PositionVector g = added_ramp->getGeometry(); - SUMOReal factor = SUMO_const_laneWidthAndOffset * (SUMOReal)(toAdd - 1) + SUMO_const_halfLaneAndOffset * (SUMOReal)(toAdd % 2); - g.move2side(factor); - added_ramp->setGeometry(g); - } catch (InvalidArgument&) { - WRITE_WARNING("For edge '" + added_ramp->getID() + "': could not compute shape."); - } - } - } else { - if (!added_ramp->addLane2LaneConnections(0, added, 0, added_ramp->getNumLanes(), NBEdge::L2L_VALIDATED, true)) { - throw ProcessError("Could not set connection!"); - } - } - if (!pot_highway->addLane2LaneConnections(0, added_ramp, pot_ramp->getNumLanes(), - MIN2(added_ramp->getNumLanes() - pot_ramp->getNumLanes(), pot_highway->getNumLanes()), NBEdge::L2L_VALIDATED, false, true)) { - throw ProcessError("Could not set connection!"); - - } - if (!pot_ramp->addLane2LaneConnections(0, added_ramp, 0, pot_ramp->getNumLanes(), NBEdge::L2L_VALIDATED, true, true)) { - throw ProcessError("Could not set connection!"); - } - PositionVector p = pot_ramp->getGeometry(); - p.pop_back(); - p.push_back(added_ramp->getFromNode()->getPosition());//added_ramp->getLaneShape(0).at(0)); - pot_ramp->setGeometry(p); - } - } - return bEdgeDeleted; -} - - -void -NBNodeCont::buildOffRamp(OptionsCont& oc, NBNode* cur, - NBEdgeCont& ec, NBDistrictCont& dc, - EdgeVector& incremented) { - NBEdge* pot_highway = cur->getOutgoingEdges()[0]; - NBEdge* pot_ramp = cur->getOutgoingEdges()[1]; - NBEdge* prev = cur->getIncomingEdges()[0]; - // assign highway/ramp properly - if (pot_highway->getSpeed() < pot_ramp->getSpeed()) { - std::swap(pot_highway, pot_ramp); - } else if (pot_highway->getSpeed() == pot_ramp->getSpeed() - && - pot_highway->getNumLanes() < pot_ramp->getNumLanes()) { - - std::swap(pot_highway, pot_ramp); - } - // compute the number of lanes to append - int toAdd = (pot_ramp->getNumLanes() + pot_highway->getNumLanes()) - prev->getNumLanes(); - if (toAdd <= 0) { - return; - } - // append on-ramp - if (prev->getGeometry().length() - POSITION_EPS <= oc.getFloat("ramps.ramp-length")) { - // the edge is shorter than the wished ramp - // append a lane only - if (find(incremented.begin(), incremented.end(), prev) == incremented.end()) { - incremented.push_back(prev); - prev->incLaneNo(toAdd); - prev->invalidateConnections(true); - if (!prev->addLane2LaneConnections(pot_ramp->getNumLanes(), pot_highway, 0, - MIN2(prev->getNumLanes() - 1, pot_highway->getNumLanes()), NBEdge::L2L_VALIDATED, true)) { - - throw ProcessError("Could not set connection!"); - - } - if (!prev->addLane2LaneConnections(0, pot_ramp, 0, pot_ramp->getNumLanes(), NBEdge::L2L_VALIDATED, false)) { - throw ProcessError("Could not set connection!"); - - } - if (prev->getLaneSpreadFunction() == LANESPREAD_CENTER) { - try { - PositionVector g = prev->getGeometry(); - g.move2side(SUMO_const_laneWidthAndOffset); - prev->setGeometry(g); - } catch (InvalidArgument&) { - WRITE_WARNING("For edge '" + prev->getID() + "': could not compute shape."); - } - } - } - PositionVector p = pot_ramp->getGeometry(); - p.pop_front(); - p.push_front(prev->getToNode()->getPosition());//added_ramp->getLaneShape(0).at(-1)); - pot_ramp->setGeometry(p); - } else { - Position pos = - prev->getGeometry().positionAtLengthPosition( - prev->getGeometry().length() - oc.getFloat("ramps.ramp-length")); - NBNode* rn = new NBNode(prev->getID() + "-AddedOffRampNode", pos); - if (!insert(rn)) { - throw ProcessError("Ups - could not build off-ramp for edge '" + pot_highway->getID() + "' (node could not be build)!"); - - } - std::string name = prev->getID(); - bool ok = ec.splitAt(dc, prev, rn, - prev->getID(), prev->getID() + "-AddedOffRampEdge", - prev->getNumLanes(), prev->getNumLanes() + toAdd); - if (!ok) { - WRITE_ERROR("Ups - could not build on-ramp for edge '" + pot_highway->getID() + "'!"); - return; - } else { - NBEdge* added_ramp = ec.retrieve(name + "-AddedOffRampEdge"); - NBEdge* added = ec.retrieve(name); - if (added_ramp->getNumLanes() != added->getNumLanes()) { - incremented.push_back(added_ramp); - int off = added_ramp->getNumLanes() - added->getNumLanes(); - if (!added->addLane2LaneConnections(0, added_ramp, off, added->getNumLanes(), NBEdge::L2L_VALIDATED, true)) { - throw ProcessError("Could not set connection!"); - - } - if (added_ramp->getLaneSpreadFunction() == LANESPREAD_CENTER) { - try { - PositionVector g = added_ramp->getGeometry(); - SUMOReal factor = SUMO_const_laneWidthAndOffset * (SUMOReal)(toAdd - 1) + SUMO_const_halfLaneAndOffset * (SUMOReal)(toAdd % 2); - g.move2side(factor); - added_ramp->setGeometry(g); - } catch (InvalidArgument&) { - WRITE_WARNING("For edge '" + added_ramp->getID() + "': could not compute shape."); - } - } - } else { - if (!added->addLane2LaneConnections(0, added_ramp, 0, added_ramp->getNumLanes(), NBEdge::L2L_VALIDATED, true)) { - throw ProcessError("Could not set connection!"); - } - } - if (!added_ramp->addLane2LaneConnections(pot_ramp->getNumLanes(), pot_highway, 0, - MIN2(added_ramp->getNumLanes() - pot_ramp->getNumLanes(), pot_highway->getNumLanes()), NBEdge::L2L_VALIDATED, true)) { - throw ProcessError("Could not set connection!"); - } - if (!added_ramp->addLane2LaneConnections(0, pot_ramp, 0, pot_ramp->getNumLanes(), NBEdge::L2L_VALIDATED, false)) { - throw ProcessError("Could not set connection!"); - - } - PositionVector p = pot_ramp->getGeometry(); - p.pop_front(); - p.push_front(added_ramp->getToNode()->getPosition());//added_ramp->getLaneShape(0).at(-1)); - pot_ramp->setGeometry(p); - } - } -} - - -bool -NBNodeCont::mayNeedOffRamp(OptionsCont& oc, NBNode* cur) const { - if (cur->getIncomingEdges().size() == 1 && cur->getOutgoingEdges().size() == 2) { - // may be an off-ramp - NBEdge* pot_highway = cur->getOutgoingEdges()[0]; - NBEdge* pot_ramp = cur->getOutgoingEdges()[1]; - NBEdge* prev = cur->getIncomingEdges()[0]; - - // do not build ramps on connectors - if (pot_highway->isMacroscopicConnector() || pot_ramp->isMacroscopicConnector() || prev->isMacroscopicConnector()) { - return false; - } - - // check whether a lane is missing - if (pot_highway->getNumLanes() + pot_ramp->getNumLanes() <= prev->getNumLanes()) { - return false; - } - - // assign highway/ramp properly - if (pot_highway->getSpeed() < pot_ramp->getSpeed()) { - std::swap(pot_highway, pot_ramp); - } else if (pot_highway->getSpeed() == pot_ramp->getSpeed() - && - pot_highway->getNumLanes() < pot_ramp->getNumLanes()) { - - std::swap(pot_highway, pot_ramp); - } - - // check conditions - // is it really a highway? - SUMOReal minHighwaySpeed = oc.getFloat("ramps.min-highway-speed"); - if (pot_highway->getSpeed() < minHighwaySpeed || prev->getSpeed() < minHighwaySpeed) { - return false; - } - // is it really a ramp? - SUMOReal maxRampSpeed = oc.getFloat("ramps.max-ramp-speed"); - if (maxRampSpeed > 0 && maxRampSpeed < pot_ramp->getSpeed()) { - return false; - } - - return true; - } - return false; -} - - -void -NBNodeCont::checkHighwayRampOrder(NBEdge *&pot_highway, NBEdge *&pot_ramp) { - if (pot_highway->getSpeed() < pot_ramp->getSpeed()) { - std::swap(pot_highway, pot_ramp); - } else if (pot_highway->getSpeed() == pot_ramp->getSpeed() - && - pot_highway->getNumLanes() < pot_ramp->getNumLanes()) { - - std::swap(pot_highway, pot_ramp); - } -} - - -void -NBNodeCont::guessRamps(OptionsCont& oc, NBEdgeCont& ec, - NBDistrictCont& dc) { - EdgeVector incremented; - bool bEdgeDeleted = false; - // check whether on-off ramps shall be guessed - if (oc.getBool("ramps.guess")) { - for (NodeCont::iterator i = myNodes.begin(); i != myNodes.end(); i++) { - NBNode* cur = (*i).second; - if (mayNeedOnRamp(oc, cur)) { - buildOnRamp(oc, cur, ec, dc, incremented); - } - if (mayNeedOffRamp(oc, cur)) { - buildOffRamp(oc, cur, ec, dc, incremented); - } - } - } - // check whether on-off ramps shall be guessed - if (oc.isSet("ramps.set")) { - std::vector edges = oc.getStringVector("ramps.set"); - for (std::vector::iterator i = edges.begin(); i != edges.end(); ++i) { - NBEdge* e = ec.retrieve(*i); - if (e == 0) { - WRITE_WARNING("Can not build on ramp on edge '" + *i + "' - the edge is not known."); - continue; - } - NBNode* from = e->getFromNode(); - if (from->getIncomingEdges().size() == 2 && from->getOutgoingEdges().size() == 1) { - bEdgeDeleted = buildOnRamp(oc, from, ec, dc, incremented); - } - // load edge again to check offramps - e = ec.retrieve(*i); - if (e == 0) { - WRITE_WARNING("Can not build off ramp on edge '" + *i + "' - the edge is not known."); - continue; - } - NBNode* to = e->getToNode(); - if (to->getIncomingEdges().size() == 1 && to->getOutgoingEdges().size() == 2) { - buildOffRamp(oc, to, ec, dc, incremented); - } - } - } -} - - void NBNodeCont::printBuiltNodesStatistics() const { int numUnregulatedJunctions = 0; @@ -1298,7 +912,7 @@ } -void +void NBNodeCont::rename(NBNode* node, const std::string& newID) { if (myNodes.count(newID) != 0) { throw ProcessError("Attempt to rename node using existing id '" + newID + "'"); diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNodeCont.h sumo-0.16.0~dfsg/src/netbuild/NBNodeCont.h --- sumo-0.15.0~dfsg/src/netbuild/NBNodeCont.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNodeCont.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNodeCont.h 12069 2012-03-12 14:39:00Z dkrajzew $ +/// @version $Id: NBNodeCont.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Container for nodes during the netbuilding process /****************************************************************************/ @@ -63,11 +63,11 @@ class NBNodeCont { public: /// @brief Constructor - NBNodeCont() ; + NBNodeCont(); /// @brief Destructor - ~NBNodeCont() ; + ~NBNodeCont(); @@ -81,7 +81,7 @@ * @return Whether the node could be added (no other with the same id or position is stored) */ bool insert(const std::string& id, const Position& position, - NBDistrict* district) ; + NBDistrict* district); /** @brief Inserts a node into the map @@ -89,28 +89,28 @@ * @param[in] position The node's position * @return Whether the node could be added (no other with the same id or position is stored) */ - bool insert(const std::string& id, const Position& position) ; + bool insert(const std::string& id, const Position& position); /** @brief Inserts a node into the map * @param[in] id The node's id * @return Whether the node could be added (no other with the same id is stored) */ - Position insert(const std::string& id) ; + Position insert(const std::string& id); /** @brief Inserts a node into the map * @param[in] node The node to insert * @return Whether the node could be added (no other with the same id or position is stored) */ - bool insert(NBNode* node) ; + bool insert(NBNode* node); /** @brief Removes the given node, deleting it * @param[in] node The node to delete and remove * @return Whether the node could be removed (existed) */ - bool erase(NBNode* node) ; + bool erase(NBNode* node); /** @brief Removes the given node but does not delete it @@ -118,13 +118,13 @@ * @param[in] remember Whether to keep the node for future reference * @return Whether the node could be removed (existed) */ - bool extract(NBNode* node, bool remember = false) ; + bool extract(NBNode* node, bool remember = false); /** @brief Returns the node with the given name * @param[in] id The id of the node to retrieve * @return The node with the given id, or 0 if no such node exists */ - NBNode* retrieve(const std::string& id) const ; + NBNode* retrieve(const std::string& id) const; /** @brief Returns the node with the given coordinates @@ -132,7 +132,7 @@ * @param[in] offset An offset which can be applied in the case positions are blurred * @return The node at the given position, or 0 if no such node exists */ - NBNode* retrieve(const Position& position, SUMOReal offset = 0.) const ; + NBNode* retrieve(const Position& position, SUMOReal offset = 0.) const; /** @brief Returns the pointer to the begin of the stored nodes @@ -161,7 +161,7 @@ * @param[in] check Whether to check if these nodes are known * @note checking is off by default because all nodes may not have been loaded yet */ - void addJoinExclusion(const std::vector &ids, bool check = false); + void addJoinExclusion(const std::vector& ids, bool check = false); /** @brief add ids of nodes which shall be joined into a single node @@ -248,9 +248,10 @@ /** @brief Builds clusters of tls-controlled junctions and joins the control if possible * @param[changed] tlc The traffic lights control for adding/removing new/prior tls + * @param[in] maxdist The maximum distance between nodes for clustering * @todo Recheck exception handling */ - void joinTLS(NBTrafficLightLogicCont& tlc); + void joinTLS(NBTrafficLightLogicCont& tlc, SUMOReal maxdist); /** @brief Sets the given node as being controlled by a tls @@ -291,7 +292,6 @@ void computeNodeShapes(bool leftHand); - void guessRamps(OptionsCont& oc, NBEdgeCont& ec, NBDistrictCont& dc); /** @brief Prints statistics about built nodes @@ -299,11 +299,11 @@ * Goes through stored nodes, computes the numbers of unregulated, priority and right-before-left * junctions and prints them. */ - void printBuiltNodesStatistics() const ; + void printBuiltNodesStatistics() const; /// @brief get all node names - std::vector getAllNames() const ; + std::vector getAllNames() const; /* @brief analyzes a cluster of nodes which shall be joined @@ -324,18 +324,6 @@ private: - bool mayNeedOnRamp(OptionsCont& oc, NBNode* cur) const; - bool mayNeedOffRamp(OptionsCont& oc, NBNode* cur) const; - bool buildOnRamp(OptionsCont& oc, NBNode* cur, - NBEdgeCont& ec, NBDistrictCont& dc, EdgeVector& incremented); - - void buildOffRamp(OptionsCont& oc, NBNode* cur, - NBEdgeCont& ec, NBDistrictCont& dc, EdgeVector& incremented); - - void checkHighwayRampOrder(NBEdge *&pot_highway, NBEdge *&pot_ramp); - - - /// @name Helper methods for for joining nodes /// @{ @@ -352,7 +340,7 @@ */ void generateNodeClusters(SUMOReal maxDist, NodeClusters& into) const; - + // @brief joins the given node clusters void joinNodeClusters(NodeClusters clusters, NBDistrictCont& dc, NBEdgeCont& ec, NBTrafficLightLogicCont& tlc); @@ -368,7 +356,7 @@ * @param[in] c The node cluster * @return Whether this node cluster shall be controlled by a tls */ - bool shouldBeTLSControlled(const std::set &c) const; + bool shouldBeTLSControlled(const std::set& c) const; /// @} diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNodeShapeComputer.cpp sumo-0.16.0~dfsg/src/netbuild/NBNodeShapeComputer.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBNodeShapeComputer.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNodeShapeComputer.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBNodeShapeComputer.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: NBNodeShapeComputer.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // This class computes shapes of junctions /****************************************************************************/ @@ -604,9 +604,9 @@ void -NBNodeShapeComputer::joinSameDirectionEdges(std::map &same, - std::map &geomsCCW, - std::map &geomsCW) { +NBNodeShapeComputer::joinSameDirectionEdges(std::map& same, + std::map& geomsCCW, + std::map& geomsCW) { EdgeVector::const_iterator i, j; for (i = myNode.myAllEdges.begin(); i != myNode.myAllEdges.end() - 1; i++) { // store current edge's boundary as current ccw/cw boundary @@ -660,11 +660,11 @@ EdgeVector NBNodeShapeComputer::computeUniqueDirectionList( - const std::map &same, - std::map &geomsCCW, - std::map &geomsCW, - std::map &ccwBoundary, - std::map &cwBoundary) { + const std::map& same, + std::map& geomsCCW, + std::map& geomsCW, + std::map& ccwBoundary, + std::map& cwBoundary) { EdgeVector newAll = myNode.myAllEdges; EdgeVector::const_iterator j; EdgeVector::iterator i2; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBNodeShapeComputer.h sumo-0.16.0~dfsg/src/netbuild/NBNodeShapeComputer.h --- sumo-0.15.0~dfsg/src/netbuild/NBNodeShapeComputer.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBNodeShapeComputer.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004-01-12 -/// @version $Id: NBNodeShapeComputer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBNodeShapeComputer.h 13107 2012-12-02 13:57:34Z behrisch $ /// // This class computes shapes of junctions /****************************************************************************/ @@ -92,9 +92,9 @@ * all edges within the value-vector which direction at the node differs * less than 1 from the key-edge's direction. */ - void joinSameDirectionEdges(std::map &same, - std::map &geomsCCW, - std::map &geomsCW); + void joinSameDirectionEdges(std::map& same, + std::map& geomsCCW, + std::map& geomsCW); /** @brief Joins edges and computes ccw/cw boundaries * @@ -104,19 +104,22 @@ * ccwBoundary/cwBoundary. */ EdgeVector computeUniqueDirectionList( - const std::map &same, - std::map &geomsCCW, - std::map &geomsCW, - std::map &ccwBoundary, - std::map &cwBoundary); + const std::map& same, + std::map& geomsCCW, + std::map& geomsCW, + std::map& ccwBoundary, + std::map& cwBoundary); private: /// The node to compute the geometry for const NBNode& myNode; -}; +private: + /// @brief Invalidated assignment operator + NBNodeShapeComputer& operator=(const NBNodeShapeComputer& s); +}; #endif diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBOwnTLDef.cpp sumo-0.16.0~dfsg/src/netbuild/NBOwnTLDef.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBOwnTLDef.cpp 2012-03-06 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBOwnTLDef.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: NBOwnTLDef.cpp 12016 2012-03-05 16:37:30Z dkrajzew $ +/// @version $Id: NBOwnTLDef.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A traffic light logics which must be computed (only nodes/edges are given) /****************************************************************************/ @@ -52,16 +52,16 @@ // member method definitions // =========================================================================== NBOwnTLDef::NBOwnTLDef(const std::string& id, - const std::vector &junctions) - : NBTrafficLightDefinition(id, junctions, DefaultProgramID) {} + const std::vector& junctions, SUMOTime offset) + : NBTrafficLightDefinition(id, junctions, DefaultProgramID, offset) {} -NBOwnTLDef::NBOwnTLDef(const std::string& id, NBNode* junction) - : NBTrafficLightDefinition(id, junction, DefaultProgramID) {} +NBOwnTLDef::NBOwnTLDef(const std::string& id, NBNode* junction, SUMOTime offset) + : NBTrafficLightDefinition(id, junction, DefaultProgramID, offset) {} -NBOwnTLDef::NBOwnTLDef(const std::string& id) - : NBTrafficLightDefinition(id, DefaultProgramID) {} +NBOwnTLDef::NBOwnTLDef(const std::string& id, SUMOTime offset) + : NBTrafficLightDefinition(id, DefaultProgramID, offset) {} NBOwnTLDef::~NBOwnTLDef() {} diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBOwnTLDef.h sumo-0.16.0~dfsg/src/netbuild/NBOwnTLDef.h --- sumo-0.15.0~dfsg/src/netbuild/NBOwnTLDef.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBOwnTLDef.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Sascha Krieg /// @date Tue, 29.05.2005 -/// @version $Id: NBOwnTLDef.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBOwnTLDef.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A traffic light logics which must be computed (only nodes/edges are given) /****************************************************************************/ @@ -56,32 +56,35 @@ /** @brief Constructor * @param[in] id The id of the tls * @param[in] junctions Junctions controlled by this tls + * @param[in] offset The offset of the plan */ NBOwnTLDef(const std::string& id, - const std::vector &junctions) ; + const std::vector& junctions, SUMOTime offset); /** @brief Constructor * @param[in] id The id of the tls * @param[in] junction The junction controlled by this tls + * @param[in] offset The offset of the plan */ - NBOwnTLDef(const std::string& id, NBNode* junction) ; + NBOwnTLDef(const std::string& id, NBNode* junction, SUMOTime offset); /** @brief Constructor * @param[in] id The id of the tls + * @param[in] offset The offset of the plan */ - NBOwnTLDef(const std::string& id) ; + NBOwnTLDef(const std::string& id, SUMOTime offset); /// @brief Destructor - ~NBOwnTLDef() ; + ~NBOwnTLDef(); /** @brief Builds the list of participating nodes/edges/links * @see NBTrafficLightDefinition::setParticipantsInformation */ - void setParticipantsInformation() ; + void setParticipantsInformation(); /// @name Public methods from NBTrafficLightDefinition-interface @@ -94,14 +97,14 @@ * @see NBTrafficLightDefinition::remapRemoved */ void remapRemoved(NBEdge* removed, - const EdgeVector& incoming, const EdgeVector& outgoing) ; + const EdgeVector& incoming, const EdgeVector& outgoing); /** @brief Informs edges about being controlled by a tls * @param[in] ec The container of edges * @see NBTrafficLightDefinition::setTLControllingInformation */ - void setTLControllingInformation(const NBEdgeCont& ec) const ; + void setTLControllingInformation(const NBEdgeCont& ec) const; /// @} @@ -116,20 +119,20 @@ * @see NBTrafficLightDefinition::myCompute */ NBTrafficLightLogic* myCompute(const NBEdgeCont& ec, - unsigned int brakingTimeSeconds) ; + unsigned int brakingTimeSeconds); /** @brief Collects the nodes participating in this traffic light * @see NBTrafficLightDefinition::collectNodes */ - void collectNodes() ; + void collectNodes(); /** @brief Collects the links participating in this traffic light * @exception ProcessError If a link could not be found * @see NBTrafficLightDefinition::collectLinks */ - void collectLinks() ; + void collectLinks(); /** @brief Replaces a removed edge/lane @@ -140,7 +143,7 @@ * @see NBTrafficLightDefinition::replaceRemoved */ void replaceRemoved(NBEdge* removed, int removedLane, - NBEdge* by, int byLane) ; + NBEdge* by, int byLane); /// @} @@ -150,14 +153,14 @@ * @return This stream's weight * @todo There are several magic numbers; describe */ - SUMOReal getDirectionalWeight(LinkDirection dir) ; + SUMOReal getDirectionalWeight(LinkDirection dir); /** @brief Returns this edge's priority at the node it ends at * @param[in] e The edge to ask for his priority * @return The edge's priority at his destination node */ - int getToPrio(const NBEdge* const e) ; + int getToPrio(const NBEdge* const e); /** @brief Returns how many streams outgoing from the edges can pass the junction without being blocked @@ -165,14 +168,14 @@ * @param[in] e2 The second edge * @todo There are several magic numbers; describe */ - SUMOReal computeUnblockedWeightedStreamNumber(const NBEdge* const e1, const NBEdge* const e2) ; + SUMOReal computeUnblockedWeightedStreamNumber(const NBEdge* const e1, const NBEdge* const e2); /** @brief Returns the combination of two edges from the given which has most unblocked streams * @param[in] edges The list of edges to include in the computation * @return The two edges for which the weighted number of unblocked streams is the highest */ - std::pair getBestCombination(const EdgeVector& edges) ; + std::pair getBestCombination(const EdgeVector& edges); /** @brief Returns the combination of two edges from the given which has most unblocked streams @@ -182,7 +185,7 @@ * @param[in, changed] incoming The list of edges which are participating in the logic * @return The two edges for which the weighted number of unblocked streams is the highest */ - std::pair getBestPair(EdgeVector& incoming) ; + std::pair getBestPair(EdgeVector& incoming); /** @class edge_by_incoming_priority_sorter diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBRequest.cpp sumo-0.16.0~dfsg/src/netbuild/NBRequest.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBRequest.cpp 2012-02-29 00:03:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBRequest.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Tue, 20 Nov 2001 -/// @version $Id: NBRequest.cpp 11966 2012-02-28 13:56:09Z dkrajzew $ +/// @version $Id: NBRequest.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // This class computes the logic of a junction /****************************************************************************/ @@ -163,6 +163,8 @@ } // reset signalised/non-signalised dependencies resetSignalised(); + // reset foes it the number of lanes matches (or exceeds) the number of incoming connections + resetCooperating(); } @@ -235,21 +237,20 @@ return; } - // check the priorities - int from1p = from1->getJunctionPriority(myJunction); - int from2p = from2->getJunctionPriority(myJunction); - // check if one of the connections is higher priorised when incoming into - // the junction, the connection road will yield - // should be valid for priority junctions only - if (from1p > from2p) { - assert(myJunction->getType() != NODETYPE_RIGHT_BEFORE_LEFT); - myForbids[idx1][idx2] = true; - return; - } - if (from2p > from1p) { - assert(myJunction->getType() != NODETYPE_RIGHT_BEFORE_LEFT); - myForbids[idx2][idx1] = true; - return; + // check the priorities if required by node type + if (myJunction->getType() != NODETYPE_RIGHT_BEFORE_LEFT) { + int from1p = from1->getJunctionPriority(myJunction); + int from2p = from2->getJunctionPriority(myJunction); + // check if one of the connections is higher priorised when incoming into + // the junction, the connection road will yield + if (from1p > from2p) { + myForbids[idx1][idx2] = true; + return; + } + if (from2p > from1p) { + myForbids[idx2][idx1] = true; + return; + } } // check whether one of the connections is higher priorised on @@ -312,21 +313,19 @@ NBRequest::distanceCounterClockwise(NBEdge* from, NBEdge* to) { EdgeVector::const_iterator p = find(myAll.begin(), myAll.end(), from); size_t ret = 0; - while (true) { + do { ret++; if (p == myAll.begin()) { p = myAll.end(); } p--; - if ((*p) == to) { - return ret; - } - } + } while (*p != to); + return ret; } void -NBRequest::writeLogic(std::string key, OutputDevice& into) const { +NBRequest::writeLogic(std::string /* key */, OutputDevice& into) const { int pos = 0; EdgeVector::const_iterator i; for (i = myIncoming.begin(); i != myIncoming.end(); i++) { @@ -478,11 +477,7 @@ od.writeAttr(SUMO_ATTR_RESPONSE, getResponseString(from, (*j).toEdge, fromLane, (*j).mayDefinitelyPass)); od.writeAttr(SUMO_ATTR_FOES, getFoesString(from, (*j).toEdge)); if (!OptionsCont::getOptions().getBool("no-internal-links")) { - if ((*j).haveVia) { - od.writeAttr(SUMO_ATTR_CONT, 1); - } else { - od.writeAttr(SUMO_ATTR_CONT, 0); - } + od.writeAttr(SUMO_ATTR_CONT, j->haveVia); } od.closeTag(true); } @@ -536,10 +531,6 @@ // remember the case when the lane is a "dead end" in the meaning that // vehicles must choose another lane to move over the following // junction - int idx = 0; - if (to != 0) { - idx = getIndex(from, to); - } // !!! move to forbidden std::string result; for (EdgeVector::const_reverse_iterator i = myIncoming.rbegin(); @@ -641,6 +632,36 @@ } +void +NBRequest::resetCooperating() { + // map from edge to number of incoming connections + std::map incomingCount; // initialized to 0 + // map from edge to indices of approached lanes + std::map > approachedLanes; + // map from edge to list of incoming edges + std::map incomingEdges; + for (EdgeVector::const_iterator it_e = myIncoming.begin(); it_e != myIncoming.end(); it_e++) { + const std::vector connections = (*it_e)->getConnections(); + for (std::vector::const_iterator it_c = connections.begin(); it_c != connections.end(); ++it_c) { + incomingCount[it_c->toEdge]++; + approachedLanes[it_c->toEdge].insert(it_c->toLane); + incomingEdges[it_c->toEdge].push_back(*it_e); + } + } + for (std::map::iterator it = incomingCount.begin(); it != incomingCount.end(); ++it) { + NBEdge* to = it->first; + // we cannot test against to->getNumLanes() since not all lanes may be used + if (approachedLanes[to].size() >= it->second) { + EdgeVector& incoming = incomingEdges[to]; + // make these connections mutually unconflicting + for (EdgeVector::iterator it_e1 = incoming.begin(); it_e1 != incoming.end(); ++it_e1) { + for (EdgeVector::iterator it_e2 = incoming.begin(); it_e2 != incoming.end(); ++it_e2) { + myForbids[getIndex(*it_e1, to)][getIndex(*it_e2, to)] = false; + } + } + } + } +} /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBRequest.h sumo-0.16.0~dfsg/src/netbuild/NBRequest.h --- sumo-0.15.0~dfsg/src/netbuild/NBRequest.h 2012-02-07 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBRequest.h 2012-11-23 00:02:18.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBRequest.h 11834 2012-02-06 11:15:02Z behrisch $ +/// @version $Id: NBRequest.h 13033 2012-11-22 13:53:57Z namdre $ /// // This class computes the logic of a junction /****************************************************************************/ @@ -95,7 +95,7 @@ * @return Whether the first flow prohibits the second one */ bool mustBrake(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo, - const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo) const ; + const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo) const; /** @brief Returns the information whether the described flow must let any other flow pass @@ -103,7 +103,7 @@ * @param[in] to The connection's end edge * @return Whether the described connection must brake (has higher priorised foes) */ - bool mustBrake(const NBEdge* const from, const NBEdge* const to) const ; // !!! + bool mustBrake(const NBEdge* const from, const NBEdge* const to) const; // !!! /** @brief Returns the information whether the given flows cross * @param[in] from1 The starting edge of the first stream @@ -113,7 +113,7 @@ * @return Whether both stream are foes (cross) */ bool foes(const NBEdge* const from1, const NBEdge* const to1, - const NBEdge* const from2, const NBEdge* const to2) const ; + const NBEdge* const from2, const NBEdge* const to2) const; /** @brief Returns the information whether "prohibited" flow must let "prohibitor" flow pass @@ -126,7 +126,7 @@ */ bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo, const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo, - bool regardNonSignalisedLowerPriority) const ; + bool regardNonSignalisedLowerPriority) const; /** writes the XML-representation of the logic as a bitset-logic XML representation */ @@ -183,7 +183,7 @@ * @param[in] to The destination edge (outgoing from this logic) * @return The index within the internal container */ - int getIndex(const NBEdge* const from, const NBEdge* const to) const ; + int getIndex(const NBEdge* const from, const NBEdge* const to) const; /** returns the distance between the incoming (from) and the outgoing (to) @@ -201,6 +201,10 @@ void resetSignalised(); + + /// @brief reset foes it the number of lanes matches (or exceeds) the number of incoming connections for an edge + void resetCooperating(); + private: /// the node the request is assigned to NBNode* myJunction; @@ -234,9 +238,11 @@ private: static size_t myGoodBuilds, myNotBuild; +private: + /// @brief Invalidated assignment operator + NBRequest& operator=(const NBRequest& s); }; - #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBSign.cpp sumo-0.16.0~dfsg/src/netbuild/NBSign.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBSign.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBSign.cpp 2012-12-02 13:45:17.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +/// @file NBSign.cpp +/// @author Jakob Erdmann +/// @date Nov 2012 +/// @version $Id: NBSign.cpp 13106 2012-12-02 13:44:57Z behrisch $ +/// +// A class representing a street sign +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include "NBEdge.h" +#include "NBSign.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// static members +// =========================================================================== +StringBijection::Entry signTypeStringsInitializaer[] = { + {"speed limit", NBSign::SIGN_TYPE_SPEED}, + {"yield", NBSign::SIGN_TYPE_YIELD}, + {"on ramp", NBSign::SIGN_TYPE_ON_RAMP}, + {"priority", NBSign::SIGN_TYPE_PRIORITY}, + {"right before left", NBSign::SIGN_TYPE_RIGHT_BEFORE_LEFT}, + {"roundabout", NBSign::SIGN_TYPE_ROUNDABOUT}, + {"rail crossing", NBSign::SIGN_TYPE_RAIL_CROSSING}, + {"slope", NBSign::SIGN_TYPE_SLOPE}, + {"city limits", NBSign::SIGN_TYPE_CITY}, + {"info", NBSign::SIGN_TYPE_INFO}, +}; + +StringBijection NBSign::SignTypeStrings( + signTypeStringsInitializaer, NBSign::SIGN_TYPE_INFO); + + +StringBijection::Entry SignTypeColorsInitializaer[] = { + {"0.5,0.5,0.5", NBSign::SIGN_TYPE_SPEED}, + {"1.0,0.0,0.0", NBSign::SIGN_TYPE_YIELD}, + {"1.0,0.0,0.0", NBSign::SIGN_TYPE_ON_RAMP}, + {"1.0,1.0,0.0", NBSign::SIGN_TYPE_PRIORITY}, + {"1.0,0.6,0.0", NBSign::SIGN_TYPE_RIGHT_BEFORE_LEFT}, + {"0.0,0.0,1.0", NBSign::SIGN_TYPE_ROUNDABOUT}, + {"1.0,0.0,0.0", NBSign::SIGN_TYPE_RAIL_CROSSING}, + {"0.5,0.5,0.5", NBSign::SIGN_TYPE_SLOPE}, + {"0.5,0.5,0.5", NBSign::SIGN_TYPE_CITY}, + {"0.5,0.5,0.5", NBSign::SIGN_TYPE_INFO}, +}; + +StringBijection NBSign::SignTypeColors( + SignTypeColorsInitializaer, NBSign::SIGN_TYPE_INFO); + +// =========================================================================== +// member method definitions +// =========================================================================== + +NBSign::NBSign(SignType type, SUMOReal offset, const std::string label) : + myType(type), + myOffset(offset), + myLabel(label) +{ } + + +NBSign::~NBSign() {} + + +void +NBSign::writeAsPOI(OutputDevice& into, const NBEdge* edge) const { + PositionVector shp = edge->getLanes()[0].shape; + shp.move2side(3); + Position pos = shp.positionAtLengthPosition(myOffset); + into.openTag(SUMO_TAG_POI); + into.writeAttr(SUMO_ATTR_ID, edge->getID() + "." + toString(myOffset)); + into.writeAttr(SUMO_ATTR_TYPE, SignTypeStrings.getString(myType)); + into.writeAttr(SUMO_ATTR_COLOR, SignTypeColors.getString(myType)); /// XXX @todo add default colors + into.writeAttr(SUMO_ATTR_X, pos.x()); + into.writeAttr(SUMO_ATTR_Y, pos.y()); + into.writeAttr(SUMO_ATTR_ANGLE, 0); // XXX use road angle? + // @todo add image resources and default images for all signs + //into.writeAttr(SUMO_ATTR_IMGFILE, p->getImgFile()); + //into.writeAttr(SUMO_ATTR_WIDTH, p->getWidth()); + //into.writeAttr(SUMO_ATTR_HEIGHT, p->getHeight()); + into.closeTag(true); +} + + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBSign.h sumo-0.16.0~dfsg/src/netbuild/NBSign.h --- sumo-0.15.0~dfsg/src/netbuild/NBSign.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBSign.h 2012-12-02 13:45:17.000000000 +0000 @@ -0,0 +1,100 @@ +/****************************************************************************/ +/// @file NBSign.h +/// @author Jakob Erdmann +/// @date Nov 2012 +/// @version $Id: NBSign.h 13106 2012-12-02 13:44:57Z behrisch $ +/// +// A class representing a street sign +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef NBSign_h +#define NBSign_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class NBEdge; +class OutputDevice; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class NBSign + * @brief A class representing a single street sign + */ +class NBSign { +public: + + enum SignType { + SIGN_TYPE_SPEED, + SIGN_TYPE_YIELD, + SIGN_TYPE_ON_RAMP, + SIGN_TYPE_PRIORITY, + SIGN_TYPE_RIGHT_BEFORE_LEFT, + SIGN_TYPE_ROUNDABOUT, + SIGN_TYPE_RAIL_CROSSING, + SIGN_TYPE_SLOPE, + SIGN_TYPE_CITY, + SIGN_TYPE_INFO + }; + + /** @brief Constructor with id, and position + * + * @param[in] type The type of the sign + * @param[in] offset The offset of the sign from the start of its edge + * @param[in] label The (optional) label (for SPEED, SLOPE etc) + */ + NBSign(SignType type, SUMOReal offset, const std::string label = ""); + + + /// @brief Destructor + ~NBSign(); + + /// @brief write into device as POI positioned relative to the given edge + void writeAsPOI(OutputDevice& into, const NBEdge* edge) const; + + +private: + /// @brief the type of the sign + SignType myType; + + /// @brief The offset of the sign from the start of its edge + SUMOReal myOffset; + + /// @brief The (optional) label (for SPEED, SLOPE etc) + std::string myLabel; + + static StringBijection SignTypeStrings; + static StringBijection SignTypeColors; +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightDefinition.cpp sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightDefinition.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightDefinition.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightDefinition.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightDefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBTrafficLightDefinition.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The base class for traffic light logic definitions /****************************************************************************/ @@ -39,7 +39,6 @@ #include #include "NBTrafficLightDefinition.h" #include -#include "NBTrafficLightDefinition.h" #include "NBLinkPossibilityMatrix.h" #include "NBTrafficLightLogic.h" #include "NBContHelper.h" @@ -57,9 +56,8 @@ // method definitions // =========================================================================== NBTrafficLightDefinition::NBTrafficLightDefinition(const std::string& id, - const std::vector &junctions, - const std::string& programID) - : Named(id), myControlledNodes(junctions), mySubID(programID) { + const std::vector& junctions, const std::string& programID, SUMOTime offset) + : Named(id), myControlledNodes(junctions), mySubID(programID), myOffset(offset) { std::vector::iterator i = myControlledNodes.begin(); while (i != myControlledNodes.end()) { for (std::vector::iterator j = i + 1; j != myControlledNodes.end();) { @@ -79,16 +77,15 @@ NBTrafficLightDefinition::NBTrafficLightDefinition(const std::string& id, - NBNode* junction, - const std::string& programID) - : Named(id), mySubID(programID) { + NBNode* junction, const std::string& programID, SUMOTime offset) + : Named(id), mySubID(programID), myOffset(offset) { addNode(junction); junction->addTrafficLight(this); } -NBTrafficLightDefinition::NBTrafficLightDefinition(const std::string& id, const std::string& programID) - : Named(id), mySubID(programID) {} +NBTrafficLightDefinition::NBTrafficLightDefinition(const std::string& id, const std::string& programID, SUMOTime offset) + : Named(id), mySubID(programID), myOffset(offset) {} NBTrafficLightDefinition::~NBTrafficLightDefinition() {} @@ -342,7 +339,7 @@ void -NBTrafficLightDefinition::addControlledInnerEdges(const std::vector &edges) { +NBTrafficLightDefinition::addControlledInnerEdges(const std::vector& edges) { myControlledInnerEdges.insert(edges.begin(), edges.end()); } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightDefinition.h sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightDefinition.h --- sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightDefinition.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightDefinition.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: NBTrafficLightDefinition.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBTrafficLightDefinition.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The base class for traffic light logic definitions /****************************************************************************/ @@ -95,29 +95,37 @@ /** @brief Constructor * @param[in] id The id of the tls * @param[in] junctions List of junctions controlled by this tls + * @param[in] programID The id of the added program ("subID") + * @param[in] offset The offset of the plan */ NBTrafficLightDefinition(const std::string& id, - const std::vector &junctions, - const std::string& programID) ; + const std::vector& junctions, + const std::string& programID, + SUMOTime offset); /** @brief Constructor * @param[in] id The id of the tls * @param[in] junction The (single) junction controlled by this tls + * @param[in] programID The id of the added program ("subID") + * @param[in] offset The offset of the plan */ NBTrafficLightDefinition(const std::string& id, NBNode* junction, - const std::string& programID) ; + const std::string& programID, + SUMOTime offset); /** @brief Constructor * @param[in] id The id of the tls + * @param[in] programID The id of the added program ("subID") + * @param[in] offset The offset of the plan */ - NBTrafficLightDefinition(const std::string& id, const std::string& programID) ; + NBTrafficLightDefinition(const std::string& id, const std::string& programID, SUMOTime offset); /// @brief Destructor - virtual ~NBTrafficLightDefinition() ; + virtual ~NBTrafficLightDefinition(); /** @brief Computes the traffic light logic @@ -129,7 +137,7 @@ * @param[in] oc The options container holding options needed during the building * @return The built logic (may be 0) */ - NBTrafficLightLogic* compute(const NBEdgeCont& ec, OptionsCont& oc) ; + NBTrafficLightLogic* compute(const NBEdgeCont& ec, OptionsCont& oc); @@ -151,7 +159,7 @@ /** @brief Returns the list of controlled nodes * @return Controlled nodes */ - const std::vector &getNodes() const { + const std::vector& getNodes() const { return myControlledNodes; } /// @} @@ -167,7 +175,7 @@ * @param[in] to The connection's end edge * @return Whether the described connection must brake (has higher priorised foes) */ - bool mustBrake(const NBEdge* const from, const NBEdge* const to) const ; + bool mustBrake(const NBEdge* const from, const NBEdge* const to) const; /** @brief Returns the information whether the described flow must let the other flow pass @@ -179,7 +187,7 @@ */ bool mustBrake(const NBConnection& possProhibited, const NBConnection& possProhibitor, - bool regardNonSignalisedLowerPriority) const ; + bool regardNonSignalisedLowerPriority) const; /** @brief Returns the information whether the described flow must let any other flow pass * @param[in] possProhibitedFrom The maybe prohibited connection's begin @@ -192,7 +200,7 @@ */ bool mustBrake(const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo, const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo, - bool regardNonSignalisedLowerPriority) const ; + bool regardNonSignalisedLowerPriority) const; /** @brief Returns the information whether "prohibited" flow must let "prohibitor" flow pass @@ -206,7 +214,7 @@ */ bool forbids(const NBEdge* const possProhibitorFrom, const NBEdge* const possProhibitorTo, const NBEdge* const possProhibitedFrom, const NBEdge* const possProhibitedTo, - bool regardNonSignalisedLowerPriority) const ; + bool regardNonSignalisedLowerPriority) const; /** @brief Returns the information whether the given flows cross @@ -217,7 +225,7 @@ * @return Whether both stream are foes (cross) */ bool foes(const NBEdge* const from1, const NBEdge* const to1, - const NBEdge* const from2, const NBEdge* const to2) const ; + const NBEdge* const from2, const NBEdge* const to2) const; /** @brief Informs edges about being controlled by a tls @@ -228,13 +236,13 @@ /** @brief Builds the list of participating nodes/edges/links */ - virtual void setParticipantsInformation() ; + virtual void setParticipantsInformation(); /** @brief Adds the given ids into the list of edges not controlled by the tls * @param[in] edges The list of edge ids to add the inner edges to */ - void addControlledInnerEdges(const std::vector &edges) ; + void addControlledInnerEdges(const std::vector& edges); /** @brief Replaces occurences of the removed edge in incoming/outgoing edges of all definitions @@ -261,13 +269,13 @@ * @param[in] to The connection's end edge * @return Whether the connection is a left-mover */ - bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const ; + bool isLeftMover(const NBEdge* const from, const NBEdge* const to) const; /** @brief Returns the list of incoming edges (must be build first) * @return The edges which are incoming into the tls */ - const EdgeVector& getIncomingEdges() const ; + const EdgeVector& getIncomingEdges() const; /// @brief returns the controlled links (depends on previous call to collectLinks) @@ -290,11 +298,22 @@ }; + /** @brief Sets the programID + * @param[in] programID The new ID of the program (subID) + */ void setProgramID(const std::string& programID) { mySubID = programID; } + /** @brief Returns the offset + * @return Offset + */ + SUMOTime getOffset() { + return myOffset; + } + + protected: /** @brief Computes the traffic light logic finally in dependence to the type * @param[in] ec The edge container @@ -313,7 +332,7 @@ /** @brief Build the list of participating edges */ - void collectEdges() ; + void collectEdges(); /** @brief Computes the time vehicles may need to brake @@ -321,7 +340,7 @@ * This time depends on the maximum speed allowed on incoming junctions. * It is computed as max_speed_allowed / minimum_vehicle_decleration */ - unsigned int computeBrakingTime(SUMOReal minDecel) const ; + unsigned int computeBrakingTime(SUMOReal minDecel) const; // @return whether this traffic light is invalid and should be computed @@ -347,6 +366,9 @@ /// @brief The tls program's subid std::string mySubID; + /// @brief The offset in the program + SUMOTime myOffset; + }; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightLogic.cpp sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightLogic.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightLogic.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightLogic.cpp 2012-09-25 22:01:56.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogic.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBTrafficLightLogic.cpp 12454 2012-06-30 04:54:07Z behrisch $ /// // A SUMO-compliant built logic for a traffic light /****************************************************************************/ @@ -68,9 +68,9 @@ // member method definitions // =========================================================================== NBTrafficLightLogic::NBTrafficLightLogic(const std::string& id, - const std::string& subid, unsigned int noLinks) : + const std::string& subid, unsigned int noLinks, SUMOTime offset) : Named(id), myNumLinks(noLinks), mySubID(subid), - myOffset(0) {} + myOffset(offset) {} NBTrafficLightLogic::NBTrafficLightLogic(const NBTrafficLightLogic* logic) : Named(logic->getID()), @@ -90,7 +90,7 @@ // initialize myNumLinks = (unsigned int)state.size(); } else if (state.size() != myNumLinks) { - throw ProcessError("When adding phase: state length of " + toString(state.size()) + + throw ProcessError("When adding phase to tlLogic '" + getID() + "': state length of " + toString(state.size()) + " does not match declared number of links " + toString(myNumLinks)); } // check state contents @@ -148,7 +148,7 @@ void -NBTrafficLightLogic::setPhaseState(unsigned int phaseIndex, int tlIndex, LinkState linkState) { +NBTrafficLightLogic::setPhaseState(unsigned int phaseIndex, unsigned int tlIndex, LinkState linkState) { assert(phaseIndex < myPhases.size()); std::string& phaseState = myPhases[phaseIndex].state; assert(tlIndex < phaseState.size()); diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightLogic.h sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightLogic.h --- sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightLogic.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightLogic.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogic.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBTrafficLightLogic.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A SUMO-compliant built logic for a traffic light /****************************************************************************/ @@ -95,7 +95,7 @@ * @param[in] subid The id of the program * @param[in] noLinks Number of links that are controlled by this tls. 0 means the value is not known beforehand */ - NBTrafficLightLogic(const std::string& id, const std::string& subid, unsigned int noLinks) ; + NBTrafficLightLogic(const std::string& id, const std::string& subid, unsigned int noLinks, SUMOTime offset = 0); /** @brief Copy Constructor @@ -105,7 +105,7 @@ /// @brief Destructor - ~NBTrafficLightLogic() ; + ~NBTrafficLightLogic(); /** @brief Adds a phase to the logic @@ -124,7 +124,7 @@ * @param[in] tlIndex The index at which to modify the state * @param[in] linkState The new link state for the given index */ - void setPhaseState(unsigned int phaseIndex, int tlIndex, LinkState linkState); + void setPhaseState(unsigned int phaseIndex, unsigned int tlIndex, LinkState linkState); /** @brief Modifies the duration for an existing phase (used by NETEDIT) * @param[in] phaseIndex The index of the phase to modify @@ -145,13 +145,13 @@ * * Joins equal steps. */ - void closeBuilding() ; + void closeBuilding(); /** @brief Returns the duration of the complete cycle * @return The duration of this logic's cycle */ - SUMOTime getDuration() const ; + SUMOTime getDuration() const; /** @brief Sets the offset of this tls @@ -173,7 +173,7 @@ /** @brief Returns the phases * @return The phase list */ - const std::vector &getPhases() const { + const std::vector& getPhases() const { return myPhases; } @@ -213,6 +213,9 @@ static const char allowedStatesInitializer[]; static const std::string ALLOWED_STATES; +private: + /// @brief Invalidated assignment operator + NBTrafficLightLogic& operator=(const NBTrafficLightLogic& s); }; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightLogicCont.h sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightLogicCont.h --- sumo-0.15.0~dfsg/src/netbuild/NBTrafficLightLogicCont.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTrafficLightLogicCont.h 2012-09-25 22:01:56.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogicCont.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NBTrafficLightLogicCont.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A container for traffic light definitions and built programs /****************************************************************************/ @@ -65,10 +65,10 @@ class NBTrafficLightLogicCont { public: /// @brief Constructor - NBTrafficLightLogicCont() ; + NBTrafficLightLogicCont(); /// @brief Destructor - ~NBTrafficLightLogicCont() ; + ~NBTrafficLightLogicCont(); /** @brief Initialises the storage by applying given options * @@ -78,7 +78,7 @@ * @param[in] oc The options container to read options from * @todo Recheck exceptions */ - void applyOptions(OptionsCont& oc) ; + void applyOptions(OptionsCont& oc); /** @brief Adds a logic definition to the dictionary @@ -90,7 +90,7 @@ * @param[in] renameProgram If true, rename the program to make insertion succeed * @return Whether the logic was valid (no logic with the same id and programID is already known) */ - bool insert(NBTrafficLightDefinition* logic, bool forceInsert = false) ; + bool insert(NBTrafficLightDefinition* logic, bool forceInsert = false); /** @brief Removes a logic definition (and all programs) from the dictionary @@ -158,7 +158,7 @@ * @todo Recheck usage */ void remapRemoved(NBEdge* removed, - const EdgeVector& incoming, const EdgeVector& outgoing) ; + const EdgeVector& incoming, const EdgeVector& outgoing); /** @brief Replaces occurences of the removed edge/lane in all definitions by the given edge @@ -170,7 +170,7 @@ * @todo Recheck usage */ void replaceRemoved(NBEdge* removed, int removedLane, - NBEdge* by, int byLane) ; + NBEdge* by, int byLane); /** @brief Returns the named definition @@ -208,7 +208,7 @@ * @see NBTrafficLightDefinition::setParticipantsInformation * @see NBTrafficLightDefinition::setTLControllingInformation */ - void setTLControllingInformation(const NBEdgeCont& ec) ; + void setTLControllingInformation(const NBEdgeCont& ec); private: @@ -243,7 +243,7 @@ /** @brief Destroys all stored definitions and logics */ - void clear() ; + void clear(); }; diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTypeCont.cpp sumo-0.16.0~dfsg/src/netbuild/NBTypeCont.cpp --- sumo-0.15.0~dfsg/src/netbuild/NBTypeCont.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTypeCont.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NBTypeCont.cpp 12069 2012-03-12 14:39:00Z dkrajzew $ +/// @version $Id: NBTypeCont.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A storage for the available types of an edge /****************************************************************************/ @@ -66,7 +66,7 @@ bool NBTypeCont::insert(const std::string& id, int noLanes, SUMOReal maxSpeed, int prio, - SVCPermissions permissions, SUMOReal width, bool oneWayIsDefault) { + SVCPermissions permissions, SUMOReal width, bool oneWayIsDefault) { TypesCont::iterator i = myTypes.find(id); if (i != myTypes.end()) { return false; @@ -124,7 +124,7 @@ } -SVCPermissions +SVCPermissions NBTypeCont::getPermissions(const std::string& type) const { return getType(type).permissions; } diff -Nru sumo-0.15.0~dfsg/src/netbuild/NBTypeCont.h sumo-0.16.0~dfsg/src/netbuild/NBTypeCont.h --- sumo-0.15.0~dfsg/src/netbuild/NBTypeCont.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netbuild/NBTypeCont.h 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NBTypeCont.h 12063 2012-03-12 12:49:03Z dkrajzew $ +/// @version $Id: NBTypeCont.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A storage for available types of edges /****************************************************************************/ @@ -69,7 +69,7 @@ * @param[in] defaultPriority The default priority of an edge */ void setDefaults(int defaultNoLanes, - SUMOReal defaultSpeed, int defaultPriority) ; + SUMOReal defaultSpeed, int defaultPriority); /** @brief Adds a type into the list. This is a simplified convenience form @@ -84,7 +84,7 @@ * @return Whether the type could be added (no type with the same id existed) */ bool insert(const std::string& id, int noLanes, SUMOReal maxSpeed, int prio, - SUMOReal width, SUMOVehicleClass vClasses = SVC_UNKNOWN, bool oneWayIsDefault = false) ; + SUMOReal width, SUMOVehicleClass vClasses = SVC_UNKNOWN, bool oneWayIsDefault = false); /** @brief Adds a type into the list * @param[in] id The id of the type @@ -99,7 +99,7 @@ bool insert(const std::string& id, int noLanes, SUMOReal maxSpeed, int prio, SVCPermissions permissions, - SUMOReal width, bool oneWayIsDefault) ; + SUMOReal width, bool oneWayIsDefault); /** @brief Returns the number of known types * @return The number of known edge types (excluding the default) @@ -112,13 +112,13 @@ /** @brief Returns whether the named type is in the container * @return Whether the named type is known */ - bool knows(const std::string& type) const ; + bool knows(const std::string& type) const; /** @brief Marks a type as to be discarded * @param[in] id The id of the type */ - bool markAsToDiscard(const std::string& id) ; + bool markAsToDiscard(const std::string& id); @@ -131,7 +131,7 @@ * @param[in] type The name of the type to return the lane number for * @return The number of lanes an edge of this type has */ - int getNumLanes(const std::string& type) const ; + int getNumLanes(const std::string& type) const; /** @brief Returns the maximal velocity for the given type [m/s] @@ -140,7 +140,7 @@ * @param[in] type The name of the type to return the speed for * @return The allowed speed on edges of this type */ - SUMOReal getSpeed(const std::string& type) const ; + SUMOReal getSpeed(const std::string& type) const; /** @brief Returns the priority for the given type @@ -149,7 +149,7 @@ * @param[in] type The name of the type to return the priority for * @return The priority of edges of this type */ - int getPriority(const std::string& type) const ; + int getPriority(const std::string& type) const; /** @brief Returns whether edges are one-way per default for the given type @@ -159,7 +159,7 @@ * @return Whether edges of this type are one-way per default * @todo There is no default for one-way!? */ - bool getIsOneWay(const std::string& type) const ; + bool getIsOneWay(const std::string& type) const; /** @brief Returns the information whether edges of this type shall be discarded. @@ -167,7 +167,7 @@ * Returns false if the type is not known. * @return Whether edges of this type shall be discarded. */ - bool getShallBeDiscarded(const std::string& type) const ; + bool getShallBeDiscarded(const std::string& type) const; /** @brief Returns allowed vehicle classes for the given type @@ -176,7 +176,7 @@ * @param[in] type The name of the type to return the list of allowed vehicles classes for * @return List of vehicles class which may use edges of the given type */ - SVCPermissions getPermissions(const std::string& type) const ; + SVCPermissions getPermissions(const std::string& type) const; /** @brief Returns the lane width for the given type [m/s] @@ -185,21 +185,21 @@ * @param[in] type The name of the type to return the width for * @return The width of lanes of edges of this type */ - SUMOReal getWidth(const std::string& type) const ; + SUMOReal getWidth(const std::string& type) const; /// @} private: struct TypeDefinition { /// @brief Constructor - TypeDefinition() : + TypeDefinition() : noLanes(1), speed((SUMOReal) 13.9), priority(-1), permissions(SVCFreeForAll), oneWay(true), discard(false), width(NBEdge::UNSPECIFIED_WIDTH) { } /// @brief Constructor - TypeDefinition(int _noLanes, SUMOReal _speed, int _priority, - SUMOReal _width, SVCPermissions _permissions, bool _oneWay) : + TypeDefinition(int _noLanes, SUMOReal _speed, int _priority, + SUMOReal _width, SVCPermissions _permissions, bool _oneWay) : noLanes(_noLanes), speed(_speed), priority(_priority), permissions(_permissions), oneWay(_oneWay), discard(false), width(_width) { } diff -Nru sumo-0.15.0~dfsg/src/netconvert_main.cpp sumo-0.16.0~dfsg/src/netconvert_main.cpp --- sumo-0.15.0~dfsg/src/netconvert_main.cpp 2012-02-18 00:04:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netconvert_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: netconvert_main.cpp 11927 2012-02-17 10:03:39Z namdre $ +/// @version $Id: netconvert_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for NETCONVERT /****************************************************************************/ @@ -107,14 +107,14 @@ oc.setApplicationName("netconvert", "SUMO netconvert Version " + (std::string)VERSION_STRING); int ret = 0; try { - XMLSubSys::init(false); + XMLSubSys::init(); fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!checkOptions()) { throw ProcessError(); @@ -134,20 +134,25 @@ } nb.compute(oc); NWFrame::writeNetwork(oc, nb); - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } NBDistribution::clear(); - OutputDevice::closeAll(); SystemFrame::close(); // report about ending if (ret == 0) { diff -Nru sumo-0.15.0~dfsg/src/netgen/Makefile.am sumo-0.16.0~dfsg/src/netgen/Makefile.am --- sumo-0.15.0~dfsg/src/netgen/Makefile.am 2011-05-06 23:02:06.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/Makefile.am 2012-11-19 00:02:16.000000000 +0000 @@ -6,20 +6,20 @@ MEM_LIBS = ../foreign/nvwa/libnvwa.a endif -bin_PROGRAMS = netgen +bin_PROGRAMS = netgenerate -netgen_SOURCES = netgen_main.cpp NGEdge.cpp NGEdge.h NGFrame.cpp NGFrame.h \ +netgenerate_SOURCES = netgen_main.cpp NGEdge.cpp NGEdge.h NGFrame.cpp NGFrame.h \ NGNet.h NGNet.cpp NGNode.cpp NGNode.h \ NGRandomNetBuilder.h NGRandomNetBuilder.cpp -netgen_LDFLAGS = $(XERCES_LDFLAGS) $(PROJ_LDFLAGS) +netgenerate_LDFLAGS = $(XERCES_LDFLAGS) $(PROJ_LDFLAGS) -netgen_LDADD = ../netbuild/libnetbuild.a \ +netgenerate_LDADD = ../netbuild/libnetbuild.a \ ../netwrite/libnetwrite.a \ ../utils/geom/libgeom.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../foreign/tcpip/libtcpip.a \ diff -Nru sumo-0.15.0~dfsg/src/netgen/Makefile.in sumo-0.16.0~dfsg/src/netgen/Makefile.in --- sumo-0.15.0~dfsg/src/netgen/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/Makefile.in 2012-12-04 00:13:19.000000000 +0000 @@ -35,7 +35,7 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = netgen$(EXEEXT) +bin_PROGRAMS = netgenerate$(EXEEXT) subdir = src/netgen DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -48,20 +48,20 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am_netgen_OBJECTS = netgen_main.$(OBJEXT) NGEdge.$(OBJEXT) \ +am_netgenerate_OBJECTS = netgen_main.$(OBJEXT) NGEdge.$(OBJEXT) \ NGFrame.$(OBJEXT) NGNet.$(OBJEXT) NGNode.$(OBJEXT) \ NGRandomNetBuilder.$(OBJEXT) -netgen_OBJECTS = $(am_netgen_OBJECTS) +netgenerate_OBJECTS = $(am_netgenerate_OBJECTS) am__DEPENDENCIES_1 = -netgen_DEPENDENCIES = ../netbuild/libnetbuild.a \ +netgenerate_DEPENDENCIES = ../netbuild/libnetbuild.a \ ../netwrite/libnetwrite.a ../utils/geom/libgeom.a \ - ../utils/options/liboptions.a ../utils/common/libcommon.a \ - ../utils/xml/libxml.a ../utils/importio/libimportio.a \ + ../utils/options/liboptions.a ../utils/xml/libxml.a \ + ../utils/common/libcommon.a ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) $(am__DEPENDENCIES_1) -netgen_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(netgen_LDFLAGS) $(LDFLAGS) -o $@ +netgenerate_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(netgenerate_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -84,8 +84,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(netgen_SOURCES) -DIST_SOURCES = $(netgen_SOURCES) +SOURCES = $(netgenerate_SOURCES) +DIST_SOURCES = $(netgenerate_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -111,6 +111,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -141,6 +142,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -175,6 +177,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -208,7 +211,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -230,17 +232,17 @@ top_srcdir = @top_srcdir@ @WITH_PROJ_TRUE@PROJ_LIBS = -l$(LIB_PROJ) @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a -netgen_SOURCES = netgen_main.cpp NGEdge.cpp NGEdge.h NGFrame.cpp NGFrame.h \ +netgenerate_SOURCES = netgen_main.cpp NGEdge.cpp NGEdge.h NGFrame.cpp NGFrame.h \ NGNet.h NGNet.cpp NGNode.cpp NGNode.h \ NGRandomNetBuilder.h NGRandomNetBuilder.cpp -netgen_LDFLAGS = $(XERCES_LDFLAGS) $(PROJ_LDFLAGS) -netgen_LDADD = ../netbuild/libnetbuild.a \ +netgenerate_LDFLAGS = $(XERCES_LDFLAGS) $(PROJ_LDFLAGS) +netgenerate_LDADD = ../netbuild/libnetbuild.a \ ../netwrite/libnetwrite.a \ ../utils/geom/libgeom.a \ ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../foreign/tcpip/libtcpip.a \ @@ -325,9 +327,9 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -netgen$(EXEEXT): $(netgen_OBJECTS) $(netgen_DEPENDENCIES) - @rm -f netgen$(EXEEXT) - $(netgen_LINK) $(netgen_OBJECTS) $(netgen_LDADD) $(LIBS) +netgenerate$(EXEEXT): $(netgenerate_OBJECTS) $(netgenerate_DEPENDENCIES) + @rm -f netgenerate$(EXEEXT) + $(netgenerate_LINK) $(netgenerate_OBJECTS) $(netgenerate_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) diff -Nru sumo-0.15.0~dfsg/src/netgen/NGEdge.cpp sumo-0.16.0~dfsg/src/netgen/NGEdge.cpp --- sumo-0.15.0~dfsg/src/netgen/NGEdge.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGEdge.cpp 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGEdge.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGEdge.cpp 12135 2012-03-19 15:24:33Z namdre $ /// // A netgen-representation of an edge /****************************************************************************/ @@ -77,7 +77,7 @@ nb.getNodeCont().retrieve(myStartNode->getID()), // from nb.getNodeCont().retrieve(myEndNode->getID()), // to "", nb.getTypeCont().getSpeed(""), nb.getTypeCont().getNumLanes(""), - nb.getTypeCont().getPriority(""), nb.getTypeCont().getWidth(""), -1 + nb.getTypeCont().getPriority(""), nb.getTypeCont().getWidth(""), NBEdge::UNSPECIFIED_OFFSET ); } diff -Nru sumo-0.15.0~dfsg/src/netgen/NGEdge.h sumo-0.16.0~dfsg/src/netgen/NGEdge.h --- sumo-0.15.0~dfsg/src/netgen/NGEdge.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGEdge.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGEdge.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGEdge.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A netgen-representation of an edge /****************************************************************************/ @@ -68,14 +68,14 @@ * @param[in] StarNGNode The begin node * @param[in] EndNode The end node */ - NGEdge(const std::string& id, NGNode* startNode, NGNode* endNode) ; + NGEdge(const std::string& id, NGNode* startNode, NGNode* endNode); /** @brief Destructor * * Removes itself from the start and the end node's lists of connections. */ - ~NGEdge() ; + ~NGEdge(); /** @brief Returns this link's id @@ -114,7 +114,7 @@ * @param[in] nb The netbuilder to retrieve the referenced nodes from * @return The built edge */ - NBEdge* buildNBEdge(NBNetBuilder& nb) const ; + NBEdge* buildNBEdge(NBNetBuilder& nb) const; private: diff -Nru sumo-0.15.0~dfsg/src/netgen/NGNet.cpp sumo-0.16.0~dfsg/src/netgen/NGNet.cpp --- sumo-0.15.0~dfsg/src/netgen/NGNet.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGNet.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNet.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGNet.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The class storing the generated network /****************************************************************************/ @@ -228,7 +228,8 @@ if (node->getConnectionTo((*j)->getFromNode()) == 0 && RandHelper::rand() <= bidiProb) { NBEdge* back = new NBEdge("-" + (*j)->getID(), node, (*j)->getFromNode(), "", myNetBuilder.getTypeCont().getSpeed(""), myNetBuilder.getTypeCont().getNumLanes(""), - myNetBuilder.getTypeCont().getPriority(""), myNetBuilder.getTypeCont().getWidth(""), -1); + myNetBuilder.getTypeCont().getPriority(""), + myNetBuilder.getTypeCont().getWidth(""), NBEdge::UNSPECIFIED_OFFSET); myNetBuilder.getEdgeCont().insert(back); } } diff -Nru sumo-0.15.0~dfsg/src/netgen/NGNet.h sumo-0.16.0~dfsg/src/netgen/NGNet.h --- sumo-0.15.0~dfsg/src/netgen/NGNet.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGNet.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNet.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGNet.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The class storing the generated network /****************************************************************************/ @@ -56,11 +56,11 @@ class NGNet { public: /// @brief Constructor - NGNet(NBNetBuilder& nb) ; + NGNet(NBNetBuilder& nb); /// @brief Destructor - ~NGNet() ; + ~NGNet(); /** @brief Returns the node at the given position @@ -72,7 +72,7 @@ * @param[in] yPos The y-position of the searched node * @return The node with the given position, or 0 if no such node exists */ - NGNode* findNode(int xPos, int yPos) ; + NGNode* findNode(int xPos, int yPos); /** @brief Returns the next free id @@ -82,7 +82,7 @@ * * @return A new, unique numerical id */ - std::string getNextFreeID() ; + std::string getNextFreeID(); /** @brief Returns the x-position resulting from the given radius and angle @@ -91,7 +91,7 @@ * @param[in] phi The angle the position is located at * @return The x-position at the described circle at angle phi */ - SUMOReal radialToX(SUMOReal radius, SUMOReal phi) ; + SUMOReal radialToX(SUMOReal radius, SUMOReal phi); /** @brief Returns the y-position resulting from the given radius and angle @@ -100,7 +100,7 @@ * @param[in] phi The angle the position is located at * @return The y-position at the described circle at angle phi */ - SUMOReal radialToY(SUMOReal radius, SUMOReal phi) ; + SUMOReal radialToY(SUMOReal radius, SUMOReal phi); /** @brief Creates a grid network @@ -119,7 +119,7 @@ * @param[in] attachLength The length of streets attached at the border * @see NGNet::connect */ - void createChequerBoard(int numX, int numY, SUMOReal spaceX, SUMOReal spaceY, SUMOReal attachLength) ; + void createChequerBoard(int numX, int numY, SUMOReal spaceX, SUMOReal spaceY, SUMOReal attachLength); /** @brief Creates a spider network @@ -139,7 +139,7 @@ * @see NGNet::connect * @todo consolidate the name of the center node */ - void createSpiderWeb(int numRadDiv, int numCircles, SUMOReal spaceRad, bool hasCenter) ; + void createSpiderWeb(int numRadDiv, int numCircles, SUMOReal spaceRad, bool hasCenter); /** @brief Converts the stored network into its netbuilder-representation @@ -159,7 +159,7 @@ * @exception ProcessError If a built tls logic could not be added (should never happen) * @todo Check whether throwing an exception is really necessary, here */ - void toNB() const ; + void toNB() const; /** @brief Adds the given node to the network @@ -168,7 +168,7 @@ * * @param[in] node The node to add */ - void add(NGNode* node) ; + void add(NGNode* node); /** @brief Adds the given edge to the network @@ -177,14 +177,14 @@ * * @param[in] edge The edge to add */ - void add(NGEdge* edge) ; + void add(NGEdge* edge); /** @brief Returns the number of stored nodes * * @return The number of stored nodes */ - size_t nodeNo() const ; + size_t nodeNo() const; private: @@ -196,7 +196,7 @@ * @param[in] node1 The first node to connect * @param[in] node2 The second node to connect */ - void connect(NGNode* node1, NGNode* node2) ; + void connect(NGNode* node1, NGNode* node2); private: diff -Nru sumo-0.15.0~dfsg/src/netgen/NGNode.cpp sumo-0.16.0~dfsg/src/netgen/NGNode.cpp --- sumo-0.15.0~dfsg/src/netgen/NGNode.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGNode.cpp 2012-09-25 22:01:29.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNode.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGNode.cpp 12124 2012-03-19 09:42:14Z dkrajzew $ /// // A netgen-representation of a node /****************************************************************************/ @@ -97,7 +97,7 @@ // check whether it is a traffic light junction if (type == NODETYPE_TRAFFIC_LIGHT) { - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(myID, node); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(myID, node, 0); if (!nb.getTLLogicCont().insert(tlDef)) { // actually, nothing should fail here delete tlDef; diff -Nru sumo-0.15.0~dfsg/src/netgen/NGNode.h sumo-0.16.0~dfsg/src/netgen/NGNode.h --- sumo-0.15.0~dfsg/src/netgen/NGNode.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGNode.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNode.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGNode.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A netgen-representation of a node /****************************************************************************/ @@ -57,14 +57,14 @@ class NGNode { public: /// @brief Constructor - NGNode() ; + NGNode(); /** @brief Constructor * * @param[in] id The id of the node */ - NGNode(const std::string& id) ; + NGNode(const std::string& id); /** @brief Constructor @@ -73,7 +73,7 @@ * @param[in] xPos The x-position of the node * @param[in] yPos The y-position of the node */ - NGNode(const std::string& id, int xPos, int yPos) ; + NGNode(const std::string& id, int xPos, int yPos); /** @brief Constructor @@ -83,11 +83,11 @@ * @param[in] yPos The y-position of the node * @param[in] amCenter Information whether this is the center-node of a spider-net */ - NGNode(const std::string& id, int xID, int yID, bool amCenter) ; + NGNode(const std::string& id, int xID, int yID, bool amCenter); /// @brief Destructor - ~NGNode() ; + ~NGNode(); /** @brief Returns this node's id @@ -159,14 +159,14 @@ * @todo There is no interaction with explicit node setting options? Where is this done? * @todo Check whether throwing an exception is really necessary, here */ - NBNode* buildNBNode(NBNetBuilder& nb) const ; + NBNode* buildNBNode(NBNetBuilder& nb) const; /** @brief Adds the given link to the internal list * * @param[in] link The link to add */ - void addLink(NGEdge* link) ; + void addLink(NGEdge* link); /** @brief Removes the given link @@ -176,7 +176,7 @@ * * @param[in] link The link to remove */ - void removeLink(NGEdge* link) ; + void removeLink(NGEdge* link); /** @brief Returns whether the other node is connected @@ -184,7 +184,7 @@ * @param[in] node The link to check whether it is connected * @return Whether the given node is connected */ - bool connected(NGNode* node) const ; + bool connected(NGNode* node) const; /** @brief Returns whether the node has the given position diff -Nru sumo-0.15.0~dfsg/src/netgen/NGRandomNetBuilder.h sumo-0.16.0~dfsg/src/netgen/NGRandomNetBuilder.h --- sumo-0.15.0~dfsg/src/netgen/NGRandomNetBuilder.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/NGRandomNetBuilder.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGRandomNetBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NGRandomNetBuilder.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Additional structures for building random nets /****************************************************************************/ @@ -53,7 +53,7 @@ * @param[in] numNeighbours The number of neighbors this item shall describe * @param[in] ratio The probability of this number of neighbors */ - void add(int numNeighbours, SUMOReal ratio) ; + void add(int numNeighbours, SUMOReal ratio); /** @@ -61,7 +61,7 @@ * * @return A random number of neighbors */ - int num() ; + int num(); private: @@ -90,7 +90,7 @@ * @todo check meanings of connectivity/numTries */ NGRandomNetBuilder(NGNet& net, SUMOReal minAngle, SUMOReal minDistance, SUMOReal maxDistance, SUMOReal connectivity, - int numTries, const TNeighbourDistribution& neighborDist) ; + int numTries, const TNeighbourDistribution& neighborDist); @@ -99,7 +99,7 @@ * @param[in] numNodes Number of iterations (node insertions) to perform * @todo Describe the algorithm */ - void createNet(int numNodes) ; + void createNet(int numNodes); private: @@ -107,7 +107,7 @@ * * @param[in] node The node to remove */ - void removeOuterNode(NGNode* node) ; + void removeOuterNode(NGNode* node); /** @brief Checks whether the angle of this node's connections are valid @@ -117,7 +117,7 @@ * @param[in] node The node to check connections of * @return Whether the settings allow to connect both nodes */ - bool checkAngles(NGNode* node) ; + bool checkAngles(NGNode* node); /** @brief Checks whether connecting the given two nodes complies with the set restrictions @@ -129,7 +129,7 @@ * @param[in] newNode The second node of the combination to check * @return Whether the settings allow to connect both nodes */ - bool canConnect(NGNode* baseNode, NGNode* newNode) ; + bool canConnect(NGNode* baseNode, NGNode* newNode); /** @brief Creates new random node @@ -139,7 +139,7 @@ * @param[in] baseNode ? * @todo Describe better */ - bool createNewNode(NGNode* baseNode) ; + bool createNewNode(NGNode* baseNode); /** @brief finds possible connections between Node and OuterNodes complying with restrictions @@ -147,7 +147,7 @@ * @param[in] node ? * @todo Describe better */ - void findPossibleOuterNodes(NGNode* node) ; + void findPossibleOuterNodes(NGNode* node); private: diff -Nru sumo-0.15.0~dfsg/src/netgen/netgen_main.cpp sumo-0.16.0~dfsg/src/netgen/netgen_main.cpp --- sumo-0.15.0~dfsg/src/netgen/netgen_main.cpp 2012-02-18 00:03:30.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netgen/netgen_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -5,9 +5,9 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: netgen_main.cpp 11927 2012-02-17 10:03:39Z namdre $ +/// @version $Id: netgen_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// -// Main for NETGEN +// Main for NETGENERATE /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -205,22 +205,25 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Road network generator for the microscopic road traffic simulation SUMO."); - oc.setApplicationName("netgen", "SUMO netgen Version " + (std::string)VERSION_STRING); + oc.setApplicationName("netgenerate", "SUMO netgenerate Version " + (std::string)VERSION_STRING); int ret = 0; try { // initialise the application system (messaging, xml, options) - XMLSubSys::init(false); + XMLSubSys::init(); fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!checkOptions()) { throw ProcessError(); } + GeoConvHelper::init("!", + Position(oc.getFloat("offset.x"), oc.getFloat("offset.y")), + Boundary(), Boundary()); RandHelper::initRandGlobal(); NBNetBuilder nb; nb.applyOptions(oc); @@ -237,19 +240,24 @@ WRITE_MESSAGE(" " + toString(nb.getEdgeCont().size()) + " edges generated."); nb.compute(oc); NWFrame::writeNetwork(oc, nb); - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } - OutputDevice::closeAll(); SystemFrame::close(); if (ret == 0) { std::cout << "Success." << std::endl; diff -Nru sumo-0.15.0~dfsg/src/netimport/Makefile.in sumo-0.16.0~dfsg/src/netimport/Makefile.in --- sumo-0.15.0~dfsg/src/netimport/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -147,6 +147,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -177,6 +178,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -211,6 +213,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -244,7 +247,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/netimport/NIFrame.cpp sumo-0.16.0~dfsg/src/netimport/NIFrame.cpp --- sumo-0.15.0~dfsg/src/netimport/NIFrame.cpp 2012-02-07 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIFrame.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIFrame.cpp 11835 2012-02-06 14:58:42Z dkrajzew $ +/// @version $Id: NIFrame.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Sets and checks options for netimport /****************************************************************************/ @@ -45,6 +45,7 @@ #include #include #include +#include "NIImporter_DlrNavteq.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -129,10 +130,10 @@ oc.addSynonyme("itsumo-files", "itsumo"); oc.addDescription("itsumo-files", "Input", "Read ITSUMO-net from FILE"); -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff oc.doRegister("heightmap.shapefiles", new Option_FileName()); oc.addDescription("heightmap.shapefiles", "Input", "Read heightmap from ArcGIS shapefile"); -#endif // have HAVE_MESOSIM +#endif // have HAVE_INTERNAL // register basic processing options oc.doRegister("ignore-errors", new Option_Bool(false)); @@ -142,6 +143,9 @@ oc.doRegister("ignore-errors.connections", new Option_Bool(false)); oc.addDescription("ignore-errors.connections", "Processing", "Continue on invalid connections"); + oc.doRegister("show-errors.connections-first-try", new Option_Bool(false)); + oc.addDescription("show-errors.connections-first-try", "Processing", "Show errors in connections at parsing"); + oc.doRegister("lanes-from-capacity.norm", new Option_Float((SUMOReal) 1800)); oc.addSynonyme("lanes-from-capacity.norm", "capacity-norm"); oc.addDescription("lanes-from-capacity.norm", "Processing", "The factor for flow to no. lanes conversion."); @@ -150,10 +154,11 @@ oc.addDescription("speed-in-kmh", "Processing", "vmax is parsed as given in km/h (some)"); + // register xml options - oc.doRegister("plain.keep-edge-shape", new Option_Bool(false)); - oc.addSynonyme("plain.keep-edge-shape", "xml.keep-shape", true); - oc.addDescription("plain.keep-edge-shape", "Processing", "No node positions are added to the edge shape"); + oc.doRegister("plain.extend-edge-shape", new Option_Bool(false)); + oc.addSynonyme("plain.extend-edge-shape", "xml.keep-shape", true); + oc.addDescription("plain.extend-edge-shape", "Processing", "If edge shapes do not end at the node positions, extend them"); // register matsim options @@ -242,8 +247,10 @@ oc.doRegister("osm.skip-duplicates-check", new Option_Bool(false)); oc.addDescription("osm.skip-duplicates-check", "Processing", "Skips the check for duplicate nodes and edges."); - oc.doRegister("osm.discard-tls", new Option_Bool(false)); - oc.addDescription("osm.discard-tls", "Processing", "Discards all traffic lights."); + + // register some additional options + oc.doRegister("tls.discard-loaded", new Option_Bool(false)); + oc.addDescription("tls.discard-loaded", "TLS Building", "Does not instatiate traffic lights loaded from other formats than XML"); } @@ -256,12 +263,12 @@ #ifdef HAVE_PROJ unsigned 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-prefix") || oc.isSet("shapefile-prefix")) && numProjections == 0) { - if(oc.isDefault("proj")) { + if (oc.isDefault("proj")) { oc.set("proj.utm", "true"); } } if (oc.isSet("dlr-navteq-prefix") && oc.isDefault("proj.scale")) { - oc.set("proj.scale", std::string("5")); + oc.set("proj.scale", toString(NIImporter_DlrNavteq::GEO_SCALE)); } #endif if (oc.isSet("sumo-net-file")) { diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_ArcView.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_ArcView.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_ArcView.cpp 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_ArcView.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Thimor Bohn /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_ArcView.cpp 11850 2012-02-08 08:41:44Z namdre $ +/// @version $Id: NIImporter_ArcView.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in ArcView-shape format /****************************************************************************/ @@ -158,7 +158,7 @@ while ((poFeature = poLayer->GetNextFeature()) != NULL) { // read in edge attributes std::string id, name, from_node, to_node; - if(!getStringEntry(poFeature, "shapefile.street-id", "LINK_ID", true, id)) { + if (!getStringEntry(poFeature, "shapefile.street-id", "LINK_ID", true, id)) { WRITE_ERROR("Needed field '" + id + "' (from node id) is missing."); } if (id == "") { @@ -169,10 +169,10 @@ getStringEntry(poFeature, "shapefile.street-id", "ST_NAME", true, name); name = StringUtils::replace(name, "&", "&"); - if(!getStringEntry(poFeature, "shapefile.from-id", "REF_IN_ID", true, from_node)) { + if (!getStringEntry(poFeature, "shapefile.from-id", "REF_IN_ID", true, from_node)) { WRITE_ERROR("Needed field '" + from_node + "' (from node id) is missing."); } - if(!getStringEntry(poFeature, "shapefile.to-id", "NREF_IN_ID", true, to_node)) { + if (!getStringEntry(poFeature, "shapefile.to-id", "NREF_IN_ID", true, to_node)) { WRITE_ERROR("Needed field '" + to_node + "' (to node id) is missing."); } @@ -182,9 +182,9 @@ } std::string type; - if (myOptions.isSet("shapefile.type-id") && poFeature->GetFieldIndex(myOptions.getString("shapefile.type-id").c_str())>=0) { + if (myOptions.isSet("shapefile.type-id") && poFeature->GetFieldIndex(myOptions.getString("shapefile.type-id").c_str()) >= 0) { type = poFeature->GetFieldAsString(myOptions.getString("shapefile.type-id").c_str()); - } else if(poFeature->GetFieldIndex("ST_TYP_AFT")>=0) { + } else if (poFeature->GetFieldIndex("ST_TYP_AFT") >= 0) { type = poFeature->GetFieldAsString("ST_TYP_AFT"); } SUMOReal width = myTypeCont.getWidth(type); @@ -269,7 +269,7 @@ 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; - NBEdge* edge = new NBEdge(id, from, to, type, speed, nolanes, priority, width, -1, shape, "", spread); + NBEdge* edge = new NBEdge(id, from, to, type, speed, nolanes, priority, width, NBEdge::UNSPECIFIED_OFFSET, shape, "", spread); myEdgeCont.insert(edge); checkSpread(edge); } @@ -279,7 +279,7 @@ id = "-" + id; if (myEdgeCont.retrieve(id) == 0) { LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LANESPREAD_RIGHT : LANESPREAD_CENTER; - NBEdge* edge = new NBEdge(id, to, from, type, speed, nolanes, priority, width, -1, shape.reverse(), "", spread); + NBEdge* edge = new NBEdge(id, to, from, type, speed, nolanes, priority, width, NBEdge::UNSPECIFIED_OFFSET, shape.reverse(), "", spread); myEdgeCont.insert(edge); checkSpread(edge); } @@ -381,13 +381,13 @@ } bool -NIImporter_ArcView::getStringEntry(OGRFeature*poFeature, const std::string &optionName, const char *defaultName, bool prune, std::string &into) { +NIImporter_ArcView::getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into) { std::string v(defaultName); - if(myOptions.isSet(optionName)) { + if (myOptions.isSet(optionName)) { v = myOptions.getString(optionName); } - if(poFeature->GetFieldIndex(v.c_str())<0) { - if(myOptions.isSet(optionName)) { + if (poFeature->GetFieldIndex(v.c_str()) < 0) { + if (myOptions.isSet(optionName)) { into = v; return false; } @@ -395,7 +395,7 @@ return true; } into = poFeature->GetFieldAsString((char*)v.c_str()); - if(prune) { + if (prune) { into = StringUtils::prune(into); } return true; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_ArcView.h sumo-0.16.0~dfsg/src/netimport/NIImporter_ArcView.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_ArcView.h 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_ArcView.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_ArcView.h 11850 2012-02-08 08:41:44Z namdre $ +/// @version $Id: NIImporter_ArcView.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in ArcView-shape format /****************************************************************************/ @@ -129,7 +129,7 @@ /** @brief Sets the value from the named field into "into" * - * If the field's name was set on the command line, the value is tried to be retrieved, returning true on success. + * If the field's name was set on the command line, the value is tried to be retrieved, returning true on success. * If it cannot be retrieved, false is retuned, and the field's name is inserted into "into". * * If no field name was given, the standard value (defaultName) is used. In this case, an empty string is returned @@ -140,7 +140,7 @@ * @param[in] prune Whether the value shall be prunned * @param[out] into The read value/missing field is stored here */ - bool getStringEntry(OGRFeature*poFeature, const std::string &optionName, const char *defaultName, bool prune, std::string &into); + bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into); #endif private: diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_DlrNavteq.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_DlrNavteq.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_DlrNavteq.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_DlrNavteq.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_DlrNavteq.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_DlrNavteq.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in Elmar's format /****************************************************************************/ @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,10 @@ #include #endif // CHECK_MEMORY_LEAKS +// --------------------------------------------------------------------------- +// static members +// --------------------------------------------------------------------------- +const int NIImporter_DlrNavteq::GEO_SCALE = 5; // =========================================================================== // method definitions @@ -82,26 +87,42 @@ lr.readAll(handler1); PROGRESS_DONE_MESSAGE(); - // load traffic lights - file = oc.getString("dlr-navteq-prefix") + "_traffic_signals.txt"; - if (lr.setFile(file)) { - PROGRESS_BEGIN_MESSAGE("Loading traffic lights"); - TrafficlightsHandler handler3(nb.getNodeCont(), nb.getTLLogicCont(), file); - lr.readAll(handler3); - PROGRESS_DONE_MESSAGE(); + // load street names if given and wished + std::map streetNames; // nameID : name + if (oc.getBool("output.street-names")) { + file = oc.getString("dlr-navteq-prefix") + "_names.txt"; + if (lr.setFile(file)) { + PROGRESS_BEGIN_MESSAGE("Loading Street Names"); + NamesHandler handler4(file, streetNames); + lr.readAll(handler4); + PROGRESS_DONE_MESSAGE(); + } else { + WRITE_WARNING("Output will not contain street names because the file '" + file + "' was not found"); + } } // load edges PROGRESS_BEGIN_MESSAGE("Loading edges"); file = oc.getString("dlr-navteq-prefix") + "_links_unsplitted.txt"; // parse the file - EdgesHandler handler2(nb.getNodeCont(), nb.getEdgeCont(), file, myGeoms); + EdgesHandler handler2(nb.getNodeCont(), nb.getEdgeCont(), file, myGeoms, streetNames); if (!lr.setFile(file)) { throw ProcessError("The file '" + file + "' could not be opened."); } lr.readAll(handler2); nb.getEdgeCont().recheckLaneSpread(); PROGRESS_DONE_MESSAGE(); + + // load traffic lights if given and not explicitly unwished + if (!oc.getBool("tls.discard-loaded")) { + file = oc.getString("dlr-navteq-prefix") + "_traffic_signals.txt"; + if (lr.setFile(file)) { + PROGRESS_BEGIN_MESSAGE("Loading traffic lights"); + TrafficlightsHandler handler3(nb.getNodeCont(), nb.getTLLogicCont(), nb.getEdgeCont(), file); + lr.readAll(handler3); + PROGRESS_DONE_MESSAGE(); + } + } } @@ -110,7 +131,7 @@ // --------------------------------------------------------------------------- NIImporter_DlrNavteq::NodesHandler::NodesHandler(NBNodeCont& nc, const std::string& file, - std::map &geoms) + std::map& geoms) : myNodeCont(nc), myGeoms(geoms) { UNUSED_PARAMETER(file); } @@ -183,9 +204,9 @@ // --------------------------------------------------------------------------- NIImporter_DlrNavteq::EdgesHandler::EdgesHandler(NBNodeCont& nc, NBEdgeCont& ec, const std::string& file, - std::map < std::string, - PositionVector > &geoms) - : myNodeCont(nc), myEdgeCont(ec), myGeoms(geoms) { + std::map& geoms, + std::map& streetNames): + myNodeCont(nc), myEdgeCont(ec), myGeoms(geoms), myStreetNames(streetNames) { UNUSED_PARAMETER(file); } @@ -210,7 +231,8 @@ SUMOReal length; SUMOReal speed = (SUMOReal) 30.0 / (SUMOReal) 3.6; int nolanes = 1; - int priority = -1; + int priority; + int form_of_way; // parse StringTokenizer st(result, StringTokenizer::WHITECHARS); // id @@ -223,33 +245,54 @@ interID = st.next(); // length try { - length = TplConvert::_2SUMOReal(st.next().c_str()); + length = TplConvert::_2SUMOReal(st.next().c_str()); } catch (NumberFormatException&) { throw ProcessError("Non-numerical value for an edge's length occured (edge '" + id + "'."); } // vehicle_type std::string veh_type = st.next(); // form_of_way - std::string form_of_way = st.next(); + try { + form_of_way = TplConvert::_2int(st.next().c_str()); + } catch (NumberFormatException&) { + throw ProcessError("Non-numerical value for an edge's form_of_way occured (edge '" + id + "'."); + } // brunnel_type std::string brunnel_type = st.next(); - // street_type - std::string street_type = st.next(); + // street_type used for priority + try { + priority = -TplConvert::_2int(st.next().c_str()); + } catch (NumberFormatException&) { + throw ProcessError("Non-numerical value for an edge's street_type occured (edge '" + id + "'."); + } + // modify priority using form_of_way + if (form_of_way == 11) { + priority -= 1; // frontage road, very often with lowered curb + } else if (form_of_way > 11) { + priority -= 2; // parking/service access assume lowered curb + } speed = NINavTeqHelper::getSpeed(id, st.next()); // number of lanes nolanes = NINavTeqHelper::getLaneNumber(id, st.next(), speed); + // average_speed (reportedly this is simply the speed from speed_category minus 10km/h) + std::string average_speed = st.next(); + // regional street name id + std::string nameID_regional = st.next(); + // local street name id + std::string nameID_local = st.next(); + std::string streetName = getStreetNameFromIDs(nameID_regional, nameID_local); std::vector theRest = st.getVector(); - bool connection = (theRest.size() == 11) && (theRest[10] == "1"); - if (theRest.size() > 11) { + bool connection = (theRest.size() == 8) && (theRest[7] == "1"); + if (theRest.size() > 8) { // post 05/2009 network - if (theRest[11] != "-1") { + if (theRest[8] != "-1") { try { - nolanes = TplConvert::_2int(theRest[11].c_str()); + nolanes = TplConvert::_2int(theRest[8].c_str()); } catch (NumberFormatException&) { throw ProcessError("Non-numerical value for the extended number of lanes (edge '" + id + "'."); } } - connection = (theRest.size() == 13) && (theRest[12] == "1"); + connection = (theRest.size() == 10) && (theRest[9] == "1"); } // try to get the nodes NBNode* from = myNodeCont.retrieve(fromID); @@ -263,22 +306,25 @@ // build the edge NBEdge* e = 0; if (interID == "-1") { - e = new NBEdge(id, from, to, "", speed, nolanes, priority, -1, -1); + e = new NBEdge(id, from, to, "", speed, nolanes, priority, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, streetName); } else { PositionVector geoms = myGeoms[interID]; if (connection) { geoms = geoms.reverse(); - geoms.push_front(from->getPosition()); - geoms.push_back(to->getPosition()); - e = new NBEdge(id, from, to, "", speed, nolanes, priority, -1, -1, geoms, "", LANESPREAD_CENTER); - } else { - geoms.push_front(from->getPosition()); - geoms.push_back(to->getPosition()); - e = new NBEdge(id, from, to, "", speed, nolanes, priority, -1, -1, geoms, "", LANESPREAD_CENTER); } + geoms.push_front(from->getPosition()); + geoms.push_back(to->getPosition()); + e = new NBEdge(id, from, to, "", speed, nolanes, priority, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geoms, streetName, LANESPREAD_CENTER); } // add vehicle type information to the edge NINavTeqHelper::addVehicleClasses(*e, veh_type); + // permission modifications based on form_of_way + if (form_of_way == 14) { // pedestrian area (fussgaengerzone) + // unfortunately, the veh_type string is misleading in this case + e->disallowVehicleClass(-1, SVC_PASSENGER); + } // insert the edge to the network if (!myEdgeCont.insert(e)) { delete e; @@ -288,13 +334,34 @@ } +std::string +NIImporter_DlrNavteq::EdgesHandler::getStreetNameFromIDs( + const std::string& regionalID, const std::string& localID) const { + std::string result = ""; + bool hadRegional = false; + if (myStreetNames.count(regionalID) > 0) { + hadRegional = true; + result += myStreetNames[regionalID]; + } + if (myStreetNames.count(localID) > 0) { + if (hadRegional) { + result += " / "; + } + result += myStreetNames[localID]; + } + return result; +} + // --------------------------------------------------------------------------- // definitions of NIImporter_DlrNavteq::TrafficlightsHandler-methods // --------------------------------------------------------------------------- NIImporter_DlrNavteq::TrafficlightsHandler::TrafficlightsHandler(NBNodeCont& nc, NBTrafficLightLogicCont& tlc, - const std::string& file) - : myNodeCont(nc), myTLLogicCont(tlc) { + NBEdgeCont& ne, + const std::string& file) : + myNodeCont(nc), + myTLLogicCont(tlc), + myEdgeCont(ne) { UNUSED_PARAMETER(file); } @@ -310,22 +377,53 @@ return true; } StringTokenizer st(result, StringTokenizer::WHITECHARS); - std::string nodeID = st.getVector().back(); - NBNode* node = myNodeCont.retrieve(nodeID); - if (node == 0) { - WRITE_WARNING("The traffic light node '" + nodeID + "' could not be found"); + const std::string edgeID = st.get(5); + NBEdge* edge = myEdgeCont.retrieve(edgeID); + if (edge == 0) { + WRITE_WARNING("The traffic light edge '" + edgeID + "' could not be found"); } else { + NBNode* node = edge->getToNode(); if (node->getType() != NODETYPE_TRAFFIC_LIGHT) { node->reinit(node->getPosition(), NODETYPE_TRAFFIC_LIGHT); - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(nodeID, node); + // @note actually we could use the navteq node ID here + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(node->getID(), node, 0); if (!myTLLogicCont.insert(tlDef)) { // actually, nothing should fail here delete tlDef; - throw ProcessError("Could not allocate tls for '" + nodeID + "'."); + throw ProcessError("Could not allocate tls for '" + node->getID() + "'."); } } } return true; } + +// --------------------------------------------------------------------------- +// definitions of NIImporter_DlrNavteq::NamesHandler-methods +// --------------------------------------------------------------------------- +NIImporter_DlrNavteq::NamesHandler::NamesHandler( + const std::string& file, std::map& streetNames) : + myStreetNames(streetNames) { + UNUSED_PARAMETER(file); +} + + +NIImporter_DlrNavteq::NamesHandler::~NamesHandler() {} + + +bool +NIImporter_DlrNavteq::NamesHandler::report(const std::string& result) { +// # NAME_ID Name + if (result[0] == '#') { + return true; + } + StringTokenizer st(result, StringTokenizer::WHITECHARS); + if (st.size() == 1) { + return true; // one line with the number of data containing lines in it + } + assert(st.size() >= 2); + const std::string id = st.next(); + myStreetNames[id] = joinToString(st.getVector(), " "); + return true; +} /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_DlrNavteq.h sumo-0.16.0~dfsg/src/netimport/NIImporter_DlrNavteq.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_DlrNavteq.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_DlrNavteq.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_DlrNavteq.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_DlrNavteq.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in Elmar's format /****************************************************************************/ @@ -72,6 +72,8 @@ */ static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb); + /// @brief scaling factor for geo coordinates (DLRNavteq format uses this to increase floating point precisions) + static const int GEO_SCALE; protected: /** @@ -90,11 +92,11 @@ * @param[in, geoms] geoms Storage for read edge geometries */ NodesHandler(NBNodeCont& nc, const std::string& file, - std::map &geoms) ; + std::map& geoms); /// @brief Destructor - ~NodesHandler() ; + ~NodesHandler(); /** @brief Parsing method @@ -108,7 +110,7 @@ * @exception ProcessError if something fails * @see LineHandler::report */ - bool report(const std::string& result) ; + bool report(const std::string& result); protected: @@ -116,7 +118,7 @@ NBNodeCont& myNodeCont; /// @brief A container for parsed geometries - std::map &myGeoms; + std::map& myGeoms; private: @@ -144,13 +146,16 @@ * @param[in, filled] ec The edge control to insert loaded edges into * @param[in] file The name of the parsed file * @param[in] geoms The previously read edge geometries + * @param[in] streetNames The previously read street names */ EdgesHandler(NBNodeCont& nc, NBEdgeCont& ec, - const std::string& file, std::map &geoms) ; + const std::string& file, + std::map& geoms, + std::map& streetNames); /// @brief Destructor - ~EdgesHandler() ; + ~EdgesHandler(); /** @brief Parsing method @@ -162,7 +167,7 @@ * @exception ProcessError if something fails * @see LineHandler::report */ - bool report(const std::string& result) ; + bool report(const std::string& result); protected: @@ -172,12 +177,19 @@ /// @brief The edge container to store loaded edges into NBEdgeCont& myEdgeCont; - /// @brief Previously read edge geometries - std::map &myGeoms; + /// @brief Previously read edge geometries (manipulated during use) + std::map& myGeoms; + + /// @brief Previously read streat names (non-const because operate[] is more convenient) + std::map& myStreetNames; /// @brief Whether node positions shall not be added to the edge's geometry bool myTryIgnoreNodePositions; + private: + /// @brief build the street name for the given ids + std::string getStreetNameFromIDs(const std::string& regionalID, const std::string& localID) const; + private: /// @brief Invalidated copy constructor. @@ -205,11 +217,11 @@ * @param[in] file The name of the parsed file */ TrafficlightsHandler(NBNodeCont& nc, NBTrafficLightLogicCont& tlc, - const std::string& file) ; + NBEdgeCont& ne, const std::string& file); /// @brief Destructor - ~TrafficlightsHandler() ; + ~TrafficlightsHandler(); /** @brief Parsing method @@ -221,7 +233,7 @@ * @exception ProcessError if something fails * @see LineHandler::report */ - bool report(const std::string& result) ; + bool report(const std::string& result); protected: @@ -231,6 +243,9 @@ /// @brief The traffic lights container to add built tls to NBTrafficLightLogicCont& myTLLogicCont; + /// @brief The edge container to get the referenced edges from + NBEdgeCont& myEdgeCont; + private: /// @brief Invalidated copy constructor. @@ -241,6 +256,54 @@ }; + + /** + * @class NamesHandler + * @brief Importer of street names in DLRNavteq's (aka elmar) format + * + * Being a LineHandler, this class retrieves each line from a LineReader + * and parses these information assuming they contain name definitions + * in DLRNavteq's format. + */ + class NamesHandler : public LineHandler { + public: + /** @brief Constructor + * @param[in] file The name of the parsed file + * @param[filled] streetNames output container for read names + */ + NamesHandler(const std::string& file, std::map& streetNames); + + + /// @brief Destructor + ~NamesHandler(); + + + /** @brief Parsing method + * + * Implementation of the LineHandler-interface called by a LineReader; + * interprets the retrieved information and stores the streetNames + * @param[in] result The read line + * @return Whether the parsing shall continue + * @exception ProcessError if something fails + * @see LineHandler::report + */ + bool report(const std::string& result); + + + protected: + /// @brief The container for storing read names + std::map& myStreetNames; + + + private: + /// @brief Invalidated copy constructor. + NamesHandler(const NamesHandler&); + + /// @brief Invalidated assignment operator. + NamesHandler& operator=(const NamesHandler&); + + }; + }; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_ITSUMO.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_ITSUMO.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_ITSUMO.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_ITSUMO.cpp 2012-09-25 22:01:33.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date 2011-09-16 -/// @version $Id: NIImporter_ITSUMO.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_ITSUMO.cpp 12451 2012-06-28 20:35:30Z behrisch $ /// // Importer for networks stored in ITSUMO format /****************************************************************************/ @@ -150,7 +150,7 @@ void -NIImporter_ITSUMO::Handler::myStartElement(int element, const SUMOSAXAttributes& attrs) { +NIImporter_ITSUMO::Handler::myStartElement(int element, const SUMOSAXAttributes& /* attrs */) { switch (element) { case ITSUMO_TAG_NODE: myParameter.clear(); @@ -221,7 +221,7 @@ for (std::vector::iterator i = mySections.begin(); i != mySections.end(); ++i) { for (std::vector::iterator j = (*i)->myLaneSets.begin(); j != (*i)->myLaneSets.end(); ++j) { LaneSet* ls = (*j); - NBEdge* edge = new NBEdge(ls->myID, ls->myFrom, ls->myTo, "", ls->myV, (unsigned int)ls->myLanes.size(), -1, -1, -1); + NBEdge* edge = new NBEdge(ls->myID, ls->myFrom, ls->myTo, "", ls->myV, (unsigned int)ls->myLanes.size(), -1, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET); if (!myNetBuilder.getEdgeCont().insert(edge)) { delete edge; WRITE_ERROR("Could not add edge '" + ls->myID + "'. Probably declared twice."); @@ -235,8 +235,8 @@ case ITSUMO_TAG_NODE: { try { std::string id = myParameter["id"]; - SUMOReal x = TplConvert::_2SUMOReal(myParameter["x"].c_str()); - SUMOReal y = TplConvert::_2SUMOReal(myParameter["y"].c_str()); + SUMOReal x = TplConvert::_2SUMOReal(myParameter["x"].c_str()); + SUMOReal y = TplConvert::_2SUMOReal(myParameter["y"].c_str()); Position pos(x, y); if (!NILoader::transformCoordinates(pos)) { WRITE_ERROR("Unable to project coordinates for node '" + id + "'."); @@ -261,7 +261,7 @@ case ITSUMO_TAG_LANESET: { try { std::string id = myParameter["lanesetID"]; - int i = TplConvert::_2int(myParameter["i"].c_str()); + int i = TplConvert::_2int(myParameter["i"].c_str()); std::string fromID = myParameter["from"]; std::string toID = myParameter["to"]; NBNode* from = myNetBuilder.getNodeCont().retrieve(fromID); @@ -293,9 +293,8 @@ case ITSUMO_TAG_LANE: { try { std::string id = myParameter["laneID"]; - int pos = TplConvert::_2int(myParameter["pos"].c_str()); - int i = TplConvert::_2int(myParameter["i"].c_str()); - SUMOReal v = TplConvert::_2SUMOReal(myParameter["v"].c_str()); + int i = TplConvert::_2int(myParameter["i"].c_str()); + SUMOReal v = TplConvert::_2SUMOReal(myParameter["v"].c_str()); myCurrentLanes.push_back(Lane(id, (unsigned int) i, v)); } catch (NumberFormatException&) { WRITE_ERROR("Not numeric value in lane '" + myParameter["laneID"] + "'."); diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_ITSUMO.h sumo-0.16.0~dfsg/src/netimport/NIImporter_ITSUMO.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_ITSUMO.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_ITSUMO.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NIImporter_ITSUMO.h /// @author Daniel Krajzewicz /// @date 2011-09-16 -/// @version $Id: NIImporter_ITSUMO.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_ITSUMO.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in ITSUMO format /****************************************************************************/ @@ -84,11 +84,11 @@ /** @brief Contructor * @param[in] toFill The container to fill */ - Handler(NBNetBuilder& toFill) ; + Handler(NBNetBuilder& toFill); /// @brief Destructor - ~Handler() ; + ~Handler(); protected: @@ -102,7 +102,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - void myStartElement(int element, const SUMOSAXAttributes& attrs) ; + void myStartElement(int element, const SUMOSAXAttributes& attrs); /** @@ -147,7 +147,7 @@ struct LaneSet { public: - LaneSet(const std::string& id, const std::vector &lanes, SUMOReal v, int pos, NBNode* from, NBNode* to) + LaneSet(const std::string& id, const std::vector& lanes, SUMOReal v, int pos, NBNode* from, NBNode* to) : myID(id), myLanes(lanes), myV(v), myPosition(pos), myFrom(from), myTo(to) {} std::string myID; std::vector myLanes; @@ -162,7 +162,7 @@ struct Section { public: - Section(const std::string& id, const std::vector &laneSets) + Section(const std::string& id, const std::vector& laneSets) : myID(id), myLaneSets(laneSets) {} std::string myID; std::vector myLaneSets; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_MATSim.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_MATSim.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_MATSim.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_MATSim.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 26.04.2011 -/// @version $Id: NIImporter_MATSim.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_MATSim.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in MATSim format /****************************************************************************/ @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -207,9 +208,9 @@ return; } try { - int hours = TplConvert::_2int(st.next().c_str()); - int minutes = TplConvert::_2int(st.next().c_str()); - int seconds = TplConvert::_2int(st.next().c_str()); + int hours = TplConvert::_2int(st.next().c_str()); + int minutes = TplConvert::_2int(st.next().c_str()); + int seconds = TplConvert::_2int(st.next().c_str()); myCapacityNorm = (SUMOReal)(hours * 3600 + minutes * 60 + seconds); } catch (NumberFormatException&) { } catch (EmptyData&) { @@ -245,7 +246,8 @@ if (myLanesFromCapacity) { permLanes = myCapacity2Lanes.get(capacity); } - NBEdge* edge = new NBEdge(id, fromNode, toNode, "", freeSpeed, (unsigned int) permLanes, -1, -1, -1); + NBEdge* edge = new NBEdge(id, fromNode, toNode, "", freeSpeed, (unsigned int) permLanes, -1, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET); + edge->addParameter("capacity", toString(capacity)); if (myKeepEdgeLengths) { edge->setLoadedLength(length); } diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_MATSim.h sumo-0.16.0~dfsg/src/netimport/NIImporter_MATSim.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_MATSim.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_MATSim.h 2012-09-25 22:01:33.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 26.04.2011 -/// @version $Id: NIImporter_MATSim.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_MATSim.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Importer for networks stored in MATSim format /****************************************************************************/ @@ -85,11 +85,11 @@ /** @brief Contructor * @param[in] toFill The nodes container to fill */ - NodesHandler(NBNodeCont& toFill) ; + NodesHandler(NBNodeCont& toFill); /// @brief Destructor - ~NodesHandler() ; + ~NodesHandler(); protected: @@ -103,7 +103,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - void myStartElement(int element, const SUMOSAXAttributes& attrs) ; + void myStartElement(int element, const SUMOSAXAttributes& attrs); //@} @@ -139,11 +139,11 @@ */ EdgesHandler(const NBNodeCont& nc, NBEdgeCont& toFill, bool keepEdgeLengths, bool lanesFromCapacity, - NBCapacity2Lanes capacity2Lanes) ; + NBCapacity2Lanes capacity2Lanes); /// @brief Destructor - ~EdgesHandler() ; + ~EdgesHandler(); protected: @@ -157,7 +157,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - void myStartElement(int element, const SUMOSAXAttributes& attrs) ; + void myStartElement(int element, const SUMOSAXAttributes& attrs); //@} diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenDrive.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenDrive.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenDrive.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenDrive.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenDrive.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_OpenDrive.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in openDrive format /****************************************************************************/ @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -82,6 +83,7 @@ { "center", NIImporter_OpenDrive::OPENDRIVE_TAG_CENTER }, { "right", NIImporter_OpenDrive::OPENDRIVE_TAG_RIGHT }, { "lane", NIImporter_OpenDrive::OPENDRIVE_TAG_LANE }, + { "signal", NIImporter_OpenDrive::OPENDRIVE_TAG_SIGNAL }, { "", NIImporter_OpenDrive::OPENDRIVE_TAG_NOTHING } }; @@ -109,11 +111,15 @@ { "d", NIImporter_OpenDrive::OPENDRIVE_ATTR_D }, { "type", NIImporter_OpenDrive::OPENDRIVE_ATTR_TYPE }, { "level", NIImporter_OpenDrive::OPENDRIVE_ATTR_LEVEL }, + { "orientation", NIImporter_OpenDrive::OPENDRIVE_ATTR_ORIENTATION }, + { "dynamic", NIImporter_OpenDrive::OPENDRIVE_ATTR_DYNAMIC }, { "", NIImporter_OpenDrive::OPENDRIVE_ATTR_NOTHING } }; +std::set NIImporter_OpenDrive::myLaneTypes2Import; + // =========================================================================== // method definitions // =========================================================================== @@ -126,6 +132,12 @@ if (!oc.isUsableFileList("opendrive-files")) { return; } + myLaneTypes2Import.insert("driving"); + myLaneTypes2Import.insert("stop"); + //myLaneTypes2Import.insert("mwyEntry"); + //myLaneTypes2Import.insert("mwyExit"); + myLaneTypes2Import.insert("special1"); + myLaneTypes2Import.insert("parking"); // build the handler std::vector innerEdges, outerEdges; NIImporter_OpenDrive handler(innerEdges, outerEdges); @@ -251,7 +263,6 @@ } } - // // build start/end nodes which were not defined previously @@ -275,11 +286,11 @@ // ------------------------- std::map > fromLaneMap; std::map > toLaneMap; + //bool useLoadedLengths = oc.getBool("opendrive.use-given-lengths"); // build edges for (std::vector::iterator i = outerEdges.begin(); i != outerEdges.end(); ++i) { OpenDriveEdge& e = *i; SUMOReal speed = nb.getTypeCont().getSpeed(""); - int priority = nb.getTypeCont().getPriority(""); LaneSpreadFunction lsf = LANESPREAD_CENTER; unsigned int noLanesRight = e.getMaxLaneNumber(OPENDRIVE_TAG_RIGHT); unsigned int noLanesLeft = e.getMaxLaneNumber(OPENDRIVE_TAG_LEFT); @@ -289,18 +300,30 @@ WRITE_WARNING("Edge '" + e.id + "' has no lanes."); } if (noLanesRight > 0) { - NBEdge* nbe = new NBEdge("-" + e.id, e.from, e.to, "", speed, noLanesRight, priority, -1, -1, e.geom, "", lsf, true); + int priority = e.getPriority(OPENDRIVE_TAG_RIGHT); + NBEdge* nbe = new NBEdge("-" + e.id, e.from, e.to, "", speed, noLanesRight, priority, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, e.geom, "", lsf, true); if (!nb.getEdgeCont().insert(nbe)) { throw ProcessError("Could not add edge '" + std::string("-") + e.id + "'."); } + for (unsigned int j = 0; j < noLanesRight; ++j) { + nbe->getLaneStruct(j).origID = e.id + " -" + toString(j + 1); + } + //if(useLoadedLengths) { nbe->setLoadedLength(e.length); } fromLaneMap[nbe] = e.laneSections.back().buildLaneMapping(OPENDRIVE_TAG_RIGHT); toLaneMap[nbe] = e.laneSections[0].buildLaneMapping(OPENDRIVE_TAG_RIGHT); } if (noLanesLeft > 0) { - NBEdge* nbe = new NBEdge(e.id, e.to, e.from, "", speed, noLanesLeft, priority, -1, -1, e.geom.reverse(), "", lsf, true); + int priority = e.getPriority(OPENDRIVE_TAG_LEFT); + NBEdge* nbe = new NBEdge(e.id, e.to, e.from, "", speed, noLanesLeft, priority, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, e.geom.reverse(), "", lsf, true); if (!nb.getEdgeCont().insert(nbe)) { throw ProcessError("Could not add edge '" + e.id + "'."); } + //if(useLoadedLengths) { nbe->setLoadedLength(e.length); } + for (unsigned int j = 0; j < noLanesLeft; ++j) { + nbe->getLaneStruct(j).origID = e.id + " " + toString(j + 1); + } fromLaneMap[nbe] = e.laneSections[0].buildLaneMapping(OPENDRIVE_TAG_LEFT); toLaneMap[nbe] = e.laneSections.back().buildLaneMapping(OPENDRIVE_TAG_LEFT); } @@ -351,7 +374,7 @@ for (std::vector::iterator i = innerEdges.begin(); i != innerEdges.end(); ++i) { OpenDriveEdge& e = *i; std::string pred, succ; - ContactPoint predC, succC; + ContactPoint predC = OPENDRIVE_CP_UNKNOWN, succC = OPENDRIVE_CP_UNKNOWN; for (std::vector::iterator j = e.links.begin(); j != e.links.end(); ++j) { OpenDriveLink& l = *j; if (l.elementType != OPENDRIVE_ET_ROAD) { @@ -394,8 +417,6 @@ std::cout << "Missing edge." << std::endl; continue; // yes, occurs } - // !!!why edge2junction; e already has the junction... - NBNode* n = nb.getNodeCont().retrieve(edge2junction[e.id]); std::vector::iterator predEdge = std::find_if(outerEdges.begin(), outerEdges.end(), edge_by_id_finder(pred)); if (predEdge == outerEdges.end()) { throw ProcessError("Could not find connection edge."); @@ -426,8 +447,10 @@ *predEdge, c.from->getID()[0] != '-', c.from->getID()[0] == '-' ? OPENDRIVE_TAG_RIGHT : OPENDRIVE_TAG_LEFT, e, isReversed, !isReversed ? OPENDRIVE_TAG_RIGHT : OPENDRIVE_TAG_LEFT, *succEdge, c.to->getID()[0] != '-', c.to->getID()[0] == '-' ? OPENDRIVE_TAG_RIGHT : OPENDRIVE_TAG_LEFT); + c.id = e.id; connections.push_back(c); } + for (std::vector::const_iterator i = connections.begin(); i != connections.end(); ++i) { if ((*i).from == 0 || (*i).to == 0) { std::cout << "Nope." << std::endl; @@ -436,7 +459,8 @@ (*i).from->addEdge2EdgeConnection((*i).to); std::map fromMap = fromLaneMap[(*i).from]; std::map toMap = fromLaneMap[(*i).to]; - for (std::vector >::const_iterator j = (*i).lanes.begin(); j != (*i).lanes.end(); ++j) { + int index = 0; + for (std::vector >::const_iterator j = (*i).lanes.begin(); j != (*i).lanes.end(); ++j, --index) { int fromLane = fromMap[(*j).first]; int toLane = toMap[(*j).second]; if (static_cast(fromLane) >= (*i).from->getNumLanes() || fromLane < 0) { @@ -446,7 +470,16 @@ std::cout << "False " << std::endl; } - (*i).from->addLane2LaneConnection(fromLane, (*i).to, toLane, NBEdge::L2L_VALIDATED, true); + (*i).from->addLane2LaneConnection(fromLane, (*i).to, toLane, NBEdge::L2L_VALIDATED, true, false); + if ((*i).id != "") { + std::vector& cons = (*i).from->getConnections(); + for (std::vector::iterator k = cons.begin(); k != cons.end(); ++k) { + if ((*k).fromLane == fromLane && (*k).toEdge == (*i).to && (*k).toLane == toLane) { + (*k).origID = (*i).id + " " + toString(index); + break; + } + } + } } } } @@ -456,7 +489,7 @@ NIImporter_OpenDrive::addViaConnectionSecure(const NBEdgeCont& ec, const NBNode* const node, const OpenDriveEdge& e, LinkType lt, const std::string& via, - std::vector &connections) { + std::vector& connections) { NBEdge* from = 0; NBEdge* to = 0; if (node == e.to) { @@ -491,7 +524,7 @@ void NIImporter_OpenDrive::addE2EConnectionsSecure(const NBEdgeCont& ec, const NBNode* const node, const NIImporter_OpenDrive::OpenDriveEdge& from, const NIImporter_OpenDrive::OpenDriveEdge& to, - std::vector &connections) { + std::vector& connections) { // positive direction (from is incoming, to is outgoing) NBEdge* fromEdge = ec.retrieve("-" + from.id); if (fromEdge == 0 || !node->hasIncoming(fromEdge)) { @@ -532,14 +565,14 @@ const OpenDriveEdge& from, bool fromAtBegin, OpenDriveXMLTag fromLaneDir, const OpenDriveEdge& to, bool toAtEnd, OpenDriveXMLTag toLaneDir) { const OpenDriveLaneSection& fromLS = fromAtBegin ? from.laneSections[0] : from.laneSections.back(); - const std::vector &fromLanes = fromLS.lanesByDir.find(fromLaneDir)->second; + const std::vector& fromLanes = fromLS.lanesByDir.find(fromLaneDir)->second; const OpenDriveLaneSection& toLS = toAtEnd ? to.laneSections.back() : to.laneSections[0]; - const std::vector &toLanes = toLS.lanesByDir.find(toLaneDir)->second; + const std::vector& toLanes = toLS.lanesByDir.find(toLaneDir)->second; // in the following, we are probably using the same information twice, stored once // in the from-edge's successor field and in the to-edge's precessor field. // though, we have no proof or information that this is always redundant for (std::vector::const_iterator i = fromLanes.begin(); i != fromLanes.end(); ++i) { - if ((*i).type != "driving") { + if (myLaneTypes2Import.find((*i).type) == myLaneTypes2Import.end()) { continue; } if (!fromAtBegin && (*i).successor != UNSET_CONNECTION) { @@ -550,7 +583,7 @@ } } for (std::vector::const_iterator i = toLanes.begin(); i != toLanes.end(); ++i) { - if ((*i).type != "driving") { + if (myLaneTypes2Import.find((*i).type) == myLaneTypes2Import.end()) { continue; } if (!toAtEnd && (*i).predecessor != UNSET_CONNECTION) { @@ -660,7 +693,7 @@ void -NIImporter_OpenDrive::computeShapes(std::vector &edges) { +NIImporter_OpenDrive::computeShapes(std::vector& edges) { for (std::vector::iterator i = edges.begin(); i != edges.end(); ++i) { OpenDriveEdge& e = *i; for (std::vector::iterator j = e.geometries.begin(); j != e.geometries.end(); ++j) { @@ -846,12 +879,96 @@ *ad_y = vy + ad_centerY; } + +// --------------------------------------------------------------------------- +// section +// --------------------------------------------------------------------------- +NIImporter_OpenDrive::OpenDriveLaneSection::OpenDriveLaneSection(SUMOReal sArg) : s(sArg) { + lanesByDir[OPENDRIVE_TAG_LEFT] = std::vector(); + lanesByDir[OPENDRIVE_TAG_RIGHT] = std::vector(); + lanesByDir[OPENDRIVE_TAG_CENTER] = std::vector(); +} + + +unsigned int +NIImporter_OpenDrive::OpenDriveLaneSection::getLaneNumber(OpenDriveXMLTag dir) const { + unsigned int laneNum = 0; + const std::vector& dirLanes = lanesByDir.find(dir)->second; + for (std::vector::const_iterator i = dirLanes.begin(); i != dirLanes.end(); ++i) { + if (myLaneTypes2Import.find((*i).type) != myLaneTypes2Import.end()) { + ++laneNum; + } + } + return laneNum; +} + + +std::map +NIImporter_OpenDrive::OpenDriveLaneSection::buildLaneMapping(OpenDriveXMLTag dir) { + std::map ret; + unsigned int sumoLane = 0; + const std::vector& dirLanes = lanesByDir.find(dir)->second; + if (dir == OPENDRIVE_TAG_RIGHT) { + for (std::vector::const_reverse_iterator i = dirLanes.rbegin(); i != dirLanes.rend(); ++i) { + if (myLaneTypes2Import.find((*i).type) != myLaneTypes2Import.end()) { + ret[(*i).id] = sumoLane++; + } + } + } else { + for (std::vector::const_iterator i = dirLanes.begin(); i != dirLanes.end(); ++i) { + if (myLaneTypes2Import.find((*i).type) != myLaneTypes2Import.end()) { + ret[(*i).id] = sumoLane++; + } + } + } + return ret; +} + + +// --------------------------------------------------------------------------- +// edge +// --------------------------------------------------------------------------- +unsigned int +NIImporter_OpenDrive::OpenDriveEdge::getMaxLaneNumber(OpenDriveXMLTag dir) const { + unsigned int maxLaneNum = 0; + for (std::vector::const_iterator i = laneSections.begin(); i != laneSections.end(); ++i) { + maxLaneNum = MAX2(maxLaneNum, (*i).getLaneNumber(dir)); + } + return maxLaneNum; +} + + +int +NIImporter_OpenDrive::OpenDriveEdge::getPriority(OpenDriveXMLTag dir) const { + int prio = 1; + SUMOReal lastPos = -1; + for (std::vector::const_iterator i = signals.begin(); i != signals.end(); ++i) { + int tmp = 1; + if ((*i).type == "301" || (*i).type == "306") { + tmp = 2; + } + if ((*i).type == "205") { + tmp = 0; + } + if (tmp != 1 && dir == OPENDRIVE_TAG_RIGHT && (*i).orientation < 0) { + prio = tmp; + } + if (tmp != 1 && dir == OPENDRIVE_TAG_LEFT && (*i).orientation > 0) { + prio = tmp; + } + + } + return prio; +} + + + // --------------------------------------------------------------------------- // loader methods // --------------------------------------------------------------------------- NIImporter_OpenDrive::NIImporter_OpenDrive( - std::vector &innerEdges, - std::vector &outerEdges) + std::vector& innerEdges, + std::vector& outerEdges) : GenericSAXHandler(openDriveTags, OPENDRIVE_TAG_NOTHING, openDriveAttrs, OPENDRIVE_ATTR_NOTHING, "opendrive"), myCurrentEdge("", "", -1), myInnerEdges(innerEdges), myOuterEdges(outerEdges) { } @@ -973,6 +1090,15 @@ ls.lanesByDir[myCurrentLaneDirection].push_back(OpenDriveLane(id, level, type)); } break; + case OPENDRIVE_TAG_SIGNAL: { + int id = attrs.getIntReporting(OPENDRIVE_ATTR_ID, myCurrentEdge.id.c_str(), ok); + std::string type = attrs.getStringReporting(OPENDRIVE_ATTR_TYPE, myCurrentEdge.id.c_str(), ok); + int orientation = attrs.getStringReporting(OPENDRIVE_ATTR_ORIENTATION, myCurrentEdge.id.c_str(), ok) == "-" ? -1 : 1; + SUMOReal s = attrs.getSUMORealReporting(OPENDRIVE_ATTR_S, myCurrentEdge.id.c_str(), ok); + bool dynamic = attrs.getStringReporting(OPENDRIVE_ATTR_DYNAMIC, myCurrentEdge.id.c_str(), ok) == "no" ? false : true; + myCurrentEdge.signals.push_back(OpenDriveSignal(id, type, orientation, dynamic, s)); + } + break; default: break; } @@ -981,15 +1107,6 @@ void -NIImporter_OpenDrive::myCharacters(int element, - const std::string& chars) { - UNUSED_PARAMETER(element); - UNUSED_PARAMETER(chars); -} - - - -void NIImporter_OpenDrive::myEndElement(int element) { myElementStack.pop_back(); switch (element) { @@ -1030,7 +1147,7 @@ void -NIImporter_OpenDrive::addGeometryShape(GeometryType type, const std::vector &vals) { +NIImporter_OpenDrive::addGeometryShape(GeometryType type, const std::vector& vals) { // checks if (myCurrentEdge.geometries.size() == 0) { throw ProcessError("Mismatching paranthesis in geometry definition for road '" + myCurrentEdge.id + "'"); diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenDrive.h sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenDrive.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenDrive.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenDrive.h 2012-12-03 00:02:27.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenDrive.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_OpenDrive.h 13108 2012-12-02 14:30:19Z behrisch $ /// // Importer for networks stored in openDrive format /****************************************************************************/ @@ -102,7 +102,8 @@ OPENDRIVE_TAG_LEFT, OPENDRIVE_TAG_CENTER, OPENDRIVE_TAG_RIGHT, - OPENDRIVE_TAG_LANE + OPENDRIVE_TAG_LANE, + OPENDRIVE_TAG_SIGNAL }; @@ -133,7 +134,9 @@ OPENDRIVE_ATTR_C, OPENDRIVE_ATTR_D, OPENDRIVE_ATTR_TYPE, - OPENDRIVE_ATTR_LEVEL + OPENDRIVE_ATTR_LEVEL, + OPENDRIVE_ATTR_ORIENTATION, + OPENDRIVE_ATTR_DYNAMIC, }; enum LinkType { @@ -217,43 +220,11 @@ * @brief Representation of a lane section */ struct OpenDriveLaneSection { - OpenDriveLaneSection(SUMOReal sArg) - : s(sArg) { - lanesByDir[OPENDRIVE_TAG_LEFT] = std::vector(); - lanesByDir[OPENDRIVE_TAG_RIGHT] = std::vector(); - lanesByDir[OPENDRIVE_TAG_CENTER] = std::vector(); - } + OpenDriveLaneSection(SUMOReal sArg); - unsigned int getLaneNumber(OpenDriveXMLTag dir) const { - unsigned int laneNum = 0; - const std::vector &dirLanes = lanesByDir.find(dir)->second; - for (std::vector::const_iterator i = dirLanes.begin(); i != dirLanes.end(); ++i) { - if ((*i).type == "driving") { - ++laneNum; - } - } - return laneNum; - } + unsigned int getLaneNumber(OpenDriveXMLTag dir) const; - std::map buildLaneMapping(OpenDriveXMLTag dir) { - std::map ret; - unsigned int sumoLane = 0; - const std::vector &dirLanes = lanesByDir.find(dir)->second; - if (dir == OPENDRIVE_TAG_RIGHT) { - for (std::vector::const_reverse_iterator i = dirLanes.rbegin(); i != dirLanes.rend(); ++i) { - if ((*i).type == "driving") { - ret[(*i).id] = sumoLane++; - } - } - } else { - for (std::vector::const_iterator i = dirLanes.begin(); i != dirLanes.end(); ++i) { - if ((*i).type == "driving") { - ret[(*i).id] = sumoLane++; - } - } - } - return ret; - } + std::map buildLaneMapping(OpenDriveXMLTag dir); SUMOReal s; std::map > lanesByDir; @@ -261,6 +232,22 @@ /** + * @struct OpenDriveSignal + * @brief Representation of a signal + */ + struct OpenDriveSignal { + OpenDriveSignal(int idArg, const std::string typeArg, int orientationArg, bool dynamicArg, SUMOReal sArg) + : id(idArg), type(typeArg), orientation(orientationArg), dynamic(dynamicArg), s(sArg) { } + + int id; + std::string type; + int orientation; + bool dynamic; + SUMOReal s; + }; + + + /** * @struct OpenDriveEdge * @brief Representation of an openDrive "link" */ @@ -269,13 +256,8 @@ : id(idArg), junction(junctionArg), length(lengthArg), from(0), to(0) { } - unsigned int getMaxLaneNumber(OpenDriveXMLTag dir) const { - unsigned int maxLaneNum = 0; - for (std::vector::const_iterator i = laneSections.begin(); i != laneSections.end(); ++i) { - maxLaneNum = MAX2(maxLaneNum, (*i).getLaneNumber(dir)); - } - return maxLaneNum; - } + unsigned int getMaxLaneNumber(OpenDriveXMLTag dir) const; + int getPriority(OpenDriveXMLTag dir) const; /// @brief The id of the edge std::string id; @@ -291,6 +273,7 @@ std::map endLaneMap; PositionVector geom; std::vector laneSections; + std::vector signals; }; @@ -301,17 +284,18 @@ NBEdge* to; std::string via; std::vector > lanes; + std::string id; }; protected: /** @brief Constructor * @param[in] nc The node control to fill */ - NIImporter_OpenDrive(std::vector &innerEdges, std::vector &outerEdges); + NIImporter_OpenDrive(std::vector& innerEdges, std::vector& outerEdges); /// @brief Destructor - ~NIImporter_OpenDrive() ; + ~NIImporter_OpenDrive(); @@ -329,18 +313,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; - - - /** @brief Called when characters occure - * - * @param[in] element ID of the last opened element - * @param[in] chars The read characters (complete) - * @exception ProcessError If something fails - * @see GenericSAXHandler::myCharacters - */ - void myCharacters(int element, - const std::string& chars) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -349,23 +322,24 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} private: void addLink(LinkType lt, const std::string& elementType, const std::string& elementID, - const std::string& contactPoint) ; + const std::string& contactPoint); - void addGeometryShape(GeometryType type, const std::vector &vals) ; + void addGeometryShape(GeometryType type, const std::vector& vals); OpenDriveEdge myCurrentEdge; - std::vector &myInnerEdges; - std::vector &myOuterEdges; + std::vector& myInnerEdges; + std::vector& myOuterEdges; std::vector myElementStack; OpenDriveXMLTag myCurrentLaneDirection; + static std::set myLaneTypes2Import; protected: @@ -382,32 +356,32 @@ * @return The retrieved/built node * @exception ProcessError If the node could not be built/retrieved */ - static NBNode* getOrBuildNode(const std::string& id, Position& pos, NBNodeCont& nc) ; + static NBNode* getOrBuildNode(const std::string& id, Position& pos, NBNodeCont& nc); - static std::vector geomFromLine(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static std::vector geomFromSpiral(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static std::vector geomFromArc(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static std::vector geomFromPoly(const OpenDriveEdge& e, const OpenDriveGeometry& g) ; - static Position calculateStraightEndPoint(double hdg, double length, const Position& start) ; - static void calculateCurveCenter(SUMOReal* ad_x, SUMOReal* ad_y, SUMOReal ad_radius, SUMOReal ad_hdg) ; + static std::vector geomFromLine(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static std::vector geomFromSpiral(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static std::vector geomFromArc(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static std::vector geomFromPoly(const OpenDriveEdge& e, const OpenDriveGeometry& g); + static Position calculateStraightEndPoint(double hdg, double length, const Position& start); + static void calculateCurveCenter(SUMOReal* ad_x, SUMOReal* ad_y, SUMOReal ad_radius, SUMOReal ad_hdg); static void calcPointOnCurve(SUMOReal* ad_x, SUMOReal* ad_y, SUMOReal ad_centerX, SUMOReal ad_centerY, - SUMOReal ad_r, SUMOReal ad_length) ; + SUMOReal ad_r, SUMOReal ad_length); static NBEdge* getOutgoingDirectionalEdge(const NBEdgeCont& ec, const NBNodeCont& nc, - const std::string& edgeID, const std::string& nodeID) ; + const std::string& edgeID, const std::string& nodeID); static NBEdge* getIncomingDirectionalEdge(const NBEdgeCont& ec, const NBNodeCont& nc, - const std::string& edgeID, const std::string& nodeID) ; + const std::string& edgeID, const std::string& nodeID); - static void computeShapes(std::vector &edges) ; + static void computeShapes(std::vector& edges); static void setNodeSecure(NBNodeCont& nc, OpenDriveEdge& e, - const std::string& nodeID, NIImporter_OpenDrive::LinkType lt) ; + const std::string& nodeID, NIImporter_OpenDrive::LinkType lt); static void addE2EConnectionsSecure(const NBEdgeCont& ec, const NBNode* const node, const OpenDriveEdge& from, const OpenDriveEdge& to, - std::vector &connections); + std::vector& connections); static void addViaConnectionSecure(const NBEdgeCont& ec, const NBNode* const node, const OpenDriveEdge& e, LinkType lt, const std::string& via, - std::vector &connections); + std::vector& connections); static void setLaneConnections(NIImporter_OpenDrive::Connection& c, const OpenDriveEdge& from, bool fromAtBegin, OpenDriveXMLTag fromLaneDir, @@ -431,6 +405,10 @@ private: const std::string& myEdgeID; + private: + /// @brief Invalidated assignment operator + edge_by_id_finder& operator=(const edge_by_id_finder& s); + }; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenStreetMap.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenStreetMap.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenStreetMap.cpp 2012-03-08 00:03:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenStreetMap.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenStreetMap.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NIImporter_OpenStreetMap.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in OpenStreetMap format /****************************************************************************/ @@ -133,14 +133,14 @@ // for highways NBTypeCont& tc = nb.getTypeCont(); SUMOReal const WIDTH = NBEdge::UNSPECIFIED_WIDTH; - tc.insert("highway.motorway", 3, (SUMOReal)(160./ 3.6), 13, WIDTH, SVC_UNKNOWN, true); + tc.insert("highway.motorway", 3, (SUMOReal)(160. / 3.6), 13, WIDTH, SVC_UNKNOWN, true); tc.insert("highway.motorway_link", 1, (SUMOReal)(80. / 3.6), 12, WIDTH, SVC_UNKNOWN, true); - tc.insert("highway.trunk", 2, (SUMOReal)(100./ 3.6), 11, WIDTH); // !!! 130km/h? + tc.insert("highway.trunk", 2, (SUMOReal)(100. / 3.6), 11, WIDTH); // !!! 130km/h? tc.insert("highway.trunk_link", 1, (SUMOReal)(80. / 3.6), 10, WIDTH); - tc.insert("highway.primary", 2, (SUMOReal)(100./ 3.6), 9, WIDTH); + tc.insert("highway.primary", 2, (SUMOReal)(100. / 3.6), 9, WIDTH); tc.insert("highway.primary_link", 1, (SUMOReal)(80. / 3.6), 8, WIDTH); - tc.insert("highway.secondary", 2, (SUMOReal)(100./ 3.6), 7, WIDTH); - tc.insert("highway.secondary_link",1, (SUMOReal)(80. / 3.6), 6, WIDTH); + tc.insert("highway.secondary", 2, (SUMOReal)(100. / 3.6), 7, WIDTH); + tc.insert("highway.secondary_link", 1, (SUMOReal)(80. / 3.6), 6, WIDTH); tc.insert("highway.tertiary", 1, (SUMOReal)(80. / 3.6), 6, WIDTH); tc.insert("highway.tertiary_link", 1, (SUMOReal)(80. / 3.6), 5, WIDTH); tc.insert("highway.unclassified", 1, (SUMOReal)(80. / 3.6), 5, WIDTH); @@ -150,7 +150,7 @@ tc.insert("highway.track", 1, (SUMOReal)(20. / 3.6), 1, WIDTH); tc.insert("highway.services", 1, (SUMOReal)(30. / 3.6), 1, WIDTH); tc.insert("highway.unsurfaced", 1, (SUMOReal)(30. / 3.6), 1, WIDTH); // unofficial value, used outside germany - tc.insert("highway.footway", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_PEDESTRIAN); + tc.insert("highway.footway", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_PEDESTRIAN); tc.insert("highway.pedestrian", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_PEDESTRIAN); tc.insert("highway.path", 1, (SUMOReal)(10. / 3.6), 1, WIDTH, SVC_PEDESTRIAN); @@ -161,16 +161,16 @@ tc.insert("highway.steps", 1, (SUMOReal)(5. / 3.6), 1, WIDTH, SVC_PEDESTRIAN); // :-) do not run too fast tc.insert("highway.stairs", 1, (SUMOReal)(5. / 3.6), 1, WIDTH, SVC_PEDESTRIAN); // additional tc.insert("highway.bus_guideway", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_BUS); - tc.insert("highway.raceway", 2, (SUMOReal)(300./ 3.6), 14, WIDTH, SVC_VIP); + tc.insert("highway.raceway", 2, (SUMOReal)(300. / 3.6), 14, WIDTH, SVC_VIP); tc.insert("highway.ford", 1, (SUMOReal)(10. / 3.6), 1, WIDTH, SVC_PUBLIC_ARMY); // for railways - tc.insert("railway.rail", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_RAIL_FAST); - tc.insert("railway.tram", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_CITYRAIL); - tc.insert("railway.light_rail", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_LIGHTRAIL); - tc.insert("railway.subway", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_CITYRAIL); - tc.insert("railway.preserved", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_LIGHTRAIL); - tc.insert("railway.monorail", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_LIGHTRAIL); // rail stuff has to be discussed + tc.insert("railway.rail", 1, (SUMOReal)(300. / 3.6), 15, WIDTH, SVC_RAIL_FAST, true); + tc.insert("railway.tram", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_CITYRAIL, true); + tc.insert("railway.light_rail", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_LIGHTRAIL, true); + tc.insert("railway.subway", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_CITYRAIL, true); + tc.insert("railway.preserved", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_LIGHTRAIL, true); + tc.insert("railway.monorail", 1, (SUMOReal)(300. / 3.6), 15, WIDTH, SVC_LIGHTRAIL, true); // rail stuff has to be discussed /* Parse file(s) @@ -223,12 +223,12 @@ /* Mark which nodes are used (by edges or traffic lights). * This is necessary to detect which OpenStreetMap nodes are for * geometry only */ - std::map nodeUsage; + std::map nodeUsage; // Mark which nodes are used by edges (begin and end) for (std::map::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { Edge* e = (*i).second; assert(e->myCurrentIsRoad); - for (std::vector::const_iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { + for (std::vector::const_iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { if (nodeUsage.find(*j) == nodeUsage.end()) { nodeUsage[*j] = 0; } @@ -236,7 +236,7 @@ } } // Mark which nodes are used by traffic lights - for (std::map::const_iterator nodesIt = myOSMNodes.begin(); nodesIt != myOSMNodes.end(); ++nodesIt) { + for (std::map::const_iterator nodesIt = myOSMNodes.begin(); nodesIt != myOSMNodes.end(); ++nodesIt) { if (nodesIt->second->tlsControlled) { // If the key is not found in the map, the value is automatically // initialized with 0. @@ -247,7 +247,6 @@ * Only those nodes in the middle of an edge which are used by more than * one edge are instantiated. Other nodes are considered as geometry nodes. */ NBNodeCont& nc = nb.getNodeCont(); - NBEdgeCont& ec = nb.getEdgeCont(); NBTrafficLightLogicCont& tlsc = nb.getTLLogicCont(); for (std::map::iterator i = myEdges.begin(); i != myEdges.end(); ++i) { Edge* e = (*i).second; @@ -262,8 +261,8 @@ NBNode* currentFrom = insertNodeChecking(*e->myCurrentNodes.begin(), nc, tlsc); NBNode* last = insertNodeChecking(*(e->myCurrentNodes.end() - 1), nc, tlsc); int running = 0; - std::vector passed; - for (std::vector::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { + std::vector passed; + for (std::vector::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { passed.push_back(*j); if (nodeUsage[*j] > 1 && j != e->myCurrentNodes.end() - 1 && j != e->myCurrentNodes.begin()) { NBNode* currentTo = insertNodeChecking(*j, nc, tlsc); @@ -281,7 +280,7 @@ NBNode* -NIImporter_OpenStreetMap::insertNodeChecking(long id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc) { +NIImporter_OpenStreetMap::insertNodeChecking(SUMOLong id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc) { NBNode* from = nc.retrieve(toString(id)); if (from == 0) { NIOSMNode* n = myOSMNodes.find(id)->second; @@ -300,7 +299,7 @@ if (n->tlsControlled) { // ok, this node is a traffic light node where no other nodes // participate - NBOwnTLDef* tlDef = new NBOwnTLDef(toString(id), from); + NBOwnTLDef* tlDef = new NBOwnTLDef(toString(id), from, 0); if (!tlsc.insert(tlDef)) { // actually, nothing should fail here delete tlDef; @@ -314,7 +313,7 @@ int NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* to, - const std::vector &passed, NBNetBuilder& nb) { + const std::vector& passed, NBNetBuilder& nb) { NBNodeCont& nc = nb.getNodeCont(); NBEdgeCont& ec = nb.getEdgeCont(); NBTypeCont& tc = nb.getTypeCont(); @@ -330,7 +329,7 @@ if (from == to) { // in the special case of a looped way split again using passed assert(passed.size() >= 2); - std::vector geom(passed); + std::vector geom(passed); geom.pop_back(); // remove to-node NBNode* intermediate = insertNodeChecking(geom.back(), nc, tlsc); index = insertEdge(e, index, from, intermediate, geom, nb); @@ -341,7 +340,7 @@ // convert the shape PositionVector shape; - for (std::vector::const_iterator i = passed.begin(); i != passed.end(); ++i) { + for (std::vector::const_iterator i = passed.begin(); i != passed.end(); ++i) { NIOSMNode* n = myOSMNodes.find(*i)->second; Position pos(n->lon, n->lat); if (!NILoader::transformCoordinates(pos, true)) { @@ -384,7 +383,7 @@ noLanes = MAX2(noLanes, tc.getNumLanes(*it)); maxSpeed = MAX2(maxSpeed, tc.getSpeed(*it)); prio = MAX2(prio, tc.getPriority(*it)); - defaultIsOneWay |= tc.getIsOneWay(*it); + defaultIsOneWay &= tc.getIsOneWay(*it); } WRITE_MESSAGE("Adding new compound type \"" + type + "\" for edge " + id + "."); // @todo use the propper bitsets instead of SVC_UNKNOWN (see #675) @@ -455,14 +454,14 @@ // definitions of NIImporter_OpenStreetMap::NodesHandler-methods // --------------------------------------------------------------------------- NIImporter_OpenStreetMap::NodesHandler::NodesHandler( - std::map &toFill, - std::set &uniqueNodes) : - SUMOSAXHandler("osm - file"), - myToFill(toFill), - myUniqueNodes(uniqueNodes), - myLastNodeID(-1), - myIsInValidNodeTag(false), - myHierarchyLevel(0) { + std::map& toFill, + std::set& uniqueNodes) : + SUMOSAXHandler("osm - file"), + myToFill(toFill), + myLastNodeID(-1), + myIsInValidNodeTag(false), + myHierarchyLevel(0), + myUniqueNodes(uniqueNodes) { } @@ -478,7 +477,7 @@ WRITE_ERROR("Node element on wrong XML hierarchy level (id='" + toString(attrs.getLongReporting(SUMO_ATTR_ID, 0, ok)) + "', level='" + toString(myHierarchyLevel) + "')."); return; } - long id = attrs.getLongReporting(SUMO_ATTR_ID, 0, ok); + SUMOLong id = attrs.getLongReporting(SUMO_ATTR_ID, 0, ok); std::string action = attrs.hasAttribute("action") ? attrs.getStringSecure("action", "") : ""; if (action == "delete") { return; @@ -523,7 +522,7 @@ myUniqueNodes.insert(toAdd); } else { delete toAdd; - toAdd = *similarNode; + toAdd = *similarNode; WRITE_MESSAGE("Found duplicate nodes. Substituting " + toString(id) + " with " + toString(toAdd->id)); } myToFill[id] = toAdd; @@ -536,12 +535,11 @@ } bool ok = true; std::string key = attrs.getStringReporting(SUMO_ATTR_K, toString(myLastNodeID).c_str(), ok); - std::string value = attrs.getOptStringReporting(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, ""); + std::string value = attrs.getStringReporting(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, false); if (!ok) { return; } - if (key == "highway" && value.find("traffic_signal") != std::string::npos && - !OptionsCont::getOptions().getBool("osm.discard-tls")) { + if (key == "highway" && value.find("traffic_signal") != std::string::npos && !OptionsCont::getOptions().getBool("tls.discard-loaded")) { myToFill[myLastNodeID]->tlsControlled = true; } } @@ -562,8 +560,8 @@ // definitions of NIImporter_OpenStreetMap::EdgesHandler-methods // --------------------------------------------------------------------------- NIImporter_OpenStreetMap::EdgesHandler::EdgesHandler( - const std::map &osmNodes, - std::map &toFill) + const std::map& osmNodes, + std::map& toFill) : SUMOSAXHandler("osm - file"), myOSMNodes(osmNodes), myEdgeMap(toFill) { mySpeedMap["signals"] = MAXSPEED_UNGIVEN; @@ -607,9 +605,9 @@ // parse "nd" (node) elements if (element == SUMO_TAG_ND) { bool ok = true; - long ref = attrs.getLongReporting(SUMO_ATTR_REF, 0, ok); + SUMOLong ref = attrs.getLongReporting(SUMO_ATTR_REF, 0, ok); if (ok) { - std::map::const_iterator node = myOSMNodes.find(ref); + std::map::const_iterator node = myOSMNodes.find(ref); if (node == myOSMNodes.end()) { WRITE_WARNING("The referenced geometry information (ref='" + toString(ref) + "') is not known"); return; @@ -617,7 +615,7 @@ ref = node->second->id; // node may have been substituted if (myCurrentEdge->myCurrentNodes.size() == 0 || myCurrentEdge->myCurrentNodes.back() != ref) { // avoid consecutive duplicates - myCurrentEdge->myCurrentNodes.push_back(ref); + myCurrentEdge->myCurrentNodes.push_back(ref); } } } @@ -629,7 +627,7 @@ } bool ok = true; std::string key = attrs.getStringReporting(SUMO_ATTR_K, toString(myCurrentEdge->id).c_str(), ok); - std::string value = attrs.getStringReporting(SUMO_ATTR_V, toString(myCurrentEdge->id).c_str(), ok); + std::string value = attrs.getStringReporting(SUMO_ATTR_V, toString(myCurrentEdge->id).c_str(), ok, false); if (!ok) { return; } @@ -644,7 +642,7 @@ myCurrentEdge->myCurrentIsRoad = true; } else if (key == "lanes") { try { - myCurrentEdge->myNoLanes = TplConvert::_2int(value.c_str()); + myCurrentEdge->myNoLanes = TplConvert::_2int(value.c_str()); } catch (NumberFormatException&) { // might be a list of values StringTokenizer st(value, ";", true); @@ -653,7 +651,7 @@ int minLanes = std::numeric_limits::max(); try { for (std::vector::iterator i = list.begin(); i != list.end(); ++i) { - int numLanes = TplConvert::_2int(StringUtils::prune(*i).c_str()); + int numLanes = TplConvert::_2int(StringUtils::prune(*i).c_str()); minLanes = MIN2(minLanes, numLanes); } myCurrentEdge->myNoLanes = minLanes; @@ -675,7 +673,7 @@ conversion = 1.609344; // kilometers per mile } try { - myCurrentEdge->myMaxSpeed = TplConvert::_2SUMOReal(value.c_str()) * conversion; + myCurrentEdge->myMaxSpeed = TplConvert::_2SUMOReal(value.c_str()) * conversion; } catch (NumberFormatException&) { WRITE_WARNING("Value of key '" + key + "' is not numeric ('" + value + "') in edge '" + myCurrentEdge->id + "'."); } diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenStreetMap.h sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenStreetMap.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_OpenStreetMap.h 2012-02-11 00:02:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_OpenStreetMap.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenStreetMap.h 11876 2012-02-10 14:12:59Z dkrajzew $ +/// @version $Id: NIImporter_OpenStreetMap.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in OpenStreetMap format /****************************************************************************/ @@ -81,7 +81,7 @@ */ struct NIOSMNode { /// @brief The node's id - long id; + SUMOLong id; /// @brief The longitude the node is located at double lon; /// @brief The latitude the node is located at @@ -107,7 +107,7 @@ /// @brief Information whether this is an one-way road std::string myIsOneWay; /// @brief The list of nodes this edge is made of - std::vector myCurrentNodes; + std::vector myCurrentNodes; /// @brief Information whether this is a road bool myCurrentIsRoad; }; @@ -124,10 +124,10 @@ * to their coordinates */ class CompareNodes { - public: - bool operator()(const NIOSMNode* n1, const NIOSMNode* n2) const { - return (n1->lat > n2->lat) || (n1->lat == n2->lat && n1->lon > n2->lon); - } + public: + bool operator()(const NIOSMNode* n1, const NIOSMNode* n2) const { + return (n1->lat > n2->lat) || (n1->lat == n2->lat && n1->lon > n2->lon); + } }; @@ -139,7 +139,7 @@ /** @brief the map from OSM node ids to actual nodes * @note: NIOSMNodes may appear multiple times due to substition */ - std::map myOSMNodes; + std::map myOSMNodes; /// @brief the set of unique nodes used in NodesHandler, used when freeing memory std::set myUniqueNodes; @@ -161,7 +161,7 @@ * @return The built/found node * @exception ProcessError If the tls could not be added to the container */ - NBNode* insertNodeChecking(long id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc); + NBNode* insertNodeChecking(SUMOLong id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc); /** @brief Builds an NBEdge @@ -177,11 +177,11 @@ * @exception ProcessError If the edge could not be added to the container */ int insertEdge(Edge* e, int index, NBNode* from, NBNode* to, - const std::vector &passed, NBNetBuilder& nb); + const std::vector& passed, NBNetBuilder& nb); - protected: - static const SUMOReal MAXSPEED_UNGIVEN; +protected: + static const SUMOReal MAXSPEED_UNGIVEN; /** * @class NodesHandler @@ -195,12 +195,12 @@ * @param[in, out] uniqueNodes The nodes container for ensuring uniqueness * @param[in] options The options to use */ - NodesHandler(std::map &toFill, - std::set &uniqueNodes); + NodesHandler(std::map& toFill, + std::set& uniqueNodes); /// @brief Destructor - ~NodesHandler() ; + ~NodesHandler(); protected: @@ -214,7 +214,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 @@ -223,17 +223,17 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} private: /// @brief The nodes container to fill - std::map &myToFill; + std::map& myToFill; /// @brief ID of the currently parsed node, for reporting mainly - long myLastNodeID; + SUMOLong myLastNodeID; /// @brief Hierarchy helper for parsing a node's tags bool myIsInValidNodeTag; @@ -242,7 +242,7 @@ int myHierarchyLevel; /// @brief the set of unique nodes (used for duplicate detection/substitution) - std::set &myUniqueNodes; + std::set& myUniqueNodes; private: @@ -267,12 +267,12 @@ * @param[in] osmNodes The previously parsed (osm-)nodes * @param[in, out] toFill The edges container to fill with read edges */ - EdgesHandler(const std::map &osmNodes, - std::map &toFill) ; + EdgesHandler(const std::map& osmNodes, + std::map& toFill); /// @brief Destructor - ~EdgesHandler() ; + ~EdgesHandler(); protected: @@ -286,7 +286,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 @@ -295,16 +295,16 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} private: /// @brief The previously parsed nodes - const std::map &myOSMNodes; + const std::map& myOSMNodes; /// @brief A map of built edges - std::map &myEdgeMap; + std::map& myEdgeMap; /// @brief The currently built edge Edge* myCurrentEdge; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_RobocupRescue.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_RobocupRescue.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_RobocupRescue.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_RobocupRescue.cpp 2012-09-25 22:01:33.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_RobocupRescue.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_RobocupRescue.cpp 12190 2012-03-29 08:20:37Z dkrajzew $ /// // Importer for networks stored in robocup rescue league format /****************************************************************************/ @@ -199,15 +199,13 @@ 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, -1, -1, "", spread); + 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, -1, -1, "", spread); + 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) + "'"); } diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_RobocupRescue.h sumo-0.16.0~dfsg/src/netimport/NIImporter_RobocupRescue.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_RobocupRescue.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_RobocupRescue.h 2012-09-25 22:01:33.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_RobocupRescue.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_RobocupRescue.h 12454 2012-06-30 04:54:07Z behrisch $ /// // Importer for networks stored in robocup rescue league format /****************************************************************************/ @@ -76,7 +76,7 @@ /// @brief Destructor - ~NIImporter_RobocupRescue() ; + ~NIImporter_RobocupRescue(); /** @brief Loads nodes from the given file @@ -98,6 +98,9 @@ /// @brief The edge container to fill NBEdgeCont& myEdgeCont; +private: + /// @brief Invalidated assignment operator + NIImporter_RobocupRescue& operator=(const NIImporter_RobocupRescue& s); }; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_SUMO.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_SUMO.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_SUMO.cpp 2012-03-08 00:03:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_SUMO.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_SUMO.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NIImporter_SUMO.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in SUMO format /****************************************************************************/ @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -47,6 +47,7 @@ #include #include #include +#include #include #include "NILoader.h" #include "NIImporter_SUMO.h" @@ -81,9 +82,7 @@ myCurrentLane(0), myCurrentTL(0), myLocation(0), - mySuspectKeepShape(false), - myHaveWarnedAboutDeprecatedSpreadType(false), - myHaveWarnedAboutDeprecatedMaxSpeed(false) {} + mySuspectKeepShape(false) {} NIImporter_SUMO::~NIImporter_SUMO() { @@ -120,7 +119,7 @@ for (std::map::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { EdgeAttrs* ed = (*i).second; // skip internal edges - if (ed->func == toString(EDGEFUNC_INTERNAL)) { + if (ed->func == EDGEFUNC_INTERNAL) { continue; } // get and check the nodes @@ -168,7 +167,7 @@ for (unsigned int fromLaneIndex = 0; fromLaneIndex < (unsigned int) ed->lanes.size(); ++fromLaneIndex) { LaneAttrs* lane = ed->lanes[fromLaneIndex]; // connections - const std::vector &connections = lane->connections; + const std::vector& connections = lane->connections; for (std::vector::const_iterator c_it = connections.begin(); c_it != connections.end(); c_it++) { const Connection& c = *c_it; if (myEdges.count(c.toEdgeID) == 0) { @@ -184,7 +183,7 @@ false, c.mayDefinitelyPass); // maybe we have a tls-controlled connection - if (c.tlID != "") { + if (c.tlID != "" && !OptionsCont::getOptions().getBool("tls.discard-loaded")) { const std::map& programs = myTLLCont.getPrograms(c.tlID); if (programs.size() > 0) { std::map::const_iterator it; @@ -193,8 +192,7 @@ if (tlDef) { tlDef->addConnection(nbe, toEdge, fromLaneIndex, c.toLaneIdx, c.tlLinkNo); } else { - throw ProcessError("Corrupt traffic light definition '" - + c.tlID + "' (program '" + it->first + "')"); + throw ProcessError("Corrupt traffic light definition '" + c.tlID + "' (program '" + it->first + "')"); } } } else { @@ -260,21 +258,18 @@ case SUMO_TAG_JUNCTION: addJunction(attrs); break; - case SUMO_TAG_SUCC: - addSuccEdge(attrs); - break; - case SUMO_TAG_SUCCLANE: - addSuccLane(attrs); - break; case SUMO_TAG_CONNECTION: addConnection(attrs); break; - case SUMO_TAG_TLLOGIC__DEPRECATED: case SUMO_TAG_TLLOGIC: - myCurrentTL = initTrafficLightLogic(attrs, myCurrentTL); + if (!OptionsCont::getOptions().getBool("tls.discard-loaded")) { + myCurrentTL = initTrafficLightLogic(attrs, myCurrentTL); + } break; case SUMO_TAG_PHASE: - addPhase(attrs, myCurrentTL); + if (!OptionsCont::getOptions().getBool("tls.discard-loaded")) { + addPhase(attrs, myCurrentTL); + } break; case SUMO_TAG_LOCATION: myLocation = loadLocation(attrs); @@ -289,14 +284,6 @@ void -NIImporter_SUMO::myCharacters(int element, - const std::string& chars) { - UNUSED_PARAMETER(element); - UNUSED_PARAMETER(chars); -} - - -void NIImporter_SUMO::myEndElement(int element) { switch (element) { case SUMO_TAG_EDGE: @@ -314,17 +301,17 @@ } myCurrentLane = 0; break; - case SUMO_TAG_TLLOGIC__DEPRECATED: case SUMO_TAG_TLLOGIC: - if (!myCurrentTL) { - WRITE_ERROR("Unmatched closing tag for tl-logic."); - } else { - if (!myTLLCont.insert(myCurrentTL)) { - WRITE_WARNING("Could not add program '" + myCurrentTL->getProgramID() + - "' for traffic light '" + myCurrentTL->getID() + "'"); - delete myCurrentTL; + if (!OptionsCont::getOptions().getBool("tls.discard-loaded")) { + if (!myCurrentTL) { + WRITE_ERROR("Unmatched closing tag for tl-logic."); + } else { + if (!myTLLCont.insert(myCurrentTL)) { + WRITE_WARNING("Could not add program '" + myCurrentTL->getProgramID() + "' for traffic light '" + myCurrentTL->getID() + "'"); + delete myCurrentTL; + } + myCurrentTL = 0; } - myCurrentTL = 0; } break; default: @@ -345,8 +332,8 @@ myCurrentEdge->builtEdge = 0; myCurrentEdge->id = id; // get the function - myCurrentEdge->func = attrs.getOptStringReporting(SUMO_ATTR_FUNCTION, id.c_str(), ok, "normal"); - if (myCurrentEdge->func == toString(EDGEFUNC_INTERNAL)) { + myCurrentEdge->func = attrs.getEdgeFunc(ok); + if (myCurrentEdge->func == EDGEFUNC_INTERNAL) { return; // skip internal edges } // get the type @@ -356,24 +343,14 @@ myCurrentEdge->toNode = attrs.getOptStringReporting(SUMO_ATTR_TO, id.c_str(), ok, ""); myCurrentEdge->priority = attrs.getOptIntReporting(SUMO_ATTR_PRIORITY, id.c_str(), ok, -1); myCurrentEdge->type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok, ""); - myCurrentEdge->shape = GeomConvHelper::parseShapeReporting( - attrs.getOptStringReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, ""), - attrs.getObjectType(), id.c_str(), ok, true); + myCurrentEdge->shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, true); NILoader::transformCoordinates(myCurrentEdge->shape, true, myLocation); myCurrentEdge->length = attrs.getOptSUMORealReporting(SUMO_ATTR_LENGTH, id.c_str(), ok, NBEdge::UNSPECIFIED_LOADED_LENGTH); myCurrentEdge->maxSpeed = 0; myCurrentEdge->streetName = attrs.getOptStringReporting(SUMO_ATTR_NAME, id.c_str(), ok, ""); std::string lsfS = toString(LANESPREAD_RIGHT); - if (attrs.hasAttribute(SUMO_ATTR_SPREADFUNC__DEPRECATED)) { - lsfS = attrs.getStringReporting(SUMO_ATTR_SPREADFUNC__DEPRECATED, id.c_str(), ok); - if (!myHaveWarnedAboutDeprecatedSpreadType) { - WRITE_WARNING("'" + toString(SUMO_ATTR_SPREADFUNC__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_ATTR_SPREADTYPE) + "'."); - myHaveWarnedAboutDeprecatedSpreadType = true; - } - } else { - lsfS = attrs.getOptStringReporting(SUMO_ATTR_SPREADTYPE, id.c_str(), ok, lsfS); - } + lsfS = attrs.getOptStringReporting(SUMO_ATTR_SPREADTYPE, id.c_str(), ok, lsfS); if (SUMOXMLDefinitions::LaneSpreadFunctions.hasString(lsfS)) { myCurrentEdge->lsf = SUMOXMLDefinitions::LaneSpreadFunctions.get(lsfS); } else { @@ -394,25 +371,15 @@ return; } myCurrentLane = new LaneAttrs; - if (myCurrentEdge->func == toString(EDGEFUNC_INTERNAL)) { + if (myCurrentEdge->func == EDGEFUNC_INTERNAL) { return; // skip internal lanes } - if (attrs.hasAttribute(SUMO_ATTR_MAXSPEED__DEPRECATED)) { - myCurrentLane->maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_MAXSPEED__DEPRECATED, id.c_str(), ok); - if (!myHaveWarnedAboutDeprecatedMaxSpeed) { - myHaveWarnedAboutDeprecatedMaxSpeed = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_MAXSPEED__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_SPEED) + "' instead."); - } - } else { - myCurrentLane->maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok); - } + myCurrentLane->maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok); myCurrentLane->allow = attrs.getOptStringReporting(SUMO_ATTR_ALLOW, id.c_str(), ok, ""); myCurrentLane->disallow = attrs.getOptStringReporting(SUMO_ATTR_DISALLOW, id.c_str(), ok, ""); myCurrentLane->width = attrs.getOptSUMORealReporting(SUMO_ATTR_WIDTH, id.c_str(), ok, (SUMOReal) NBEdge::UNSPECIFIED_WIDTH); myCurrentLane->offset = attrs.getOptSUMORealReporting(SUMO_ATTR_ENDOFFSET, id.c_str(), ok, (SUMOReal) NBEdge::UNSPECIFIED_OFFSET); - myCurrentLane->shape = GeomConvHelper::parseShapeReporting( - attrs.getStringReporting(SUMO_ATTR_SHAPE, id.c_str(), ok), - attrs.getObjectType(), id.c_str(), ok, false); + myCurrentLane->shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, false); // lane coordinates are derived (via lane spread) do not include them in convex boundary NILoader::transformCoordinates(myCurrentLane->shape, false, myLocation); } @@ -429,28 +396,26 @@ if (id[0] == ':') { // internal node return; } - SumoXMLNodeType type = NODETYPE_UNKNOWN; - std::string typeS = attrs.getStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok); - if (SUMOXMLDefinitions::NodeTypes.hasString(typeS)) { - type = SUMOXMLDefinitions::NodeTypes.get(typeS); + SumoXMLNodeType type = attrs.getNodeType(ok); + if (ok) { if (type == NODETYPE_DEAD_END_DEPRECATED) { // patch legacy type type = NODETYPE_DEAD_END; } } else { - WRITE_WARNING("Unknown node type '" + typeS + "' for junction '" + id + "'."); + WRITE_WARNING("Unknown node type for junction '" + id + "'."); } Position pos = readPosition(attrs, id, ok); NILoader::transformCoordinates(pos, true, myLocation); - // the network may have been built with the option "plain.keep-edge-shape" this - // makes accurate reconstruction of legacy networks impossible. We ought to warn about this - std::string shapeS = attrs.getStringReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, false); - if (shapeS != "") { - PositionVector shape = GeomConvHelper::parseShapeReporting( - shapeS, attrs.getObjectType(), id.c_str(), ok, false); - shape.push_back_noDoublePos(shape[0]); // need closed shape - if (!shape.around(pos) && shape.distance(pos) > 1) { // MAGIC_THRESHOLD - // WRITE_WARNING("Junction '" + id + "': distance between pos and shape is " + toString(shape.distance(pos))); - mySuspectKeepShape = true; + // the network may have non-default edge geometry. + // accurate reconstruction of legacy networks is not possible. We ought to warn about this + if (attrs.hasAttribute(SUMO_ATTR_SHAPE)) { + PositionVector shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, true); + if (shape.size() > 0) { + shape.push_back_noDoublePos(shape[0]); // need closed shape + if (!shape.around(pos) && shape.distance(pos) > 1) { // MAGIC_THRESHOLD + // WRITE_WARNING("Junction '" + id + "': distance between pos and shape is " + toString(shape.distance(pos))); + mySuspectKeepShape = true; + } } } NBNode* node = new NBNode(id, pos, type); @@ -463,46 +428,6 @@ void -NIImporter_SUMO::addSuccEdge(const SUMOSAXAttributes& attrs) { - bool ok = true; - std::string edge_id = attrs.getStringReporting(SUMO_ATTR_EDGE, 0, ok); - myCurrentEdge = 0; - if (myEdges.count(edge_id) == 0) { - WRITE_ERROR("Unknown edge '" + edge_id + "' given in succedge."); - return; - } - myCurrentEdge = myEdges[edge_id]; - std::string lane_id = attrs.getStringReporting(SUMO_ATTR_LANE, 0, ok); - myCurrentLane = getLaneAttrsFromID(myCurrentEdge, lane_id); -} - - -void -NIImporter_SUMO::addSuccLane(const SUMOSAXAttributes& attrs) { - if (myCurrentLane == 0) { - WRITE_ERROR("Found succlane outside succ element"); - return; - } - bool ok = true; - Connection conn; - std::string laneID = attrs.getStringReporting(SUMO_ATTR_LANE, 0, ok); - if (laneID == "SUMO_NO_DESTINATION") { // legacy check - // deprecated - return; - } - interpretLaneID(laneID, conn.toEdgeID, conn.toLaneIdx); - conn.tlID = attrs.getOptStringReporting(SUMO_ATTR_TLID, 0, ok, ""); - conn.mayDefinitelyPass = false; // (attrs.getStringReporting(SUMO_ATTR_STATE, 0, ok, "") == "M"); - if (conn.tlID != "") { - conn.tlLinkNo = attrs.hasAttribute(SUMO_ATTR_TLLINKINDEX) - ? attrs.getIntReporting(SUMO_ATTR_TLLINKINDEX, 0, ok) - : attrs.getIntReporting(SUMO_ATTR_TLLINKNO__DEPRECATED, 0, ok); - } - myCurrentLane->connections.push_back(conn); -} - - -void NIImporter_SUMO::addConnection(const SUMOSAXAttributes& attrs) { bool ok = true; std::string fromID = attrs.getStringReporting(SUMO_ATTR_FROM, 0, ok); @@ -516,7 +441,13 @@ unsigned int fromLaneIdx = attrs.getIntReporting(SUMO_ATTR_FROM_LANE, 0, ok); conn.toLaneIdx = attrs.getIntReporting(SUMO_ATTR_TO_LANE, 0, ok); conn.tlID = attrs.getOptStringReporting(SUMO_ATTR_TLID, 0, ok, ""); - conn.mayDefinitelyPass = false; // (attrs.getStringReporting(SUMO_ATTR_STATE, 0, ok, "") == "M"); + conn.mayDefinitelyPass = attrs.getOptBoolReporting(SUMO_ATTR_PASS, 0, ok, false); + const size_t suffixSize = NBRampsComputer::ADDED_ON_RAMP_EDGE.size(); + if (!conn.mayDefinitelyPass && conn.toEdgeID.size() > suffixSize && + conn.toEdgeID.substr(conn.toEdgeID.size() - suffixSize) == NBRampsComputer::ADDED_ON_RAMP_EDGE) { + WRITE_MESSAGE("Infering connection attribute pass=\"1\" from to-edge id '" + conn.toEdgeID + "'"); + conn.mayDefinitelyPass = true; + } if (conn.tlID != "") { conn.tlLinkNo = attrs.getIntReporting(SUMO_ATTR_TLLINKINDEX, 0, ok); } @@ -572,7 +503,7 @@ edge_id = lane_id.substr(0, sep_index); std::string index_string = lane_id.substr(sep_index + 1); try { - index = (unsigned int)TplConvert::_2int(index_string.c_str()); + index = (unsigned int)TplConvert::_2int(index_string.c_str()); } catch (NumberFormatException) { WRITE_ERROR("Invalid lane index '" + index_string + "' for lane '" + lane_id + "'."); } @@ -671,15 +602,9 @@ // @todo refactor parsing of location since its duplicated in NLHandler and PCNetProjectionLoader bool ok = true; GeoConvHelper* result = 0; - PositionVector s = GeomConvHelper::parseShapeReporting( - attrs.getStringReporting(SUMO_ATTR_NET_OFFSET, 0, ok), - attrs.getObjectType(), 0, ok, false); - Boundary convBoundary = GeomConvHelper::parseBoundaryReporting( - attrs.getStringReporting(SUMO_ATTR_CONV_BOUNDARY, 0, ok), - attrs.getObjectType(), 0, ok); - Boundary origBoundary = GeomConvHelper::parseBoundaryReporting( - attrs.getStringReporting(SUMO_ATTR_ORIG_BOUNDARY, 0, ok), - attrs.getObjectType(), 0, ok); + PositionVector s = attrs.getShapeReporting(SUMO_ATTR_NET_OFFSET, 0, ok, false); + Boundary convBoundary = attrs.getBoundaryReporting(SUMO_ATTR_CONV_BOUNDARY, 0, ok); + Boundary origBoundary = attrs.getBoundaryReporting(SUMO_ATTR_ORIG_BOUNDARY, 0, ok); std::string proj = attrs.getStringReporting(SUMO_ATTR_ORIG_PROJ, 0, ok); if (ok) { Position networkOffset = s[0]; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_SUMO.h sumo-0.16.0~dfsg/src/netimport/NIImporter_SUMO.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_SUMO.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_SUMO.h 2012-11-13 00:02:16.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_SUMO.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIImporter_SUMO.h 12968 2012-11-12 07:45:56Z behrisch $ /// // Importer for networks stored in SUMO format /****************************************************************************/ @@ -92,7 +92,7 @@ /// @brief Destructor - ~NIImporter_SUMO() ; + ~NIImporter_SUMO(); @@ -110,18 +110,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; - - - /** @brief Called when characters occure - * - * @param[in] element ID of the last opened element - * @param[in] chars The read characters (complete) - * @exception ProcessError If something fails - * @see GenericSAXHandler::myCharacters - */ - void myCharacters(int element, - const std::string& chars) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -130,7 +119,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} @@ -159,19 +148,6 @@ void addJunction(const SUMOSAXAttributes& attrs); - /** @brief (deprecated) Parses a succedge-definition and saves it - * by assigning "myCurrentEdge" and "myCurrentLane" to the read values - * @param[in] attrs The attributes to get the succedge-definition from - */ - void addSuccEdge(const SUMOSAXAttributes& attrs); - - - /** @brief (deprecated) Parses a succlane-definition and saves it - * into the lane's definition stored in "myCurrentLane" - * @param[in] attrs The attributes to get the succlane-definition from - */ - void addSuccLane(const SUMOSAXAttributes& attrs); - /** @brief Parses a connection and saves it * into the lane's definition stored in "myCurrentLane" * @param[in] attrs The attributes to get the connection from @@ -238,7 +214,7 @@ /// @brief This edge's type std::string type; /// @brief This edge's function - std::string func; + SumoXMLEdgeFunc func; /// @brief The node this edge starts at std::string fromNode; /// @brief The node this edge ends at @@ -301,8 +277,6 @@ /// @brief whether we suspect a net that was built with xml.keep-shape bool mySuspectKeepShape; - bool myHaveWarnedAboutDeprecatedSpreadType; - bool myHaveWarnedAboutDeprecatedMaxSpeed; /** @brief Parses lane index from lane ID an retrieve lane from EdgeAttrs * @param[in] edge The EdgeAttrs* which should contain the lane diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_VISUM.cpp sumo-0.16.0~dfsg/src/netimport/NIImporter_VISUM.cpp --- sumo-0.15.0~dfsg/src/netimport/NIImporter_VISUM.cpp 2012-03-14 00:02:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_VISUM.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NIImporter_VISUM.cpp 12083 2012-03-13 12:55:30Z dkrajzew $ +/// @version $Id: NIImporter_VISUM.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A VISUM network importer /****************************************************************************/ @@ -38,7 +38,6 @@ #include #include #include -#include #include #include "NILoader.h" @@ -205,8 +204,10 @@ PROGRESS_DONE_MESSAGE(); } // build traffic lights - for (NIVisumTL_Map::iterator j = myTLS.begin(); j != myTLS.end(); j++) { - j->second->build(myNetBuilder.getTLLogicCont()); + if (!OptionsCont::getOptions().getBool("tls.discard-loaded")) { + for (NIVisumTL_Map::iterator j = myTLS.begin(); j != myTLS.end(); j++) { + j->second->build(myNetBuilder.getTLLogicCont()); + } } // build district shapes for (std::map::const_iterator k = myDistrictShapes.begin(); k != myDistrictShapes.end(); ++k) { @@ -233,7 +234,7 @@ // get the maximum speed SUMOReal speed = getNamedFloat("v0-IV", "V0IV"); // get the priority - int priority = 1000 - TplConvert::_2int(myLineParser.get("Rang").c_str()); + int priority = 1000 - TplConvert::_2int(myLineParser.get("Rang").c_str()); // try to retrieve the number of lanes SUMOReal cap = getNamedFloat("Kap-IV", "KAPIV"); int nolanes = myCapacity2Lanes.get(cap); @@ -285,7 +286,7 @@ return; } if (myLineParser.know("FLAECHEID")) { - long flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str()); + SUMOLong flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str()); myShapeDistrictMap[flaecheID] = district; } } @@ -293,9 +294,9 @@ void NIImporter_VISUM::parse_Point() { - long id = TplConvert::_2long(myLineParser.get("ID").c_str()); - SUMOReal x = TplConvert::_2SUMOReal(myLineParser.get("XKOORD").c_str()); - SUMOReal y = TplConvert::_2SUMOReal(myLineParser.get("YKOORD").c_str()); + SUMOLong id = TplConvert::_2long(myLineParser.get("ID").c_str()); + SUMOReal x = TplConvert::_2SUMOReal(myLineParser.get("XKOORD").c_str()); + SUMOReal y = TplConvert::_2SUMOReal(myLineParser.get("YKOORD").c_str()); Position pos(x, y); if (!NILoader::transformCoordinates(pos, false)) { WRITE_ERROR("Unable to project coordinates for point " + toString(id) + "."); @@ -325,9 +326,11 @@ SUMOReal speed = myNetBuilder.getTypeCont().getSpeed(type); if (!OptionsCont::getOptions().getBool("visum.use-type-speed")) { try { - speed = myLineParser.know("v0-IV") - ? TplConvertSec::_2SUMORealSec(myLineParser.get("v0-IV").c_str(), -1) - : TplConvertSec::_2SUMORealSec(myLineParser.get("V0IV").c_str(), -1); + std::string speedS = myLineParser.know("v0-IV") ? myLineParser.get("v0-IV") : myLineParser.get("V0IV"); + if (speedS.find("km/h") != std::string::npos) { + speedS = speedS.substr(0, speedS.find("km/h")); + } + speed = TplConvert::_2SUMORealSec(speedS.c_str(), -1); speed = speed / (SUMOReal) 3.6; } catch (OutOfBoundsException) {} } @@ -337,7 +340,7 @@ // get the information whether the edge is a one-way bool oneway = myLineParser.know("Einbahn") - ? TplConvert::_2bool(myLineParser.get("Einbahn").c_str()) + ? TplConvert::_2bool(myLineParser.get("Einbahn").c_str()) : true; // get the number of lanes int nolanes = myNetBuilder.getTypeCont().getNumLanes(type); @@ -345,15 +348,15 @@ try { if (!OptionsCont::getOptions().getBool("visum.use-type-laneno")) { nolanes = myLineParser.know("Fahrstreifen") - ? TplConvertSec::_2intSec(myLineParser.get("Fahrstreifen").c_str(), 0) - : TplConvertSec::_2intSec(myLineParser.get("ANZFAHRSTREIFEN").c_str(), 0); + ? TplConvert::_2intSec(myLineParser.get("Fahrstreifen").c_str(), 0) + : TplConvert::_2intSec(myLineParser.get("ANZFAHRSTREIFEN").c_str(), 0); } } catch (UnknownElement) { } } else { SUMOReal cap = myLineParser.know("KAPIV") - ? TplConvertSec::_2SUMORealSec(myLineParser.get("KAPIV").c_str(), -1) - : TplConvertSec::_2SUMORealSec(myLineParser.get("KAP-IV").c_str(), -1); + ? TplConvert::_2SUMORealSec(myLineParser.get("KAPIV").c_str(), -1) + : TplConvert::_2SUMORealSec(myLineParser.get("KAP-IV").c_str(), -1); nolanes = myCapacity2Lanes.get(cap); } // check whether the id is already used @@ -411,19 +414,19 @@ void NIImporter_VISUM::parse_Kante() { - long id = TplConvert::_2long(myLineParser.get("ID").c_str()); - long from = TplConvert::_2long(myLineParser.get("VONPUNKTID").c_str()); - long to = TplConvert::_2long(myLineParser.get("NACHPUNKTID").c_str()); + SUMOLong id = TplConvert::_2long(myLineParser.get("ID").c_str()); + SUMOLong from = TplConvert::_2long(myLineParser.get("VONPUNKTID").c_str()); + SUMOLong to = TplConvert::_2long(myLineParser.get("NACHPUNKTID").c_str()); myEdges[id] = std::make_pair(from, to); } void NIImporter_VISUM::parse_PartOfArea() { - long flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str()); - long flaechePartID = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str()); + SUMOLong flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str()); + SUMOLong flaechePartID = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str()); if (mySubPartsAreas.find(flaechePartID) == mySubPartsAreas.end()) { - mySubPartsAreas[flaechePartID] = std::vector(); + mySubPartsAreas[flaechePartID] = std::vector(); } mySubPartsAreas[flaechePartID].push_back(flaecheID); } @@ -449,11 +452,11 @@ } else { proz = 1; } - // get the duration to wait - SUMOReal retard = -1; - if (myLineParser.know("t0-IV")) { - retard = getNamedFloat("t0-IV", -1); - } + // get the duration to wait (unused) +// SUMOReal retard = -1; +// if (myLineParser.know("t0-IV")) { +// retard = getNamedFloat("t0-IV", -1); +// } // get the type; // use a standard type with a large speed when a type is not given std::string type = myLineParser.know("Typ") @@ -604,7 +607,7 @@ int index; SUMOReal x, y; try { - index = TplConvert::_2int(myLineParser.get("INDEX").c_str()); + index = TplConvert::_2int(myLineParser.get("INDEX").c_str()); x = getNamedFloat("XKoord"); y = getNamedFloat("YKoord"); } catch (NumberFormatException&) { @@ -660,7 +663,7 @@ : NBHelpers::normalIDRepresentation(myLineParser.get("NR")); int lane = -1; try { - lane = TplConvert::_2int(laneS.c_str()); + lane = TplConvert::_2int(laneS.c_str()); } catch (NumberFormatException&) { WRITE_ERROR("A lane number for edge '" + edge->getID() + "' is not numeric (" + laneS + ")."); return; @@ -681,7 +684,7 @@ std::string lengthS = NBHelpers::normalIDRepresentation(myLineParser.get("LAENGE")); SUMOReal length = -1; try { - length = TplConvert::_2SUMOReal(lengthS.c_str()); + length = TplConvert::_2SUMOReal(lengthS.c_str()); } catch (NumberFormatException&) { WRITE_ERROR("A lane length for edge '" + edge->getID() + "' is not numeric (" + lengthS + ")."); return; @@ -718,7 +721,6 @@ // nope, we have to split the edge... // maybe it is not the proper edge to split - VISUM seems not to sort the splits... bool mustRecheck = true; - NBNode* nextNode = node; SUMOReal seenLength = 0; while (mustRecheck) { if (edge->getID().substr(edge->getID().length() - node->getID().length() - 1) == "_" + node->getID()) { @@ -726,19 +728,15 @@ std::string sub = edge->getID(); sub = sub.substr(sub.rfind('_', sub.rfind('_') - 1)); sub = sub.substr(1, sub.find('_', 1) - 1); - SUMOReal dist = TplConvert::_2SUMOReal(sub.c_str()); + SUMOReal dist = TplConvert::_2SUMOReal(sub.c_str()); if (dist < length) { seenLength += edge->getLength(); if (dirS == "1") { // incoming -> move back edge = edge->getFromNode()->getIncomingEdges()[0]; - nextNode = edge->getToNode(); - nextNode = edge->getFromNode(); } else { // outgoing -> move forward edge = edge->getToNode()->getOutgoingEdges()[0]; - nextNode = edge->getFromNode(); - nextNode = edge->getToNode(); } } else { mustRecheck = false; @@ -777,18 +775,15 @@ void NIImporter_VISUM::parse_TrafficLights() { - // get the id myCurrentID = NBHelpers::normalIDRepresentation(myLineParser.get("Nr")); - // cycle time - SUMOReal CycleTime = getNamedFloat("Umlaufzeit", "UMLZEIT"); - // IntermediateTime - SUMOReal IntermediateTime = getNamedFloat("StdZwischenzeit", "STDZWZEIT"); - // PhaseBased - bool PhaseBased = myLineParser.know("PhasenBasiert") - ? TplConvert::_2bool(myLineParser.get("PhasenBasiert").c_str()) + SUMOTime cycleTime = (SUMOTime) getNamedFloat("Umlaufzeit", "UMLZEIT"); + SUMOTime intermediateTime = (SUMOTime) getNamedFloat("StdZwischenzeit", "STDZWZEIT"); + bool phaseBased = myLineParser.know("PhasenBasiert") + ? TplConvert::_2bool(myLineParser.get("PhasenBasiert").c_str()) : false; + SUMOTime offset = myLineParser.know("ZEITVERSATZ") ? TIME2STEPS(getNamedFloat("ZEITVERSATZ")) : 0; // add to the list - myTLS[myCurrentID] = new NIVisumTL(myCurrentID, (SUMOTime) CycleTime, (SUMOTime) IntermediateTime, PhaseBased); + myTLS[myCurrentID] = new NIVisumTL(myCurrentID, cycleTime, offset, intermediateTime, phaseBased); } @@ -803,19 +798,17 @@ void NIImporter_VISUM::parse_SignalGroups() { - // get the id myCurrentID = NBHelpers::normalIDRepresentation(myLineParser.get("Nr")); std::string LSAid = NBHelpers::normalIDRepresentation(myLineParser.get("LsaNr")); - // StartTime SUMOReal startTime = getNamedFloat("GzStart", "GRUENANF"); - // EndTime SUMOReal endTime = getNamedFloat("GzEnd", "GRUENENDE"); + SUMOReal yellowTime = myLineParser.know("GELB") ? getNamedFloat("GELB") : -1; // add to the list if (myTLS.find(LSAid) == myTLS.end()) { WRITE_ERROR("Could not find TLS '" + LSAid + "' for setting the signal group."); return; } - myTLS.find(LSAid)->second->addSignalGroup(myCurrentID, (SUMOTime) startTime, (SUMOTime) endTime); + myTLS.find(LSAid)->second->addSignalGroup(myCurrentID, (SUMOTime) startTime, (SUMOTime) endTime, (SUMOTime) yellowTime); } @@ -874,21 +867,22 @@ void NIImporter_VISUM::parse_AreaSubPartElement() { - long id = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str()); - long edgeid = TplConvert::_2long(myLineParser.get("KANTEID").c_str()); + SUMOLong id = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str()); + SUMOLong edgeid = TplConvert::_2long(myLineParser.get("KANTEID").c_str()); if (myEdges.find(edgeid) == myEdges.end()) { WRITE_ERROR("Unknown edge in TEILFLAECHENELEMENT"); return; } std::string dir = myLineParser.get("RICHTUNG"); - std::string indexS = NBHelpers::normalIDRepresentation(myLineParser.get("INDEX")); - int index = -1; - try { - index = TplConvert::_2int(indexS.c_str()) - 1; - } catch (NumberFormatException&) { - WRITE_ERROR("An index for a TEILFLAECHENELEMENT is not numeric (id='" + toString(id) + "')."); - return; - } +// get index (unused) +// std::string indexS = NBHelpers::normalIDRepresentation(myLineParser.get("INDEX")); +// int index = -1; +// try { +// index = TplConvert::_2int(indexS.c_str()) - 1; +// } catch (NumberFormatException&) { +// WRITE_ERROR("An index for a TEILFLAECHENELEMENT is not numeric (id='" + toString(id) + "')."); +// return; +// } PositionVector shape; shape.push_back(myPoints[myEdges[edgeid].first]); shape.push_back(myPoints[myEdges[edgeid].second]); @@ -900,8 +894,8 @@ return; } - const std::vector &areas = mySubPartsAreas.find(id)->second; - for (std::vector::const_iterator i = areas.begin(); i != areas.end(); ++i) { + const std::vector& areas = mySubPartsAreas.find(id)->second; + for (std::vector::const_iterator i = areas.begin(); i != areas.end(); ++i) { NBDistrict* d = myShapeDistrictMap[*i]; if (d == 0) { continue; @@ -923,14 +917,12 @@ void NIImporter_VISUM::parse_Phases() { // get the id - std::string Phaseid = NBHelpers::normalIDRepresentation(myLineParser.get("Nr")); + std::string phaseid = NBHelpers::normalIDRepresentation(myLineParser.get("Nr")); std::string LSAid = NBHelpers::normalIDRepresentation(myLineParser.get("LsaNr")); - // StartTime - SUMOReal StartTime = getNamedFloat("GzStart", "GRUENANF"); - // EndTime - SUMOReal EndTime = getNamedFloat("GzEnd", "GRUENENDE"); - // add to the list - myTLS.find(LSAid)->second->addPhase(Phaseid, (SUMOTime) StartTime, (SUMOTime) EndTime); + SUMOReal startTime = getNamedFloat("GzStart", "GRUENANF"); + SUMOReal endTime = getNamedFloat("GzEnd", "GRUENENDE"); + SUMOReal yellowTime = myLineParser.know("GELB") ? getNamedFloat("GELB") : -1; + myTLS.find(LSAid)->second->addPhase(phaseid, (SUMOTime) startTime, (SUMOTime) endTime, (SUMOTime) yellowTime); } @@ -982,7 +974,7 @@ std::string fromLaneS = NBHelpers::normalIDRepresentation(myLineParser.get("VONFSNR")); int fromLane = -1; try { - fromLane = TplConvert::_2int(fromLaneS.c_str()); + fromLane = TplConvert::_2int(fromLaneS.c_str()); } catch (NumberFormatException&) { WRITE_ERROR("A from-lane number for edge '" + fromEdge->getID() + "' is not numeric (" + fromLaneS + ")."); return; @@ -996,7 +988,7 @@ std::string toLaneS = NBHelpers::normalIDRepresentation(myLineParser.get("NACHFSNR")); int toLane = -1; try { - toLane = TplConvert::_2int(toLaneS.c_str()); + toLane = TplConvert::_2int(toLaneS.c_str()); } catch (NumberFormatException&) { WRITE_ERROR("A to-lane number for edge '" + toEdge->getID() + "' is not numeric (" + toLaneS + ")."); return; @@ -1045,10 +1037,10 @@ SUMOReal NIImporter_VISUM::getWeightedFloat(const std::string& name) { try { - return TplConvert::_2SUMOReal(myLineParser.get(name).c_str()); + return TplConvert::_2SUMOReal(myLineParser.get(name).c_str()); } catch (...) {} try { - return TplConvert::_2SUMOReal(myLineParser.get((name + "(IV)")).c_str()); + return TplConvert::_2SUMOReal(myLineParser.get((name + "(IV)")).c_str()); } catch (...) {} return -1; } @@ -1057,10 +1049,10 @@ bool NIImporter_VISUM::getWeightedBool(const std::string& name) { try { - return TplConvert::_2bool(myLineParser.get(name).c_str()); + return TplConvert::_2bool(myLineParser.get(name).c_str()); } catch (...) {} try { - return TplConvert::_2bool(myLineParser.get((name + "(IV)")).c_str()); + return TplConvert::_2bool(myLineParser.get((name + "(IV)")).c_str()); } catch (...) {} return false; } @@ -1223,7 +1215,7 @@ SUMOReal NIImporter_VISUM::getNamedFloat(const std::string& fieldName) throw(OutOfBoundsException, NumberFormatException, UnknownElement) { std::string valS = NBHelpers::normalIDRepresentation(myLineParser.get(fieldName)); - return TplConvert::_2SUMOReal(valS.c_str()); + return TplConvert::_2SUMOReal(valS.c_str()); } @@ -1231,7 +1223,7 @@ NIImporter_VISUM::getNamedFloat(const std::string& fieldName, SUMOReal defaultValue) { try { std::string valS = NBHelpers::normalIDRepresentation(myLineParser.get(fieldName)); - return TplConvert::_2SUMOReal(valS.c_str()); + return TplConvert::_2SUMOReal(valS.c_str()); } catch (...) { return defaultValue; } diff -Nru sumo-0.15.0~dfsg/src/netimport/NIImporter_VISUM.h sumo-0.16.0~dfsg/src/netimport/NIImporter_VISUM.h --- sumo-0.15.0~dfsg/src/netimport/NIImporter_VISUM.h 2012-03-13 12:52:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIImporter_VISUM.h 2012-09-25 22:01:33.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NIImporter_VISUM.h 12080 2012-03-13 12:10:33Z dkrajzew $ +/// @version $Id: NIImporter_VISUM.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A VISUM network importer /****************************************************************************/ @@ -101,11 +101,11 @@ * @param[in] useVisumPrio Information whether the VISUM type's priority shall be used */ NIImporter_VISUM(NBNetBuilder& nb, const std::string& file, - NBCapacity2Lanes capacity2Lanes, bool useVisumPrio) ; + NBCapacity2Lanes capacity2Lanes, bool useVisumPrio); /// @brief destructor - ~NIImporter_VISUM() ; + ~NIImporter_VISUM(); /** @brief Parses the VISUM-network file storing the parsed structures within myNetBuilder @@ -118,7 +118,7 @@ * * @exception ProcessError If the file could not be opened */ - void load() ; + void load(); private: /** @brief Returns the value from the named column as a float @@ -149,7 +149,7 @@ * @param[in] defaultValue The default to return in the case of an error * @return The parsed real or the default value if an error while parsing occured */ - SUMOReal getNamedFloat(const std::string& fieldName, SUMOReal defaultValue) ; + SUMOReal getNamedFloat(const std::string& fieldName, SUMOReal defaultValue); /** @brief The same, but two different names for the field are allowed * @@ -159,7 +159,7 @@ * @return The parsed real or the default value if an error while parsing occured */ SUMOReal getNamedFloat(const std::string& fieldName1, const std::string& fieldName2, - SUMOReal defaultValue) ; + SUMOReal defaultValue); /** @brief Returns the value from the named column as a normalised string @@ -195,7 +195,7 @@ * @param[in] name Name of the column to extract the real from * @return The real stored under the named column, or if not found the one from "(IV)"+name, or if not found -1 */ - SUMOReal getWeightedFloat(const std::string& name) ; + SUMOReal getWeightedFloat(const std::string& name); /** @brief tries to get a bool which is possibly assigned to a certain modality @@ -207,7 +207,7 @@ * @param[in] name Name of the column to extract the bool from * @return The bool stored under the named column, or if not found the one from "(IV)"+name, or if not found false */ - bool getWeightedBool(const std::string& name) ; + bool getWeightedBool(const std::string& name); /** @brief Tries to get the node which name is stored in the given field @@ -297,7 +297,7 @@ * @param[in] node The node the consecutive edge must end at in order to be returned * @return The edge's continuation up to the given node, 0 if not found */ - NBEdge* getNamedEdgeContinuating(NBEdge* begin, NBNode* node) ; + NBEdge* getNamedEdgeContinuating(NBEdge* begin, NBNode* node); /** @brief Returns the edge that connects both nodes @@ -306,7 +306,7 @@ * @param[in] ToNode Name of the node the edge shall end at * @return The edge connecting both nodes, 0 if no such edge exists */ - NBEdge* getEdge(NBNode* FromNode, NBNode* ToNode) ; + NBEdge* getEdge(NBNode* FromNode, NBNode* ToNode); /** @brief Returns the opposite direction of the given edge @@ -319,7 +319,7 @@ * @param[in] node Name of the node the opposite edge's continuation must end at * @return The found opposite edge's continuation, 0 if not found */ - NBEdge* getReversedContinuating(NBEdge* edge, NBNode* node) ; + NBEdge* getReversedContinuating(NBEdge* edge, NBNode* node); /** @brief Builds a node for the given district and returns it @@ -334,7 +334,7 @@ * @param[in] isSource Information whether this node will be used as a source * @return The built node, zero if an error occured */ - NBNode* buildDistrictNode(const std::string& id, NBNode* dest, bool isSource) ; + NBNode* buildDistrictNode(const std::string& id, NBNode* dest, bool isSource); /** @brief Returns whether both nodes are a valid combination of from/to-nodes @@ -345,7 +345,7 @@ * @param[in] from The to-node * @return Whether the nodes may be used */ - bool checkNodes(NBNode* from, NBNode* to) ; + bool checkNodes(NBNode* from, NBNode* to); private: @@ -455,7 +455,7 @@ * @param[in] name db name to assign the parser to * @param[in] function The function to use for parsing the named db */ - void addParser(const std::string& name, ParsingFunction function) ; + void addParser(const std::string& name, ParsingFunction function); private: @@ -502,16 +502,16 @@ /// @brief A map of point ids to positions - std::map myPoints; + std::map myPoints; /// @brief A map of edge (not road, but "edge" in this case) ids to from/to-points - std::map > myEdges; + std::map > myEdges; /// @brief A map from district shape definition name to the district - std::map myShapeDistrictMap; + std::map myShapeDistrictMap; /// @brief A map from area parts to area ids - std::map > mySubPartsAreas; + std::map > mySubPartsAreas; /// @brief A temporary storage for district shapes as they are filled incrementally std::map myDistrictShapes; diff -Nru sumo-0.15.0~dfsg/src/netimport/NILoader.cpp sumo-0.16.0~dfsg/src/netimport/NILoader.cpp --- sumo-0.15.0~dfsg/src/netimport/NILoader.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NILoader.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NILoader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NILoader.cpp 13109 2012-12-02 14:49:47Z behrisch $ /// // Perfoms network import /****************************************************************************/ @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -64,7 +65,7 @@ #include #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #endif @@ -94,7 +95,7 @@ new NIXMLTypesHandler(myNetBuilder.getTypeCont()); loadXMLType(handler, oc.getStringVector("type-files"), "types"); // try to load height data so it is ready for use by other importers -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL HeightMapper::loadIfSet(oc); #endif // try to load using different methods @@ -161,10 +162,9 @@ void -NILoader::loadXMLType(SUMOSAXHandler* handler, const std::vector &files, +NILoader::loadXMLType(SUMOSAXHandler* handler, const std::vector& files, const std::string& type) { // build parser - SAX2XMLReader* parser = XMLSubSys::getSAXReader(*handler); std::string exceptMsg = ""; // start the parsing try { @@ -174,20 +174,18 @@ exceptMsg = "Process Error"; continue; } - handler->setFileName(*file); PROGRESS_BEGIN_MESSAGE("Parsing " + type + " from '" + *file + "'"); - parser->parse(file->c_str()); + XMLSubSys::runParser(*handler, *file); PROGRESS_DONE_MESSAGE(); } - } catch (const XMLException& toCatch) { - exceptMsg = TplConvert::_2str(toCatch.getMessage()) + } catch (const XERCES_CPP_NAMESPACE::XMLException& toCatch) { + exceptMsg = TplConvert::_2str(toCatch.getMessage()) + "\n The " + type + " could not be loaded from '" + handler->getFileName() + "'."; } catch (const ProcessError& toCatch) { exceptMsg = std::string(toCatch.what()) + "\n The " + type + " could not be loaded from '" + handler->getFileName() + "'."; } catch (...) { exceptMsg = "The " + type + " could not be loaded from '" + handler->getFileName() + "'."; } - delete parser; delete handler; if (exceptMsg != "") { throw ProcessError(exceptMsg); @@ -199,7 +197,7 @@ NILoader::transformCoordinates(Position& from, bool includeInBoundary, GeoConvHelper* from_srs) { Position orig(from); bool ok = GeoConvHelper::getProcessing().x2cartesian(from, includeInBoundary); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (ok) { const HeightMapper& hm = HeightMapper::get(); if (hm.ready()) { @@ -210,6 +208,8 @@ from = Position(from.x(), from.y(), z); } } +#else + UNUSED_PARAMETER(from_srs); #endif return ok; } diff -Nru sumo-0.15.0~dfsg/src/netimport/NILoader.h sumo-0.16.0~dfsg/src/netimport/NILoader.h --- sumo-0.15.0~dfsg/src/netimport/NILoader.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NILoader.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NILoader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NILoader.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Perfoms network import /****************************************************************************/ @@ -62,11 +62,11 @@ /** @brief Constructor * @param[in] nb The network builder to fill with loaded data */ - NILoader(NBNetBuilder& nb) ; + NILoader(NBNetBuilder& nb); /// @brief Destructor - ~NILoader() ; + ~NILoader(); /** loads data from the files specified in the given option container */ @@ -91,7 +91,7 @@ /** loads data from the list of xml-files of certain type */ void loadXMLType(SUMOSAXHandler* handler, - const std::vector &files, const std::string& type); + const std::vector& files, const std::string& type); private: /// @brief The network builder to fill with loaded data diff -Nru sumo-0.15.0~dfsg/src/netimport/NINavTeqHelper.cpp sumo-0.16.0~dfsg/src/netimport/NINavTeqHelper.cpp --- sumo-0.15.0~dfsg/src/netimport/NINavTeqHelper.cpp 2012-03-08 00:03:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NINavTeqHelper.cpp 2012-09-25 22:01:33.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Jul 2006 -/// @version $Id: NINavTeqHelper.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NINavTeqHelper.cpp 12727 2012-09-17 13:43:45Z namdre $ /// // Some parser methods shared around several formats containing NavTeq-Nets /****************************************************************************/ @@ -48,7 +48,7 @@ SUMOReal NINavTeqHelper::getSpeed(const std::string& id, const std::string& speedClassS) { try { - int speedClass = TplConvert::_2int(speedClassS.c_str()); + int speedClass = TplConvert::_2int(speedClassS.c_str()); switch (speedClass) { case -1: return (SUMOReal) 1.0 / (SUMOReal) 3.6; @@ -80,7 +80,7 @@ unsigned int NINavTeqHelper::getLaneNumber(const std::string& id, const std::string& laneNoS, SUMOReal speed) { try { - int nolanes = TplConvert::_2int(laneNoS.c_str()); + int nolanes = TplConvert::_2int(laneNoS.c_str()); if (nolanes < 0) { return 1; } else if (nolanes / 10 > 0) { @@ -130,10 +130,9 @@ if (classS[3] == '1') { e.allowVehicleClass(-1, SVC_PUBLIC_EMERGENCY); } - // Taxi -- becomes SVC_PASSENGER|SVC_TAXI + // Taxi -- becomes SVC_TAXI if (classS[4] == '1') { e.allowVehicleClass(-1, SVC_TAXI); - e.allowVehicleClass(-1, SVC_PASSENGER); } // Public Bus -- becomes SVC_BUS|SVC_PUBLIC_TRANSPORT if (classS[5] == '1') { diff -Nru sumo-0.15.0~dfsg/src/netimport/NINavTeqHelper.h sumo-0.16.0~dfsg/src/netimport/NINavTeqHelper.h --- sumo-0.15.0~dfsg/src/netimport/NINavTeqHelper.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NINavTeqHelper.h 2012-09-25 22:01:33.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jul 2006 -/// @version $Id: NINavTeqHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NINavTeqHelper.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Some parser methods shared around several formats containing NavTeq-Nets /****************************************************************************/ @@ -69,7 +69,7 @@ * @exception ProcessError If the given speed class definition is not a number or if it is not known */ static SUMOReal getSpeed(const std::string& id, - const std::string& speedClassS) ; + const std::string& speedClassS); /** @brief Returns the lane number evaluating the given Navteq-description @@ -81,7 +81,7 @@ * @exception ProcessError If the given lane number definition is not a number or if it is not known */ static unsigned int getLaneNumber(const std::string& id, - const std::string& laneNoS, SUMOReal speed) ; + const std::string& laneNoS, SUMOReal speed); /** @brief Adds vehicle classes parsing the given list of allowed vehicles diff -Nru sumo-0.15.0~dfsg/src/netimport/NIVisumTL.cpp sumo-0.16.0~dfsg/src/netimport/NIVisumTL.cpp --- sumo-0.15.0~dfsg/src/netimport/NIVisumTL.cpp 2012-03-14 00:02:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIVisumTL.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NIVisumTL.cpp /// @author Daniel Krajzewicz /// @date Thr, 08 May 2003 -/// @version $Id: NIVisumTL.cpp 12083 2012-03-13 12:55:30Z dkrajzew $ +/// @version $Id: NIVisumTL.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Intermediate class for storing visum traffic lights during their import /****************************************************************************/ @@ -46,10 +46,10 @@ // =========================================================================== // method definitions // =========================================================================== -NIVisumTL::NIVisumTL(const std::string& name, SUMOTime cycleTime, +NIVisumTL::NIVisumTL(const std::string& name, SUMOTime cycleTime, SUMOTime offset, SUMOTime intermediateTime, bool phaseDefined) - : myName(name), myCycleTime(cycleTime), myIntermediateTime(intermediateTime), - myPhaseDefined(phaseDefined) + : myName(name), myCycleTime(cycleTime), myOffset(offset), + myIntermediateTime(intermediateTime), myPhaseDefined(phaseDefined) {} @@ -63,20 +63,20 @@ } -void -NIVisumTL::addSignalGroup(const std::string &name, SUMOTime startTime, SUMOTime endTime) { - mySignalGroups[name] = new NIVisumTL::SignalGroup(name, startTime, endTime); +void +NIVisumTL::addSignalGroup(const std::string& name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime) { + mySignalGroups[name] = new NIVisumTL::SignalGroup(name, startTime, endTime, yellowTime); } -void -NIVisumTL::addPhase(const std::string &name, SUMOTime startTime, SUMOTime endTime) { - myPhases[name] = new NIVisumTL::Phase(startTime, endTime); +void +NIVisumTL::addPhase(const std::string& name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime) { + myPhases[name] = new NIVisumTL::Phase(startTime, endTime, yellowTime); } -NIVisumTL::SignalGroup& -NIVisumTL::getSignalGroup(const std::string &name) { +NIVisumTL::SignalGroup& +NIVisumTL::getSignalGroup(const std::string& name) { return *mySignalGroups.find(name)->second; } @@ -85,7 +85,7 @@ NIVisumTL::build(NBTrafficLightLogicCont& tlc) { for (std::vector::iterator ni = myNodes.begin(); ni != myNodes.end(); ni++) { NBNode* node = (*ni); - NBLoadedTLDef* def = new NBLoadedTLDef(node->getID(), node); + NBLoadedTLDef* def = new NBLoadedTLDef(node->getID(), node, myOffset); tlc.insert(def); def->setCycleDuration((unsigned int) myCycleTime); // signalgroups @@ -94,18 +94,22 @@ NIVisumTL::SignalGroup& SG = *(*gi).second; def->addSignalGroup(groupName); def->addToSignalGroup(groupName, SG.connections()); - def->setSignalYellowTimes(groupName, myIntermediateTime, myIntermediateTime); // phases + SUMOTime yellowTime = -1; if (myPhaseDefined) { for (std::map::iterator pi = SG.phases().begin(); pi != SG.phases().end(); pi++) { NIVisumTL::Phase& PH = *(*pi).second; def->addSignalGroupPhaseBegin(groupName, PH.getStartTime(), NBTrafficLightDefinition::TLCOLOR_GREEN); def->addSignalGroupPhaseBegin(groupName, PH.getEndTime(), NBTrafficLightDefinition::TLCOLOR_RED); + yellowTime = MAX2(PH.getYellowTime(), yellowTime); }; } else { def->addSignalGroupPhaseBegin(groupName, SG.getStartTime(), NBTrafficLightDefinition::TLCOLOR_GREEN); def->addSignalGroupPhaseBegin(groupName, SG.getEndTime(), NBTrafficLightDefinition::TLCOLOR_RED); + yellowTime = MAX2(SG.getYellowTime(), yellowTime); } + // yellowTime can be -1 if not given in the input; it will be "patched" later + def->setSignalYellowTimes(groupName, myIntermediateTime, yellowTime); } } } diff -Nru sumo-0.15.0~dfsg/src/netimport/NIVisumTL.h sumo-0.16.0~dfsg/src/netimport/NIVisumTL.h --- sumo-0.15.0~dfsg/src/netimport/NIVisumTL.h 2012-03-14 00:02:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIVisumTL.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NIVisumTL.h /// @author Daniel Krajzewicz /// @date Wed, 07 May 2003 -/// @version $Id: NIVisumTL.h 12083 2012-03-13 12:55:30Z dkrajzew $ +/// @version $Id: NIVisumTL.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Intermediate class for storing visum traffic lights during their import /****************************************************************************/ @@ -55,7 +55,8 @@ class TimePeriod { public: /// @brief Constructor - TimePeriod(SUMOTime startTime, SUMOTime endTime) : myStartTime(startTime), myEndTime(endTime) {} + TimePeriod(SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime) + : myStartTime(startTime), myEndTime(endTime), myYellowTime(yellowTime) {} /// @brief Destructor ~TimePeriod() {} @@ -70,11 +71,18 @@ return myEndTime; } + /// @brief Returns the stored yellow time + SUMOTime getYellowTime() { + return myYellowTime; + } + private: /// @brief Start time SUMOTime myStartTime; /// @brief End time SUMOTime myEndTime; + /// @brief Yellow time + SUMOTime myYellowTime; }; @@ -85,7 +93,7 @@ class Phase : public TimePeriod { public: /// @brief Constructor - Phase(SUMOTime startTime, SUMOTime endTime) : NIVisumTL::TimePeriod(startTime, endTime) {} + Phase(SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime) : NIVisumTL::TimePeriod(startTime, endTime, yellowTime) {} /// @brief Destructor ~Phase() {} @@ -100,19 +108,19 @@ class SignalGroup : public TimePeriod { public: /// @brief constructor - SignalGroup(const std::string& name, SUMOTime startTime, SUMOTime endTime) - : NIVisumTL::TimePeriod(startTime, endTime), myName(name) {} - + SignalGroup(const std::string& name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime) + : NIVisumTL::TimePeriod(startTime, endTime, yellowTime), myName(name) {} + /// @brief destructor ~SignalGroup() {} /// @brief Returns the connections vector - NBConnectionVector &connections() { + NBConnectionVector& connections() { return myConnections; } /// @brief Returns the phases map - std::map &phases() { + std::map& phases() { return myPhases; } @@ -131,25 +139,26 @@ /** @brief Constructor * @param[in] name The name of the TLS * @param[in] cycleTime The cycle time of the TLS + * @param[in] offset Seconds to skip * @param[in] intermediateTime The name of the TLS * @param[in] phaseDefined Whether phases are defined */ - NIVisumTL(const std::string& name, SUMOTime cycleTime, SUMOTime intermediateTime, + NIVisumTL(const std::string& name, SUMOTime cycleTime, SUMOTime offset, SUMOTime intermediateTime, bool phaseDefined); /// @brief Destructor ~NIVisumTL(); /// @brief Adds a node to control - void addNode(NBNode *n) { + void addNode(NBNode* n) { myNodes.push_back(n); } /// @brief Adds a signal group - void addSignalGroup(const std::string &name, SUMOTime startTime, SUMOTime endTime); + void addSignalGroup(const std::string& name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime); /// @brief Adds a phase - void addPhase(const std::string &name, SUMOTime startTime, SUMOTime endTime); + void addPhase(const std::string& name, SUMOTime startTime, SUMOTime endTime, SUMOTime yellowTime); /// @brief Returns the map of named phases std::map& getPhases() { @@ -157,33 +166,37 @@ } /// @brief Returns the named signal group - SignalGroup& getSignalGroup(const std::string &name); + SignalGroup& getSignalGroup(const std::string& name); /// @brief build the traffic light and add it to the given container void build(NBTrafficLightLogicCont& tlc); private: - // name of traffic light + /// @brief The name of traffic light std::string myName; - // cycle time of traffic light in seconds + /// @brief The cycle time of traffic light in seconds SUMOTime myCycleTime; - // length of yellow and red-yellow phases + /// @brief The offset in the plan + SUMOTime myOffset; + + /// @brief The all-red time (unused here) SUMOTime myIntermediateTime; - // toogles the usage either of phases or of timeperiods in signalgroups + /// @brief Toogles the usage either of phases or of time periods in signal groups bool myPhaseDefined; - // vector of nodes belonging to this traffic light + /// @brief Vector of nodes belonging to this traffic light std::vector myNodes; - // vector of used phases if phasedefined + /// @brief Map of used phases if phases defined std::map myPhases; - // vector of used Signalgroups + /// @brief Map of used signal groups std::map mySignalGroups; + }; diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLConnectionsHandler.cpp sumo-0.16.0~dfsg/src/netimport/NIXMLConnectionsHandler.cpp --- sumo-0.15.0~dfsg/src/netimport/NIXMLConnectionsHandler.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLConnectionsHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Thu, 17 Oct 2002 -/// @version $Id: NIXMLConnectionsHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLConnectionsHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for edge connections stored in XML /****************************************************************************/ @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -237,8 +236,11 @@ } } while (toNext); if (nFrom == 0 || !nFrom->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, false, mayDefinitelyPass)) { - WRITE_WARNING("Could not set loaded connection from '" + from->getLaneID(fromLane) + - "' to '" + to->getLaneID(toLane) + "'."); + if (OptionsCont::getOptions().getBool("show-errors.connections-first-try")) { + WRITE_WARNING("Could not set loaded connection from '" + from->getLaneID(fromLane) + "' to '" + to->getLaneID(toLane) + "'."); + } + // set as to be re-applied after network processing + myEdgeCont.addPostProcessConnection(nFrom->getID(), fromLane, to->getID(), toLane, mayDefinitelyPass); } else { from = nFrom; } @@ -284,8 +286,8 @@ return false; // There was an error. } - *fromLane = TplConvertSec::_2intSec(st.next().c_str(), -1); - *toLane = TplConvertSec::_2intSec(st.next().c_str(), -1); + *fromLane = TplConvert::_2intSec(st.next().c_str(), -1); + *toLane = TplConvert::_2intSec(st.next().c_str(), -1); return true; // We succeeded. } diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLConnectionsHandler.h sumo-0.16.0~dfsg/src/netimport/NIXMLConnectionsHandler.h --- sumo-0.15.0~dfsg/src/netimport/NIXMLConnectionsHandler.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLConnectionsHandler.h 2012-09-25 22:01:33.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLConnectionsHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLConnectionsHandler.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Importer for edge connections stored in XML /****************************************************************************/ @@ -59,11 +59,11 @@ /** @brief Constructor * @param[in] ec The edge container which includes the edges to change connections of */ - NIXMLConnectionsHandler(NBEdgeCont& ec) ; + NIXMLConnectionsHandler(NBEdgeCont& ec); /// @brief Destructor - ~NIXMLConnectionsHandler() ; + ~NIXMLConnectionsHandler(); protected: @@ -78,7 +78,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} private: @@ -90,7 +90,7 @@ * @param[in] def The definition of the connection * @return The parsed connection */ - NBConnection parseConnection(const std::string& defRole, const std::string& def) ; + NBConnection parseConnection(const std::string& defRole, const std::string& def); /** @brief Parses a connection when it describes a lane-2-lane relationship @@ -98,7 +98,7 @@ * @param[in] from The edge at which the connection starts (the on incoming into a node) * @param[in] to The edge at which the connection ends (the on outgoing from a node) */ - void parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge* from, NBEdge* to) ; + void parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge* from, NBEdge* to); /** @brief Parses information about lane-2-lane connection when it describes a lane-2-lane relationship diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLEdgesHandler.cpp sumo-0.16.0~dfsg/src/netimport/NIXMLEdgesHandler.cpp --- sumo-0.15.0~dfsg/src/netimport/NIXMLEdgesHandler.cpp 2012-03-08 00:03:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLEdgesHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Walter Bamberger /// @author Laura Bieker /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLEdgesHandler.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NIXMLEdgesHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for network edges stored in XML /****************************************************************************/ @@ -76,10 +76,9 @@ myOptions(options), myNodeCont(nc), myEdgeCont(ec), myTypeCont(tc), myDistrictCont(dc), myCurrentEdge(0), myHaveReportedAboutOverwriting(false), - myHaveWarnedAboutDeprecatedSpreadType(false), - myHaveWarnedAboutDeprecatedFromTo(false), - myHaveWarnedAboutDeprecatedNoLanes(false), - myHaveWarnedAboutDeprecatedLaneId(false) {} + myHaveWarnedAboutDeprecatedLaneId(false), + myKeepEdgeShape(!options.getBool("plain.extend-edge-shape")) +{} NIXMLEdgesHandler::~NIXMLEdgesHandler() {} @@ -133,6 +132,7 @@ myLanesSpread = LANESPREAD_RIGHT; myLength = NBEdge::UNSPECIFIED_LOADED_LENGTH; myCurrentStreetName = ""; + myReinitKeepEdgeShape = false; // check whether a type's values shall be used if (attrs.hasAttribute(SUMO_ATTR_TYPE)) { myCurrentType = attrs.getStringReporting(SUMO_ATTR_TYPE, myCurrentID.c_str(), ok); @@ -168,6 +168,7 @@ myPermissions = myCurrentEdge->getPermissions(); if (!myCurrentEdge->hasDefaultGeometry()) { myShape = myCurrentEdge->getGeometry(); + myReinitKeepEdgeShape = true; } myCurrentWidth = myCurrentEdge->getWidth(); myCurrentOffset = myCurrentEdge->getOffset(); @@ -186,13 +187,6 @@ myCurrentSpeed = myCurrentSpeed / (SUMOReal) 3.6; } // try to get the number of lanes - if (attrs.hasAttribute(SUMO_ATTR_NOLANES__DEPRECATED)) { - myCurrentLaneNo = attrs.getIntReporting(SUMO_ATTR_NOLANES__DEPRECATED, myCurrentID.c_str(), ok); - if (!myHaveWarnedAboutDeprecatedNoLanes) { - myHaveWarnedAboutDeprecatedNoLanes = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_NOLANES__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_NUMLANES) + "' instead."); - } - } if (attrs.hasAttribute(SUMO_ATTR_NUMLANES)) { myCurrentLaneNo = attrs.getIntReporting(SUMO_ATTR_NUMLANES, myCurrentID.c_str(), ok); } @@ -237,9 +231,9 @@ if (myCurrentEdge != 0) { myCurrentEdge->reinit(myFromNode, myToNode, myCurrentType, myCurrentSpeed, myCurrentLaneNo, myCurrentPriority, myShape, - myCurrentWidth, myCurrentOffset, + myCurrentWidth, myCurrentOffset, myCurrentStreetName, myLanesSpread, - OptionsCont::getOptions().getBool("plain.keep-edge-shape")); + myReinitKeepEdgeShape); } else { // the edge must be allocated in dependence to whether a shape is given if (myShape.size() == 0) { @@ -250,7 +244,7 @@ myCurrentEdge = new NBEdge(myCurrentID, myFromNode, myToNode, myCurrentType, myCurrentSpeed, myCurrentLaneNo, myCurrentPriority, myCurrentWidth, myCurrentOffset, myShape, myCurrentStreetName, myLanesSpread, - OptionsCont::getOptions().getBool("plain.keep-edge-shape")); + myKeepEdgeShape); } } myCurrentEdge->setLoadedLength(myLength); @@ -262,7 +256,7 @@ NIXMLEdgesHandler::addLane(const SUMOSAXAttributes& attrs) { if (myCurrentEdge == 0) { if (!OptionsCont::getOptions().isInStringVector("remove-edges.explicit", myCurrentID)) { - WRITE_ERROR("Additional lane information could not been set - the edge with id '" + myCurrentID + "' is not known."); + WRITE_ERROR("Additional lane information could not be set - the edge with id '" + myCurrentID + "' is not known."); } return; } @@ -328,7 +322,7 @@ e.nameid = (int)e.pos; if (myCurrentEdge == 0) { if (!OptionsCont::getOptions().isInStringVector("remove-edges.explicit", myCurrentID)) { - WRITE_ERROR("Additional lane information could not been set - the edge with id '" + myCurrentID + "' is not known."); + WRITE_ERROR("Additional lane information could not be set - the edge with id '" + myCurrentID + "' is not known."); } return; } @@ -339,7 +333,7 @@ SUMOSAXAttributes::parseStringVector(attrs.getOptStringReporting(SUMO_ATTR_LANES, 0, ok, ""), lanes); for (std::vector::iterator i = lanes.begin(); i != lanes.end(); ++i) { try { - int lane = TplConvert::_2int((*i).c_str()); + int lane = TplConvert::_2int((*i).c_str()); e.lanes.push_back(lane); } catch (NumberFormatException&) { WRITE_ERROR("Error on parsing a split (edge '" + myCurrentID + "')."); @@ -366,53 +360,29 @@ std::string endNodeID = myIsUpdate ? myCurrentEdge->getToNode()->getID() : ""; std::string oldBegID = begNodeID; std::string oldEndID = endNodeID; - if (attrs.hasAttribute(SUMO_ATTR_FROMNODE)) { - begNodeID = attrs.getStringReporting(SUMO_ATTR_FROMNODE, 0, ok); - if (!myHaveWarnedAboutDeprecatedFromTo) { - WRITE_WARNING("'" + toString(SUMO_ATTR_FROMNODE) + "' is deprecated; please use '" + toString(SUMO_ATTR_FROM) + "'."); - myHaveWarnedAboutDeprecatedFromTo = true; - } - } - if (attrs.hasAttribute(SUMO_ATTR_TONODE)) { - endNodeID = attrs.getStringReporting(SUMO_ATTR_TONODE, 0, ok); - if (!myHaveWarnedAboutDeprecatedFromTo) { - WRITE_WARNING("'" + toString(SUMO_ATTR_TONODE) + "' is deprecated; please use '" + toString(SUMO_ATTR_TO) + "'."); - myHaveWarnedAboutDeprecatedFromTo = true; - } + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + begNodeID = attrs.getStringReporting(SUMO_ATTR_FROM, 0, ok); + } else if (!myIsUpdate) { + WRITE_ERROR("The from-node is not given for edge '" + myCurrentID + "'."); + ok = false; + } + if (attrs.hasAttribute(SUMO_ATTR_TO)) { + endNodeID = attrs.getStringReporting(SUMO_ATTR_TO, 0, ok); + } else if (!myIsUpdate) { + WRITE_ERROR("The to-node is not given for edge '" + myCurrentID + "'."); + ok = false; } - begNodeID = attrs.hasAttribute(SUMO_ATTR_FROM) ? attrs.getStringReporting(SUMO_ATTR_FROM, 0, ok) : begNodeID; - endNodeID = attrs.hasAttribute(SUMO_ATTR_TO) ? attrs.getStringReporting(SUMO_ATTR_TO, 0, ok) : endNodeID; if (!ok) { return false; } - // or their positions !!! deprecated - SUMOReal begNodeXPos = tryGetPosition(attrs, SUMO_ATTR_XFROM, "XFrom"); - SUMOReal begNodeYPos = tryGetPosition(attrs, SUMO_ATTR_YFROM, "YFrom"); - SUMOReal endNodeXPos = tryGetPosition(attrs, SUMO_ATTR_XTO, "XTo"); - SUMOReal endNodeYPos = tryGetPosition(attrs, SUMO_ATTR_YTO, "YTo"); - if (begNodeXPos != SUMOXML_INVALID_POSITION && begNodeYPos != SUMOXML_INVALID_POSITION) { - Position pos(begNodeXPos, begNodeYPos); - NILoader::transformCoordinates(pos); - begNodeXPos = pos.x(); - begNodeYPos = pos.y(); - if (!myHaveWarnedAboutDeprecatedFromTo) { - WRITE_WARNING("'" + toString(SUMO_ATTR_XFROM) + "' and '" + toString(SUMO_ATTR_YFROM) + "' are deprecated; please define nodes separately."); - myHaveWarnedAboutDeprecatedFromTo = true; - } - } - if (endNodeXPos != SUMOXML_INVALID_POSITION && endNodeYPos != SUMOXML_INVALID_POSITION) { - Position pos(endNodeXPos, endNodeYPos); - NILoader::transformCoordinates(pos); - endNodeXPos = pos.x(); - endNodeYPos = pos.y(); - if (!myHaveWarnedAboutDeprecatedFromTo) { - WRITE_WARNING("'" + toString(SUMO_ATTR_XTO) + "' and '" + toString(SUMO_ATTR_YTO) + "' are deprecated; please define nodes separately."); - myHaveWarnedAboutDeprecatedFromTo = true; - } - } - // check the obtained values for nodes - myFromNode = insertNodeChecking(Position(begNodeXPos, begNodeYPos), begNodeID, "from"); - myToNode = insertNodeChecking(Position(endNodeXPos, endNodeYPos), endNodeID, "to"); + myFromNode = myNodeCont.retrieve(begNodeID); + myToNode = myNodeCont.retrieve(endNodeID); + if (myFromNode == 0) { + WRITE_ERROR("Edge's '" + myCurrentID + "' from-node '" + begNodeID + "' is not known."); + } + if (myToNode == 0) { + WRITE_ERROR("Edge's '" + myCurrentID + "' to-node '" + endNodeID + "' is not known."); + } if (myFromNode != 0 && myToNode != 0) { if (myIsUpdate && (myFromNode->getID() != oldBegID || myToNode->getID() != oldEndID)) { myShape = PositionVector(); @@ -422,51 +392,6 @@ } -SUMOReal -NIXMLEdgesHandler::tryGetPosition(const SUMOSAXAttributes& attrs, SumoXMLAttr attrID, - const std::string& attrName) { - UNUSED_PARAMETER(attrName); - bool ok = true; - return attrs.getOptSUMORealReporting(attrID, myCurrentID.c_str(), ok, SUMOXML_INVALID_POSITION); -} - - -NBNode* -NIXMLEdgesHandler::insertNodeChecking(const Position& pos, - const std::string& name, const std::string& dir) { - NBNode* ret = 0; - if (name == "" && (pos.x() == SUMOXML_INVALID_POSITION || pos.y() == SUMOXML_INVALID_POSITION)) { - WRITE_ERROR("Neither the name nor the position of the " + dir + "-node is given for edge '" + myCurrentID + "'."); - return ret; - } - if (name != "") { - if (pos.x() != SUMOXML_INVALID_POSITION && pos.y() != SUMOXML_INVALID_POSITION) { - // the node is named and it has a position given - if (!myNodeCont.insert(name, pos)) { - WRITE_ERROR("Position of " + dir + "-node '" + name + "' mismatches previous positions."); - return 0; - } - } - // the node is given by its name - ret = myNodeCont.retrieve(name); - if (ret == 0) { - WRITE_ERROR("Edge's '" + myCurrentID + "' " + dir + "-node '" + name + "' is not known."); - } - } else { - ret = myNodeCont.retrieve(pos); - if (ret == 0) { - ret = new NBNode(myNodeCont.getFreeID(), pos); - if (!myNodeCont.insert(ret)) { - WRITE_ERROR("Could not insert " + dir + "-node at position " + toString(pos) + "."); - delete ret; - return 0; - } - } - } - return ret; -} - - PositionVector NIXMLEdgesHandler::tryGetShape(const SUMOSAXAttributes& attrs) { if (!attrs.hasAttribute(SUMO_ATTR_SHAPE)) { @@ -474,14 +399,15 @@ } // try to build shape bool ok = true; - std::string shpdef = attrs.getOptStringReporting(SUMO_ATTR_SHAPE, 0, ok, ""); - if (shpdef == "") { + if (!attrs.hasAttribute(SUMO_ATTR_SHAPE)) { + myReinitKeepEdgeShape = false; return PositionVector(); } - PositionVector shape = GeomConvHelper::parseShapeReporting(shpdef, attrs.getObjectType(), 0, ok, true); + PositionVector shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, 0, ok, true); if (!NILoader::transformCoordinates(shape)) { WRITE_ERROR("Unable to project coordinates for edge '" + myCurrentID + "'."); } + myReinitKeepEdgeShape = myKeepEdgeShape; return shape; } @@ -491,15 +417,7 @@ bool ok = true; LaneSpreadFunction result = myLanesSpread; std::string lsfS = toString(result); - if (attrs.hasAttribute(SUMO_ATTR_SPREADFUNC__DEPRECATED)) { - lsfS = attrs.getStringReporting(SUMO_ATTR_SPREADFUNC__DEPRECATED, myCurrentID.c_str(), ok); - if (!myHaveWarnedAboutDeprecatedSpreadType) { - WRITE_WARNING("'" + toString(SUMO_ATTR_SPREADFUNC__DEPRECATED) + " is deprecated; please use '" + toString(SUMO_ATTR_SPREADTYPE) + "'."); - myHaveWarnedAboutDeprecatedSpreadType = true; - } - } else { - lsfS = attrs.getOptStringReporting(SUMO_ATTR_SPREADTYPE, myCurrentID.c_str(), ok, lsfS); - } + lsfS = attrs.getOptStringReporting(SUMO_ATTR_SPREADTYPE, myCurrentID.c_str(), ok, lsfS); if (SUMOXMLDefinitions::LaneSpreadFunctions.hasString(lsfS)) { result = SUMOXMLDefinitions::LaneSpreadFunctions.get(lsfS); } else { @@ -545,7 +463,6 @@ if (mySplits.size() != 0) { std::vector::iterator i; NBEdge* e = myCurrentEdge; - SUMOReal length = e->getLength(); sort(mySplits.begin(), mySplits.end(), split_sorter()); unsigned int noLanesMax = e->getNumLanes(); // compute the node positions and sort the lanes @@ -626,9 +543,21 @@ } for (; i != mySplits.end(); ++i) { unsigned int maxLeft = (*i).lanes.back(); + SUMOReal offset = 0; if (maxLeft < noLanesMax) { + if (e->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + offset = SUMO_const_laneWidthAndOffset * (noLanesMax - 1 - maxLeft); + } else { + offset = SUMO_const_halfLaneAndOffset * (noLanesMax - 1 - maxLeft); + } + } + unsigned int maxRight = (*i).lanes.front(); + if (maxRight > 0 && e->getLaneSpreadFunction() == LANESPREAD_CENTER) { + offset -= SUMO_const_halfLaneAndOffset * maxRight; + } + if (offset != 0) { PositionVector g = e->getGeometry(); - g.move2side(SUMO_const_laneWidthAndOffset * (noLanesMax - 1 - maxLeft)); + g.move2side(offset); e->setGeometry(g); } if (e->getToNode()->getOutgoingEdges().size() != 0) { diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLEdgesHandler.h sumo-0.16.0~dfsg/src/netimport/NIXMLEdgesHandler.h --- sumo-0.15.0~dfsg/src/netimport/NIXMLEdgesHandler.h 2012-03-08 00:03:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLEdgesHandler.h 2012-11-06 00:02:37.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLEdgesHandler.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NIXMLEdgesHandler.h 12936 2012-11-05 09:51:41Z namdre $ /// // Importer for network edges stored in XML /****************************************************************************/ @@ -78,11 +78,11 @@ * @param[in] options The options to use while building edges */ NIXMLEdgesHandler(NBNodeCont& nc, NBEdgeCont& ec, - NBTypeCont& tc, NBDistrictCont& dc, OptionsCont& options) ; + NBTypeCont& tc, NBDistrictCont& dc, OptionsCont& options); /// @brief Destructor - ~NIXMLEdgesHandler() ; + ~NIXMLEdgesHandler(); protected: @@ -97,7 +97,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -106,7 +106,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} @@ -118,7 +118,7 @@ * @param[in] attrs The attributes to read the shape from * @return The edge's shape */ - PositionVector tryGetShape(const SUMOSAXAttributes& attrs) ; + PositionVector tryGetShape(const SUMOSAXAttributes& attrs); /** @brief Tries to parse the spread type @@ -133,17 +133,7 @@ * @param[in] attrs The SAX-attributes to parse the nodes from * @return Whether valid nodes exist */ - bool setNodes(const SUMOSAXAttributes& attrs) ; - - - /** @brief tries to parse one of the node's positions - Which position has to be parsed is defined by the given call variables */ - SUMOReal tryGetPosition(const SUMOSAXAttributes& attrs, SumoXMLAttr attrID, - const std::string& attrName); - - - NBNode* insertNodeChecking(const Position& pos, - const std::string& name, const std::string& dir); + bool setNodes(const SUMOSAXAttributes& attrs); private: @@ -193,15 +183,18 @@ /// @brief Information about lane permissions SVCPermissions myPermissions; + /// @brief Whether the edge shape shall be kept generally + bool myKeepEdgeShape; + + /// @brief Whether the edge shape shall be kept at reinitilization + bool myReinitKeepEdgeShape; + /// @} /// @brief Whether this edge definition is an update of a previously inserted edge bool myIsUpdate; - /// @brief The currently processed edge - NBEdge* myCurrentEdge; - /// @name Used instance containers (access to nodes, edges, types, etc.) /// @{ @@ -220,6 +213,9 @@ /// @} + /// @brief The currently processed edge + NBEdge* myCurrentEdge; + /** @struct Split * @brief A structure which describes changes of lane number along the road */ @@ -277,8 +273,7 @@ /// @brief Information whether at least one edge's attributes were overwritten bool myHaveReportedAboutOverwriting; - bool myHaveWarnedAboutDeprecatedSpreadType, myHaveWarnedAboutDeprecatedFromTo, - myHaveWarnedAboutDeprecatedNoLanes, myHaveWarnedAboutDeprecatedLaneId; + bool myHaveWarnedAboutDeprecatedLaneId; private: diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLNodesHandler.cpp sumo-0.16.0~dfsg/src/netimport/NIXMLNodesHandler.cpp --- sumo-0.15.0~dfsg/src/netimport/NIXMLNodesHandler.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLNodesHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLNodesHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLNodesHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for network nodes stored in XML /****************************************************************************/ @@ -62,12 +62,12 @@ // =========================================================================== NIXMLNodesHandler::NIXMLNodesHandler(NBNodeCont& nc, NBTrafficLightLogicCont& tlc, - OptionsCont& options) : + OptionsCont& options) : SUMOSAXHandler("xml-nodes - file"), myOptions(options), - myNodeCont(nc), + myNodeCont(nc), myTLLogicCont(tlc), - myLocation(0) + myLocation(0) {} @@ -241,7 +241,7 @@ } else { // we need to add a new defition tlID = tlID == "" ? myID : tlID; - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(tlID, currentNode); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(tlID, currentNode, 0); if (!myTLLogicCont.insert(tlDef)) { // actually, nothing should fail here delete tlDef; @@ -251,11 +251,7 @@ } // process inner edges which shall be controlled std::vector controlledInner; - if (attrs.hasAttribute(SUMO_ATTR_CONTROLLED_INNER__DEPRECATED)) { - SUMOSAXAttributes::parseStringVector(attrs.getStringReporting(SUMO_ATTR_CONTROLLED_INNER__DEPRECATED, 0, ok), controlledInner); - } else { - SUMOSAXAttributes::parseStringVector(attrs.getOptStringReporting(SUMO_ATTR_CONTROLLED_INNER, 0, ok, ""), controlledInner); - } + SUMOSAXAttributes::parseStringVector(attrs.getOptStringReporting(SUMO_ATTR_CONTROLLED_INNER, 0, ok, ""), controlledInner); if (controlledInner.size() != 0) { for (std::set::iterator it = tlDefs.begin(); it != tlDefs.end(); it++) { (*it)->addControlledInnerEdges(controlledInner); diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLNodesHandler.h sumo-0.16.0~dfsg/src/netimport/NIXMLNodesHandler.h --- sumo-0.15.0~dfsg/src/netimport/NIXMLNodesHandler.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLNodesHandler.h 2012-09-25 22:01:33.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLNodesHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLNodesHandler.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Importer for network nodes stored in XML /****************************************************************************/ @@ -73,7 +73,7 @@ /// @brief Destructor - ~NIXMLNodesHandler() ; + ~NIXMLNodesHandler(); protected: @@ -91,7 +91,7 @@ * @todo ProcessErrors are thrown when parsing traffic lights!? */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.cpp sumo-0.16.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.cpp --- sumo-0.15.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NIXMLTrafficLightsHandler.h /// @author Jakob Erdmann /// @date 2011-10-05 -/// @version $Id: NIXMLTrafficLightsHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLTrafficLightsHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for traffic lights stored in XML /****************************************************************************/ @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -128,6 +127,7 @@ bool ok = true; std::string id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); std::string programID = attrs.getOptStringReporting(SUMO_ATTR_PROGRAMID, id.c_str(), ok, ""); + SUMOTime offset = attrs.hasAttribute(SUMO_ATTR_OFFSET) ? TIME2STEPS(attrs.getSUMORealReporting(SUMO_ATTR_OFFSET, id.c_str(), ok)) : 0; // there are two scenarios to consider // 1) the tll.xml is loaded to update traffic lights defined in a net.xml: @@ -140,7 +140,7 @@ NBOwnTLDef* newDef = dynamic_cast(myTLLCont.getDefinition( id, NBTrafficLightDefinition::DefaultProgramID)); assert(newDef != 0); - loadedDef = new NBLoadedSUMOTLDef(id, programID, 0); + loadedDef = new NBLoadedSUMOTLDef(id, programID, offset); std::vector nodes = newDef->getControlledNodes(); for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { (*it)->removeTrafficLight(newDef); @@ -151,14 +151,9 @@ std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, 0, ok, toString(TLTYPE_STATIC)); if (type != toString(TLTYPE_STATIC)) { - WRITE_WARNING("Traffic light '" + id + "' has unsupported type '" + type + "' and will be converted to '" + - toString(TLTYPE_STATIC) + "'"); + WRITE_WARNING("Traffic light '" + id + "' has unsupported type '" + type + "' and will be converted to '" + toString(TLTYPE_STATIC) + "'"); } } - if (attrs.hasAttribute(SUMO_ATTR_OFFSET)) { - SUMOTime offset = TIME2STEPS(attrs.getSUMORealReporting(SUMO_ATTR_OFFSET, id.c_str(), ok)); - loadedDef->getLogic()->setOffset(offset); - } if (ok) { myResetPhases = true; return loadedDef; @@ -183,7 +178,7 @@ return; } // retrieve connection - const std::vector &connections = from->getConnections(); + const std::vector& connections = from->getConnections(); std::vector::const_iterator con_it; con_it = find_if(connections.begin(), connections.end(), NBEdge::connections_finder(fromLane, to, toLane)); diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.h sumo-0.16.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.h --- sumo-0.15.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLTrafficLightsHandler.h 2012-09-25 22:01:33.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NIXMLTrafficLightsHandler.h /// @author Jakob Erdmann /// @date 2011-10-05 -/// @version $Id: NIXMLTrafficLightsHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLTrafficLightsHandler.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Importer for traffic lights stored in XML /****************************************************************************/ @@ -59,11 +59,11 @@ /** @brief Constructor * @param[in] ec The traffic light container into which to load logics */ - NIXMLTrafficLightsHandler(NBTrafficLightLogicCont& tlCont, NBEdgeCont& ec) ; + NIXMLTrafficLightsHandler(NBTrafficLightLogicCont& tlCont, NBEdgeCont& ec); /// @brief Destructor - ~NIXMLTrafficLightsHandler() ; + ~NIXMLTrafficLightsHandler(); protected: @@ -77,7 +77,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 @@ -86,7 +86,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLTypesHandler.cpp sumo-0.16.0~dfsg/src/netimport/NIXMLTypesHandler.cpp --- sumo-0.15.0~dfsg/src/netimport/NIXMLTypesHandler.cpp 2012-03-08 00:03:08.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLTypesHandler.cpp 2012-09-25 22:01:33.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLTypesHandler.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NIXMLTypesHandler.cpp 12599 2012-08-27 11:15:34Z dkrajzew $ /// // Importer for edge type information stored in XML /****************************************************************************/ @@ -56,7 +56,7 @@ // =========================================================================== NIXMLTypesHandler::NIXMLTypesHandler(NBTypeCont& tc) : SUMOSAXHandler("xml-types - file"), - myTypeCont(tc), myHaveWarnedAboutDeprecatedNoLanes(false) {} + myTypeCont(tc) {} NIXMLTypesHandler::~NIXMLTypesHandler() {} @@ -73,13 +73,6 @@ std::string id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); int priority = attrs.getOptIntReporting(SUMO_ATTR_PRIORITY, id.c_str(), ok, myTypeCont.getPriority("")); int noLanes = myTypeCont.getNumLanes(""); - if (attrs.hasAttribute(SUMO_ATTR_NOLANES__DEPRECATED)) { - noLanes = attrs.getIntReporting(SUMO_ATTR_NOLANES__DEPRECATED, id.c_str(), ok); - if (!myHaveWarnedAboutDeprecatedNoLanes) { - myHaveWarnedAboutDeprecatedNoLanes = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_NOLANES__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_NUMLANES) + "' instead."); - } - } noLanes = attrs.getOptIntReporting(SUMO_ATTR_NUMLANES, id.c_str(), ok, noLanes); SUMOReal speed = attrs.getOptSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok, (SUMOReal) myTypeCont.getSpeed("")); std::string allowS = attrs.getOptStringReporting(SUMO_ATTR_ALLOW, id.c_str(), ok, ""); diff -Nru sumo-0.15.0~dfsg/src/netimport/NIXMLTypesHandler.h sumo-0.16.0~dfsg/src/netimport/NIXMLTypesHandler.h --- sumo-0.15.0~dfsg/src/netimport/NIXMLTypesHandler.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/NIXMLTypesHandler.h 2012-09-25 22:01:33.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLTypesHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIXMLTypesHandler.h 12599 2012-08-27 11:15:34Z dkrajzew $ /// // Importer for edge type information stored in XML /****************************************************************************/ @@ -61,7 +61,7 @@ /// @brief Destructor - ~NIXMLTypesHandler() ; + ~NIXMLTypesHandler(); protected: @@ -80,7 +80,7 @@ * @note policy is to throw no exception in order to allow further processing */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} @@ -89,8 +89,6 @@ NBTypeCont& myTypeCont; - bool myHaveWarnedAboutDeprecatedNoLanes; - private: /** @brief invalid copy constructor */ NIXMLTypesHandler(const NIXMLTypesHandler& s); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/Makefile.in sumo-0.16.0~dfsg/src/netimport/vissim/Makefile.in --- sumo-0.15.0~dfsg/src/netimport/vissim/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -138,6 +138,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -168,6 +169,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -202,6 +204,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -235,7 +238,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/NIImporter_Vissim.cpp sumo-0.16.0~dfsg/src/netimport/vissim/NIImporter_Vissim.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/NIImporter_Vissim.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/NIImporter_Vissim.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_Vissim.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIImporter_Vissim.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // ------------------- /****************************************************************************/ @@ -172,7 +172,7 @@ std::string NIImporter_Vissim::VissimSingleTypeParser::readEndSecure(std::istream& from, - const std::vector &excl) { + const std::vector& excl) { std::vector myExcl; std::vector::const_iterator i; for (i = excl.begin(); i != excl.end(); i++) { @@ -240,7 +240,7 @@ return ret; } while (tmp != "DATAEND" && tmp != next) { - ret.push_back(TplConvert::_2int(tmp.c_str())); + ret.push_back(TplConvert::_2int(tmp.c_str())); tmp = readEndSecure(from); } return ret; @@ -259,7 +259,7 @@ while (tag != "bei") { tag = readEndSecure(from); if (tag != "bei") { - int lane = TplConvert::_2int(tag.c_str()); + int lane = TplConvert::_2int(tag.c_str()); lanes.push_back(lane - 1); } } @@ -468,20 +468,16 @@ NIVissimDistrictConnection::dict_BuildDistrictNodes( myNetBuilder.getDistrictCont(), myNetBuilder.getNodeCont()); NIVissimEdge::dict_propagateSpeeds(); - NIVissimEdge::dict_buildNBEdges(myNetBuilder.getDistrictCont(), - myNetBuilder.getNodeCont(), myNetBuilder.getEdgeCont(), - offset); + NIVissimEdge::dict_buildNBEdges(myNetBuilder.getDistrictCont(), myNetBuilder.getNodeCont(), myNetBuilder.getEdgeCont(), offset); if (OptionsCont::getOptions().getBool("vissim.report-unset-speeds")) { NIVissimEdge::reportUnsetSpeeds(); } - NIVissimDistrictConnection::dict_BuildDistricts(myNetBuilder.getDistrictCont(), - myNetBuilder.getEdgeCont(), myNetBuilder.getNodeCont()); + NIVissimDistrictConnection::dict_BuildDistricts(myNetBuilder.getDistrictCont(), myNetBuilder.getEdgeCont(), myNetBuilder.getNodeCont()); NIVissimConnection::dict_buildNBEdgeConnections(myNetBuilder.getEdgeCont()); - NIVissimNodeCluster::dict_addDisturbances(myNetBuilder.getDistrictCont(), - myNetBuilder.getNodeCont(), myNetBuilder.getEdgeCont()); - NIVissimTL::dict_SetSignals(myNetBuilder.getTLLogicCont(), - myNetBuilder.getEdgeCont()); - + NIVissimNodeCluster::dict_addDisturbances(myNetBuilder.getDistrictCont(), myNetBuilder.getNodeCont(), myNetBuilder.getEdgeCont()); + if (!OptionsCont::getOptions().getBool("tls.discard-loaded")) { + NIVissimTL::dict_SetSignals(myNetBuilder.getTLLogicCont(), myNetBuilder.getEdgeCont()); + } } diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/NIImporter_Vissim.h sumo-0.16.0~dfsg/src/netimport/vissim/NIImporter_Vissim.h --- sumo-0.15.0~dfsg/src/netimport/vissim/NIImporter_Vissim.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/NIImporter_Vissim.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_Vissim.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIImporter_Vissim.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Importer for networks stored in Vissim format /****************************************************************************/ @@ -104,7 +104,7 @@ const std::string& excl = ""); std::string readEndSecure(std::istream& from, - const std::vector &excl); + const std::vector& excl); /// overrides the optional label definition; returns the next tag as done by readEndSecure std::string overrideOptionalLabel(std::istream& from, @@ -116,7 +116,7 @@ /** @brief parses a listof vehicle types assigned to the current data field One should remeber, that -1 means "all" vehicle types */ std::vector parseAssignedVehicleTypes(std::istream& from, - const std::string& next); + const std::string& next); NIVissimExtendedEdgePoint readExtEdgePointDef(std::istream& from); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/Makefile.in sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/Makefile.in --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -115,6 +115,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -145,6 +146,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -179,6 +181,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -212,7 +215,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimAbstractEdge.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimAbstractEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // ------------------- /****************************************************************************/ @@ -50,8 +50,7 @@ NIVissimAbstractEdge::NIVissimAbstractEdge(int id, const PositionVector& geom) - : myID(id), myNode(-1) -{ + : myID(id), myNode(-1) { // convert/publicate geometry for (PositionVector::ContType::const_iterator i = geom.begin(); i != geom.end(); ++i) { Position p = *i; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.h sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.h --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.h 2012-09-25 22:01:32.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NIVissimClosures.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimClosures.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimClosures.h 12403 2012-06-20 07:18:28Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -57,6 +57,15 @@ const std::string myID; int myFromNode, myToNode; std::vector myOverEdges; + +private: + /// @brief invalidated copy constructor + NIVissimClosures(const NIVissimClosures& s); + + /// @brief invalidated assignment operator + NIVissimClosures& operator=(const NIVissimClosures& s); + + }; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2012-09-25 22:01:32.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: NIVissimConnection.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimConnection.cpp 12574 2012-08-21 12:23:51Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -260,26 +260,26 @@ // this edge was not built, try to get one that approaches it vissimFrom = vissimFrom->getBestIncoming(); if (vissimFrom != 0) { - fromEdge = ec.retrievePossiblySplitted(toString(vissimFrom->getID()), toString(getFromEdgeID()), true); + fromEdge = ec.retrievePossiblySplit(toString(vissimFrom->getID()), toString(getFromEdgeID()), true); } } else { // this edge was built, try to get the proper part - fromEdge = ec.retrievePossiblySplitted(toString(getFromEdgeID()), toString(getToEdgeID()), true); + fromEdge = ec.retrievePossiblySplit(toString(getFromEdgeID()), toString(getToEdgeID()), true); } NIVissimEdge* vissimTo = NIVissimEdge::dictionary(getToEdgeID()); if (vissimTo->wasWithinAJunction()) { vissimTo = vissimTo->getBestOutgoing(); if (vissimTo != 0) { - toEdge = ec.retrievePossiblySplitted(toString(vissimTo->getID()), toString(getToEdgeID()), true); + toEdge = ec.retrievePossiblySplit(toString(vissimTo->getID()), toString(getToEdgeID()), true); } } else { - toEdge = ec.retrievePossiblySplitted(toString(getToEdgeID()), toString(getFromEdgeID()), false); + toEdge = ec.retrievePossiblySplit(toString(getToEdgeID()), toString(getFromEdgeID()), false); } // try to get the edges the current connection connects /* - NBEdge *fromEdge = ec.retrievePossiblySplitted(toString(getFromEdgeID()), toString(getToEdgeID()), true); - NBEdge *toEdge = ec.retrievePossiblySplitted(toString(getToEdgeID()), toString(getFromEdgeID()), false); + NBEdge *fromEdge = ec.retrievePossiblySplit(toString(getFromEdgeID()), toString(getToEdgeID()), true); + NBEdge *toEdge = ec.retrievePossiblySplit(toString(getToEdgeID()), toString(getFromEdgeID()), false); */ if (fromEdge == 0 || toEdge == 0) { WRITE_WARNING("Could not build connection between '" + toString(getFromEdgeID()) + "' and '" + toString(getToEdgeID()) + "'."); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.h sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.h --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.h 2012-09-25 22:01:32.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimConnection.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimConnection.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -92,7 +92,7 @@ * @param[in] The built from-edge * @param[in] The built to-edge */ - void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge) ; + void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge); public: const std::vector& getFromLanes() const; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2012-09-25 22:01:32.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimConnectionCluster.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimConnectionCluster.cpp 12403 2012-06-20 07:18:28Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -529,21 +529,6 @@ void -NIVissimConnectionCluster::searchForConnection(int id) { - int pos = 0; - for (ContType::iterator i = myClusters.begin(); i != myClusters.end(); i++) { - std::vector connections = (*i)->myConnections; - if (find(connections.begin(), connections.end(), id) != connections.end()) { - for (std::vector::iterator j = connections.begin(); j != connections.end(); j++) { - int checkdummy = *j; - } - } - pos++; - } -} - - -void NIVissimConnectionCluster::_debugOut(std::ostream& into) { for (ContType::iterator i = myClusters.begin(); i != myClusters.end(); i++) { std::vector connections = (*i)->myConnections; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimConnectionCluster.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimConnectionCluster.h 13107 2012-12-02 13:57:34Z behrisch $ /// // ------------------- /****************************************************************************/ @@ -102,8 +102,6 @@ static void buildNodeClusters(); - static void searchForConnection(int id); - static void _debugOut(std::ostream& into); static size_t dictSize(); @@ -167,7 +165,7 @@ std::vector getDisturbanceParticipators(); std::vector extendByToTreatAsSame(const std::vector& iv1, - const std::vector& iv2) const; + const std::vector& iv2) const; bool isWeakDistrictConnRealisation(NIVissimConnectionCluster* c2); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimDistrictConnection.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimDistrictConnection.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // ------------------- /****************************************************************************/ @@ -72,7 +72,7 @@ const std::string& name, const std::vector& districts, const std::vector& percentages, int edgeid, SUMOReal position, - const std::vector > &assignedVehicles) + const std::vector >& assignedVehicles) : myID(id), myName(name), myDistricts(districts), myEdgeID(edgeid), myPosition(position), myAssignedVehicles(assignedVehicles) { @@ -94,7 +94,7 @@ NIVissimDistrictConnection::dictionary(int id, const std::string& name, const std::vector& districts, const std::vector& percentages, int edgeid, SUMOReal position, - const std::vector > &assignedVehicles) { + const std::vector >& assignedVehicles) { NIVissimDistrictConnection* o = new NIVissimDistrictConnection(id, name, districts, percentages, edgeid, position, assignedVehicles); @@ -214,7 +214,7 @@ // get the edge to connect the parking place to NBEdge* e = ec.retrieve(toString(c->myEdgeID)); if (e == 0) { - e = ec.retrievePossiblySplitted(toString(c->myEdgeID), c->myPosition); + e = ec.retrievePossiblySplit(toString(c->myEdgeID), c->myPosition); } if (e == 0) { WRITE_WARNING("Could not build district '" + toString((*k).first) + "' - edge '" + toString(c->myEdgeID) + "' is missing."); @@ -242,7 +242,8 @@ id = "VissimFromParkingplace" + toString((*k).first) + "-" + toString(c->myID); NBEdge* source = new NBEdge(id, districtNode, parkingPlace, - "Connection", c->getMeanSpeed(/*distc*/) / (SUMOReal) 3.6, 3, -1, -1, LANESPREAD_RIGHT); + "Connection", c->getMeanSpeed(/*distc*/) / (SUMOReal) 3.6, 3, -1, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET); if (!ec.insert(source)) { // !!! in den Konstruktor throw 1; // !!! } @@ -258,7 +259,8 @@ id = "VissimToParkingplace" + toString((*k).first) + "-" + toString(c->myID); NBEdge* destination = new NBEdge(id, parkingPlace, districtNode, - "Connection", (SUMOReal) 100 / (SUMOReal) 3.6, 2, -1, -1, LANESPREAD_RIGHT); + "Connection", (SUMOReal) 100 / (SUMOReal) 3.6, 2, -1, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET); if (!ec.insert(destination)) { // !!! (in den Konstruktor) throw 1; // !!! } diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date End of 2002 -/// @version $Id: NIVissimDistrictConnection.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimDistrictConnection.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An edge imported from Vissim together for a container for /****************************************************************************/ @@ -49,7 +49,7 @@ NIVissimDistrictConnection(int id, const std::string& name, const std::vector& districts, const std::vector& percentages, int edgeid, SUMOReal position, - const std::vector > &assignedVehicles); + const std::vector >& assignedVehicles); // Destructor ~NIVissimDistrictConnection(); @@ -75,7 +75,7 @@ static bool dictionary(int id, const std::string& name, const std::vector& districts, const std::vector& percentages, int edgeid, SUMOReal position, - const std::vector > &assignedVehicles); + const std::vector >& assignedVehicles); /// Inserts the build connection to the dictionary static bool dictionary(int id, NIVissimDistrictConnection* o); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2012-09-25 22:01:32.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimDisturbance.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimDisturbance.cpp 12574 2012-08-21 12:23:51Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -176,14 +176,8 @@ } else { node = node1 == 0 ? node2 : node1; } - ec.splitAt(dc, - ec.retrievePossiblySplitted( - toString(e1->getID()), myEdge.getPosition()), - node); - ec.splitAt(dc, - ec.retrievePossiblySplitted( - toString(e2->getID()), myDisturbance.getPosition()), - node); + ec.splitAt(dc, ec.retrievePossiblySplit(toString(e1->getID()), myEdge.getPosition()), node); + ec.splitAt(dc, ec.retrievePossiblySplit(toString(e2->getID()), myDisturbance.getPosition()), node); // !!! in some cases, one of the edges is not being build because it's too short // !!! what to do in these cases? NBEdge* mayDriveFrom = ec.retrieve(toString(e1->getID()) + "[0]"); @@ -206,7 +200,7 @@ // The connection will be prohibitesd by all connections // outgoing from the "real" edge - NBEdge* e = ec.retrievePossiblySplitted(toString(myDisturbance.getEdgeID()), myDisturbance.getPosition()); + NBEdge* e = ec.retrievePossiblySplit(toString(myDisturbance.getEdgeID()), myDisturbance.getPosition()); if (e == 0) { WRITE_WARNING("Could not prohibit '" + toString(myEdge.getEdgeID()) + "' by '" + toString(myDisturbance.getEdgeID()) + "'. Have not found disturbance."); refusedProhibits++; @@ -221,8 +215,8 @@ // get the begin of the prohibited connection std::string id_pcoe = toString(pc->getFromEdgeID()); std::string id_pcie = toString(pc->getToEdgeID()); - NBEdge* pcoe = ec.retrievePossiblySplitted(id_pcoe, id_pcie, true); - NBEdge* pcie = ec.retrievePossiblySplitted(id_pcie, id_pcoe, false); + NBEdge* pcoe = ec.retrievePossiblySplit(id_pcoe, id_pcie, true); + NBEdge* pcie = ec.retrievePossiblySplit(id_pcie, id_pcoe, false); // check whether it's ending node is the node the prohibited // edge end at if (pcoe != 0 && pcie != 0 && pcoe->getToNode() == e->getToNode()) { @@ -260,8 +254,7 @@ // We have to split the other one and add the prohibition // description - NBEdge* e = ec.retrievePossiblySplitted( - toString(myEdge.getEdgeID()), myEdge.getPosition()); + NBEdge* e = ec.retrievePossiblySplit(toString(myEdge.getEdgeID()), myEdge.getPosition()); if (e == 0) { WRITE_WARNING("Could not prohibit '" + toString(myEdge.getEdgeID()) + "' - it was not built."); return false; @@ -277,8 +270,8 @@ // get the begin of the prohibiting connection std::string id_bcoe = toString(bc->getFromEdgeID()); std::string id_bcie = toString(bc->getToEdgeID()); - NBEdge* bcoe = ec.retrievePossiblySplitted(id_bcoe, id_bcie, true); - NBEdge* bcie = ec.retrievePossiblySplitted(id_bcie, id_bcoe, false); + NBEdge* bcoe = ec.retrievePossiblySplit(id_bcoe, id_bcie, true); + NBEdge* bcie = ec.retrievePossiblySplit(id_bcie, id_bcoe, false); // check whether it's ending node is the node the prohibited // edge end at if (bcoe != 0 && bcie != 0 && bcoe->getToNode() == e->getToNode()) { diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimEdge.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A temporary storage for edges imported from Vissim /****************************************************************************/ @@ -504,7 +504,9 @@ } NBEdge* buildEdge = new NBEdge(toString(myID), fromNode, toNode, myType, - avgSpeed / (SUMOReal) 3.6, myNoLanes, -1, -1, -1, myGeom, myName, LANESPREAD_CENTER, true); + avgSpeed / (SUMOReal) 3.6, myNoLanes, -1, + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, + myGeom, myName, LANESPREAD_CENTER, true); for (i = 0; i < (int) myNoLanes; i++) { if ((int) myLaneSpeeds.size() <= i || myLaneSpeeds[i] == -1) { buildEdge->setSpeed(i, OptionsCont::getOptions().getFloat("vissim.default-speed") / (SUMOReal) 3.6); @@ -938,6 +940,7 @@ } else { return false; // !!! check this } + /* // std::vector::iterator i; // add to all other that shall be treated as same @@ -951,6 +954,7 @@ changed |= e->addToTreatAsSame(*i); } } + */ } NIVissimConnection* @@ -972,7 +976,7 @@ } -const std::vector & +const std::vector& NIVissimEdge::getToTreatAsSame() const { return myToTreatAsSame; } @@ -997,21 +1001,35 @@ NIVissimEdge* NIVissimEdge::getBestIncoming() const { + // @todo seems as this would have been a hard hack! + /* for (std::vector::const_iterator i = myIncomingConnections.begin(); i != myIncomingConnections.end(); ++i) { NIVissimConnection* c = NIVissimConnection::dictionary(*i); return NIVissimEdge::dictionary(c->getFromEdgeID()); } return 0; + */ + if (myIncomingConnections.size() != 0) { + return NIVissimEdge::dictionary(NIVissimConnection::dictionary(myIncomingConnections.front())->getFromEdgeID()); + } + return 0; } NIVissimEdge* NIVissimEdge::getBestOutgoing() const { + // @todo seems as this would have been a hard hack! + /* for (std::vector::const_iterator i = myOutgoingConnections.begin(); i != myOutgoingConnections.end(); ++i) { NIVissimConnection* c = NIVissimConnection::dictionary(*i); return NIVissimEdge::dictionary(c->getToEdgeID()); } return 0; + */ + if (myOutgoingConnections.size() != 0) { + return NIVissimEdge::dictionary(NIVissimConnection::dictionary(myOutgoingConnections.front())->getToEdgeID()); + } + return 0; } diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.h sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.h --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date End of 2002 -/// @version $Id: NIVissimEdge.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimEdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A temporary storage for edges imported from Vissim /****************************************************************************/ @@ -104,7 +104,7 @@ bool addToTreatAsSame(NIVissimEdge* e); NIVissimConnection* getConnectionTo(NIVissimEdge* e); - const std::vector &getToTreatAsSame() const; + const std::vector& getToTreatAsSame() const; /** @brief Returns whether this edge was found to be within a junction @@ -114,8 +114,8 @@ return myAmWithinJunction; } - NIVissimEdge* getBestIncoming() const ; - NIVissimEdge* getBestOutgoing() const ; + NIVissimEdge* getBestIncoming() const; + NIVissimEdge* getBestOutgoing() const; friend class NIVissimNodeDef_Edges; friend class NIVissimNodeDef_Poly; @@ -143,7 +143,7 @@ * * @todo Probably the distance (MAX_CLUSTER_DISTANCE=10m) should be made variable */ - static void buildConnectionClusters() ; + static void buildConnectionClusters(); /// Builds NBEdges from the VissimEdges within the dictionary static void dict_buildNBEdges(NBDistrictCont& dc, NBNodeCont& nc, @@ -162,7 +162,7 @@ * If the option "vissim.report-unset-speeds" is set, all lane ids stored within * this container are written. */ - static void reportUnsetSpeeds() ; + static void reportUnsetSpeeds(); private: @@ -179,7 +179,7 @@ * @exception ProcessError If one of the built nodes or edges could not be added to the according container */ void buildNBEdge(NBDistrictCont& dc, NBNodeCont& nc, - NBEdgeCont& ec, SUMOReal sameNodesOffset) ; + NBEdgeCont& ec, SUMOReal sameNodesOffset); /// Returns the origin node std::pair diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2012-09-25 22:01:32.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimExtendedEdgePoint.h 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimExtendedEdgePoint.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -56,7 +56,7 @@ * @param[in] assignedVehicles Vehicle (type) indices which should be regarded by this point */ NIVissimExtendedEdgePoint(int edgeid, const std::vector& lanes, - SUMOReal position, const std::vector& assignedVehicles) ; + SUMOReal position, const std::vector& assignedVehicles); ~NIVissimExtendedEdgePoint(); int getEdgeID() const; SUMOReal getPosition() const; @@ -71,7 +71,7 @@ * * @param[in] The built edge */ - void recheckLanes(const NBEdge* const edge) ; + void recheckLanes(const NBEdge* const edge); private: int myEdgeID; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2012-09-25 22:01:32.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeCluster.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimNodeCluster.cpp 12641 2012-08-31 20:26:04Z behrisch $ /// // ------------------- /****************************************************************************/ @@ -206,7 +206,6 @@ int NIVissimNodeCluster::getFromNode(int edgeid) { int ret = -1; - bool mult = false; for (DictType::iterator i = myDict.begin(); i != myDict.end(); i++) { NIVissimNodeCluster* c = (*i).second; for (std::vector::iterator j = c->myConnectors.begin(); j != c->myConnectors.end(); j++) { @@ -214,7 +213,6 @@ if (conn != 0 && conn->getToEdgeID() == edgeid) { // return (*i).first; if (ret != -1 && (*i).first != ret) { - mult = true; // "NIVissimNodeCluster:DoubleNode:" << ret << endl; throw 1; // an edge should not outgo from two different nodes // but actually, a joined cluster may posess a connections more than once diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimTL.cpp sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimTL.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2012-03-13 00:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2012-09-25 22:01:32.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimTL.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimTL.cpp 12574 2012-08-21 12:23:51Z dkrajzew $ /// // ------------------- /****************************************************************************/ @@ -39,12 +39,10 @@ #include #include #include "NIVissimConnection.h" -#include #include #include #include #include -#include "NIVissimConnection.h" #include "NIVissimDisturbance.h" #include "NIVissimNodeDef.h" #include "NIVissimEdge.h" @@ -146,7 +144,7 @@ NBConnectionVector assignedConnections; if (c == 0) { // What to do if on an edge? -> close all outgoing connections - NBEdge* edge = ec.retrievePossiblySplitted(toString(myEdgeID), myPosition); + NBEdge* edge = ec.retrievePossiblySplit(toString(myEdgeID), myPosition); if (edge == 0) { WRITE_WARNING("Could not set tls signal at edge '" + toString(myEdgeID) + "' - the edge was not built."); return false; @@ -173,14 +171,8 @@ } } else { // get the edges - NBEdge* tmpFrom = ec.retrievePossiblySplitted( - toString(c->getFromEdgeID()), - toString(c->getToEdgeID()), - true); - NBEdge* tmpTo = ec.retrievePossiblySplitted( - toString(c->getToEdgeID()), - toString(c->getFromEdgeID()), - false); + NBEdge* tmpFrom = ec.retrievePossiblySplit(toString(c->getFromEdgeID()), toString(c->getToEdgeID()), true); + NBEdge* tmpTo = ec.retrievePossiblySplit(toString(c->getToEdgeID()), toString(c->getFromEdgeID()), false); // check whether the edges are known if (tmpFrom != 0 && tmpTo != 0) { // add connections this signal is responsible for @@ -192,6 +184,8 @@ } // add to the group assert(myGroupIDs.size() != 0); + // @todo just another hack?! + /* if (myGroupIDs.size() == 1) { return tl->addToSignalGroup(toString(*(myGroupIDs.begin())), assignedConnections); @@ -200,7 +194,8 @@ return tl->addToSignalGroup(toString(*(myGroupIDs.begin())), assignedConnections); } - return true; + */ + return tl->addToSignalGroup(toString(myGroupIDs.front()), assignedConnections); } @@ -393,7 +388,7 @@ continue; }*/ std::string id = toString(tl->myID); - NBLoadedTLDef* def = new NBLoadedTLDef(id); + NBLoadedTLDef* def = new NBLoadedTLDef(id, 0); if (!tlc.insert(def)) { WRITE_ERROR("Error on adding a traffic light\n Must be a multiple id ('" + id + "')"); continue; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/Makefile.in sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/Makefile.in --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -155,6 +155,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -185,6 +186,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -219,6 +221,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -252,7 +255,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -72,7 +72,7 @@ color = (*i).second; } else { int r, g, b; - r = TplConvert::_2int(colorName.c_str()); + r = TplConvert::_2int(colorName.c_str()); from >> g; // type-checking is missing! from >> b; // type-checking is missing! color = RGBColor( @@ -89,7 +89,7 @@ std::vector types; from >> tag; do { - types.push_back(TplConvert::_2int(tag.c_str())); + types.push_back(TplConvert::_2int(tag.c_str())); tag = readEndSecure(from); } while (tag != "DATAEND"); return NIVissimVehTypeClass::dictionary(id, name, color, types); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -77,7 +77,7 @@ color = (*i).second; } else { int r, g, b; - r = TplConvert::_2int(colorName.c_str()); + r = TplConvert::_2int(colorName.c_str()); from >> g; // type-checking is missing! from >> b; // type-checking is missing! color = RGBColor( diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -69,9 +69,9 @@ tag = readEndSecure(from); } if (tag != "DATAEND") { - SUMOReal p1 = TplConvert::_2SUMOReal(tag.c_str()); + SUMOReal p1 = TplConvert::_2SUMOReal(tag.c_str()); from >> tag; - SUMOReal p2 = TplConvert::_2SUMOReal(tag.c_str()); + SUMOReal p2 = TplConvert::_2SUMOReal(tag.c_str()); points.push_back(Position(p1, p2)); } } while (tag != "DATAEND"); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Kantensperrung.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Kantensperrung.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -74,7 +74,7 @@ while (tag != "DATAEND") { tag = readEndSecure(from); if (tag != "DATAEND") { - edges.push_back(TplConvert::_2int(tag.c_str())); + edges.push_back(TplConvert::_2int(tag.c_str())); } } NIVissimClosures::dictionary(id, from_node, to_node, edges); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Knotendefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Knotendefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -91,7 +91,7 @@ } NIVissimNodeDef_Edges::dictionary(id, name, edges); } else { - int no = TplConvert::_2int(tag.c_str()); + int no = TplConvert::_2int(tag.c_str()); PositionVector poly; for (int i = 0; i < no; i++) { poly.push_back(getPosition(from)); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -63,9 +63,9 @@ do { tag = readEndSecure(from); if (tag != "DATAEND") { - SUMOReal p1 = TplConvert::_2SUMOReal(tag.c_str()); + SUMOReal p1 = TplConvert::_2SUMOReal(tag.c_str()); from >> tag; - SUMOReal p2 = TplConvert::_2SUMOReal(tag.c_str()); + SUMOReal p2 = TplConvert::_2SUMOReal(tag.c_str()); points.push_back(Position(p1, p2)); } } while (tag != "DATAEND"); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -168,7 +168,7 @@ if (tag == "ALLE") { //lanes.push_back(1); // !!! } else { - lanes.push_back(TplConvert::_2int(tag.c_str())); + lanes.push_back(TplConvert::_2int(tag.c_str())); } // SUMOReal position; @@ -185,7 +185,7 @@ from >> tag; tag = "alle"; } else if (tag != "zeitluecke" && tag != "durch" && tag != "DATAEND") { - int tmp = TplConvert::_2int(tag.c_str()); + int tmp = TplConvert::_2int(tag.c_str()); types.push_back(tmp); } } diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Simdauer.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Simdauer.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -57,7 +57,7 @@ from >> duration; // !!! try { - TplConvert::_2SUMOReal(duration.c_str()); + TplConvert::_2SUMOReal(duration.c_str()); } catch (...) { WRITE_ERROR("Simulation duration could not be parsed"); return false; diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Streckendefinition.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Streckendefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -99,7 +99,7 @@ geom.push_back_noDoublePos(getPosition(from)); tag = myRead(from); try { - TplConvert::_2SUMOReal(tag.c_str()); + TplConvert::_2SUMOReal(tag.c_str()); tag = myRead(from); } catch (NumberFormatException&) {} } @@ -122,7 +122,7 @@ tag = myRead(from); tag = myRead(from); while (tag != "DATAEND" && tag != "spur" && tag != "keinspurwechsel") { - int classes = TplConvert::_2int(tag.c_str()); + int classes = TplConvert::_2int(tag.c_str()); assignedVehicles.push_back(classes); tag = readEndSecure(from); } diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -90,9 +90,9 @@ from >> tag; from >> tag; } - int numid = TplConvert::_2int(edgeid.c_str()); - int numlane = TplConvert::_2int(lane.c_str()) - 1; - int numv = TplConvert::_2int(vwunsch.c_str()); + int numid = TplConvert::_2int(edgeid.c_str()); + int numlane = TplConvert::_2int(lane.c_str()) - 1; + int numv = TplConvert::_2int(vwunsch.c_str()); NIVissimEdge* e = NIVissimEdge::dictionary(numid); if (e == 0) { NIVissimConnection* c = NIVissimConnection::dictionary(numid); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verbindungsdefinition.cpp 12050 2012-03-12 06:53:15Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verbindungsdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -74,12 +74,12 @@ if (y != "nach") { geom.push_back_noDoublePos( Position( - TplConvert::_2SUMOReal(x.c_str()), - TplConvert::_2SUMOReal(y.c_str()) + TplConvert::_2SUMOReal(x.c_str()), + TplConvert::_2SUMOReal(y.c_str()) )); tag = myRead(from); try { - TplConvert::_2SUMOReal(tag.c_str()); + TplConvert::_2SUMOReal(tag.c_str()); tag = myRead(from); } catch (NumberFormatException&) {} } else { @@ -126,7 +126,7 @@ if (tag == "fahrzeugklassen") { tag = readEndSecure(from); while (tag != "DATAEND" && tag != "sperrung" && tag != "auswertung") { - int classes = TplConvert::_2int(tag.c_str()); + int classes = TplConvert::_2int(tag.c_str()); assignedVehicles.push_back(classes); tag = readEndSecure(from, "auswertung"); } @@ -153,7 +153,7 @@ tag = myRead(from); } while (tag != "DATAEND" && tag != "spur" && tag != "keinspurwechsel") { - int classes = TplConvert::_2int(tag.c_str()); + int classes = TplConvert::_2int(tag.c_str()); assignedVehicles.push_back(classes); tag = readEndSecure(from); } diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -73,9 +73,9 @@ new Distribution_MeanDev(id, mean, deviation)); } if (tag != "DATAEND") { - SUMOReal p1 = TplConvert::_2SUMOReal(tag.c_str()); + SUMOReal p1 = TplConvert::_2SUMOReal(tag.c_str()); from >> tag; - SUMOReal p2 = TplConvert::_2SUMOReal(tag.c_str()); + SUMOReal p2 = TplConvert::_2SUMOReal(tag.c_str()); points.push_back(Position(p1, p2)); } } while (tag != "DATAEND"); diff -Nru sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp --- sumo-0.15.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2012-09-25 22:01:31.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zuflussdefinition.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zuflussdefinition.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // /****************************************************************************/ @@ -72,7 +72,7 @@ exact = true; tag = myRead(from); } - q = TplConvert::_2SUMOReal(tag.c_str()); + q = TplConvert::_2SUMOReal(tag.c_str()); // read the vehicle types from >> tag; int vehicle_combination; diff -Nru sumo-0.15.0~dfsg/src/netload/Makefile.am sumo-0.16.0~dfsg/src/netload/Makefile.am --- sumo-0.15.0~dfsg/src/netload/Makefile.am 2011-03-25 00:03:42.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/Makefile.am 2012-09-25 22:01:41.000000000 +0000 @@ -6,5 +6,4 @@ NLJunctionControlBuilder.h NLJunctionControlBuilder.cpp \ NLBuilder.h NLBuilder.cpp \ NLHandler.h NLHandler.cpp \ -NLSucceedingLaneBuilder.h NLSucceedingLaneBuilder.cpp \ NLTriggerBuilder.h NLTriggerBuilder.cpp diff -Nru sumo-0.15.0~dfsg/src/netload/Makefile.in sumo-0.16.0~dfsg/src/netload/Makefile.in --- sumo-0.15.0~dfsg/src/netload/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -53,8 +53,7 @@ NLDiscreteEventBuilder.$(OBJEXT) \ NLEdgeControlBuilder.$(OBJEXT) \ NLJunctionControlBuilder.$(OBJEXT) NLBuilder.$(OBJEXT) \ - NLHandler.$(OBJEXT) NLSucceedingLaneBuilder.$(OBJEXT) \ - NLTriggerBuilder.$(OBJEXT) + NLHandler.$(OBJEXT) NLTriggerBuilder.$(OBJEXT) libnetload_a_OBJECTS = $(am_libnetload_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -105,6 +104,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -135,6 +135,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -169,6 +170,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -202,7 +204,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -229,7 +230,6 @@ NLJunctionControlBuilder.h NLJunctionControlBuilder.cpp \ NLBuilder.h NLBuilder.cpp \ NLHandler.h NLHandler.cpp \ -NLSucceedingLaneBuilder.h NLSucceedingLaneBuilder.cpp \ NLTriggerBuilder.h NLTriggerBuilder.cpp all: all-am @@ -286,7 +286,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NLEdgeControlBuilder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NLHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NLJunctionControlBuilder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NLSucceedingLaneBuilder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NLTriggerBuilder.Po@am__quote@ .cpp.o: diff -Nru sumo-0.15.0~dfsg/src/netload/NLBuilder.cpp sumo-0.16.0~dfsg/src/netload/NLBuilder.cpp --- sumo-0.15.0~dfsg/src/netload/NLBuilder.cpp 2012-02-25 00:03:25.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLBuilder.cpp 2012-11-24 00:02:18.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLBuilder.cpp 11955 2012-02-24 13:13:35Z behrisch $ +/// @version $Id: NLBuilder.cpp 13041 2012-11-23 13:43:16Z behrisch $ /// // The main interface for loading a microsim /****************************************************************************/ @@ -125,7 +125,7 @@ return false; } buildNet(); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL // load the previous state if wished if (myOptions.isSet("load-state")) { long before = SysUtils::getCurrentMillis(); @@ -134,7 +134,7 @@ WRITE_ERROR("Could not read state from '" + myOptions.getString("load-state") + "'!"); } else { PROGRESS_BEGIN_MESSAGE("Loading state from '" + myOptions.getString("load-state") + "'"); - unsigned int step = myNet.loadState(strm); + SUMOTime step = myNet.loadState(strm); if (myOptions.isDefault("begin")) { myOptions.set("begin", time2string(step)); } @@ -211,18 +211,21 @@ MSFrame::buildStreams(); std::vector stateDumpTimes; std::vector stateDumpFiles; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL 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)); } - if (!myOptions.isDefault("save-state.prefix")) { + if (myOptions.isSet("save-state.files")) { + stateDumpFiles = StringTokenizer(myOptions.getString("save-state.files")).getVector(); + if (stateDumpFiles.size() != stateDumpTimes.size()) { + WRITE_ERROR("Wrong number of state file names!"); + } + } else { const std::string prefix = myOptions.getString("save-state.prefix"); for (std::vector::iterator i = stateDumpTimes.begin(); i != stateDumpTimes.end(); ++i) { stateDumpFiles.push_back(prefix + "_" + time2string(*i) + ".bin"); } - } else { - stateDumpFiles = StringTokenizer(myOptions.getString("save-state.files")).getVector() ; } #endif myNet.closeBuilding(edges, junctions, routeLoaders, tlc, stateDumpTimes, stateDumpFiles); diff -Nru sumo-0.15.0~dfsg/src/netload/NLBuilder.h sumo-0.16.0~dfsg/src/netload/NLBuilder.h --- sumo-0.15.0~dfsg/src/netload/NLBuilder.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLBuilder.h 2012-09-25 22:01:41.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NLBuilder.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The main interface for loading a microsim /****************************************************************************/ @@ -80,11 +80,11 @@ NLBuilder(OptionsCont& oc, MSNet& net, NLEdgeControlBuilder& eb, NLJunctionControlBuilder& jb, NLDetectorBuilder& db, - NLHandler& xmlHandler) ; + NLHandler& xmlHandler); /// @brief Destructor - virtual ~NLBuilder() ; + virtual ~NLBuilder(); /** @brief Builds and initialises the simulation @@ -98,7 +98,7 @@ * @exception ProcessError If something fails on network building * @todo Again, both returning a bool and throwing an exception; quite inconsistent */ - virtual bool build() ; + virtual bool build(); protected: @@ -120,7 +120,7 @@ * If an error occurs, all built structures are deleted and a ProcessError is thrown. * @exception ProcessError If the loaded structures could not be built */ - void buildNet() ; + void buildNet(); /** @brief Builds the route loader control @@ -131,7 +131,7 @@ * @return The built route loader control * @exception ProcessError If an error occured */ - MSRouteLoaderControl* buildRouteLoaderControl(const OptionsCont& oc) ; + MSRouteLoaderControl* buildRouteLoaderControl(const OptionsCont& oc); @@ -158,7 +158,7 @@ * @see SAXWeightsHandler::EdgeFloatTimeLineRetriever::addEdgeWeight */ void addEdgeWeight(const std::string& id, - SUMOReal val, SUMOReal beg, SUMOReal end) const ; + SUMOReal val, SUMOReal beg, SUMOReal end) const; private: /// @brief The network edges shall be obtained from @@ -189,7 +189,7 @@ * @see SAXWeightsHandler::EdgeFloatTimeLineRetriever::addEdgeWeight */ void addEdgeWeight(const std::string& id, - SUMOReal val, SUMOReal beg, SUMOReal end) const ; + SUMOReal val, SUMOReal beg, SUMOReal end) const; private: /// @brief The network edges shall be obtained from diff -Nru sumo-0.15.0~dfsg/src/netload/NLDetectorBuilder.cpp sumo-0.16.0~dfsg/src/netload/NLDetectorBuilder.cpp --- sumo-0.15.0~dfsg/src/netload/NLDetectorBuilder.cpp 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLDetectorBuilder.cpp 2012-09-25 22:01:41.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Christian Roessel /// @date Mon, 15 Apr 2002 -/// @version $Id: NLDetectorBuilder.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: NLDetectorBuilder.cpp 12167 2012-03-23 08:37:12Z behrisch $ /// // Builds detectors for microsim /****************************************************************************/ @@ -57,7 +57,7 @@ #include "NLDetectorBuilder.h" #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #include #include @@ -111,7 +111,7 @@ // add the file output myNet.getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, loop, device, splInterval); } else { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (pos < 0) { pos = clane->getLength() + pos; } @@ -410,7 +410,7 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL MEInductLoop* NLDetectorBuilder::createMEInductLoop(const std::string& id, MESegment* s, SUMOReal pos) { diff -Nru sumo-0.15.0~dfsg/src/netload/NLDetectorBuilder.h sumo-0.16.0~dfsg/src/netload/NLDetectorBuilder.h --- sumo-0.15.0~dfsg/src/netload/NLDetectorBuilder.h 2012-03-13 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLDetectorBuilder.h 2012-09-25 22:01:41.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Mon, 15 Apr 2002 -/// @version $Id: NLDetectorBuilder.h 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: NLDetectorBuilder.h 12588 2012-08-24 07:36:30Z dkrajzew $ /// // Builds detectors for microsim /****************************************************************************/ @@ -46,7 +46,7 @@ class MSLane; class MSEdge; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL class MEInductLoop; class MESegment; #endif @@ -68,11 +68,11 @@ * * @param[in] net The network to which's detector control built detector shall be added */ - NLDetectorBuilder(MSNet& net) ; + NLDetectorBuilder(MSNet& net); /// @brief Destructor - virtual ~NLDetectorBuilder() ; + virtual ~NLDetectorBuilder(); /// @name Value parsing and detector building methods @@ -282,7 +282,7 @@ * * @return The id of the currently processed e3 detector */ - std::string getCurrentE3ID() const ; + std::string getCurrentE3ID() const; /** @brief Builds a vTypeProbe and adds it to the net @@ -303,12 +303,12 @@ OutputDevice& device) throw(InvalidArgument); - /** @brief Builds a routeprobe and adds it to the net + /** @brief Builds a routeProbe and adds it to the net * * Checks the given values, first. If one of the values is invalid * (sampling frequency<=0), an InvalidArgument is thrown. * - * Otherwise the routeprobe is built (directly). + * Otherwise the routeProbe is built (directly). * * @param[in] id The id the detector shall have * @param[in] edge The name of the edge the detector shall observe @@ -339,7 +339,7 @@ * @param[in] splitByType Whether additional information split by vehicle classes shall be generated */ virtual MSDetectorFileOutput* createInductLoop(const std::string& id, - MSLane* lane, SUMOReal pos, bool splitByType) ; + MSLane* lane, SUMOReal pos, bool splitByType); /** @brief Creates an instance of an e1 detector using the given values @@ -352,9 +352,9 @@ * @param[in] od The output device the loop shall use */ virtual MSDetectorFileOutput* createInstantInductLoop(const std::string& id, - MSLane* lane, SUMOReal pos, OutputDevice& od) ; + MSLane* lane, SUMOReal pos, OutputDevice& od); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /** @brief Creates an instance of a mesoscopic e1 detector using the given values * * Simply calls the MEInductLoop constructor @@ -365,7 +365,7 @@ * @todo Position is not used, herein!? */ virtual MEInductLoop* createMEInductLoop(const std::string& id, - MESegment* s, SUMOReal pos) ; + MESegment* s, SUMOReal pos); #endif @@ -385,7 +385,7 @@ DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /** @brief Creates an instance of an e2ol-detector using the given values @@ -404,7 +404,7 @@ virtual MSDetectorFileOutput* createMultiLaneE2Detector( const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /** @brief Creates an instance of an e3 detector using the given values @@ -419,7 +419,7 @@ */ virtual MSDetectorFileOutput* createE3Detector(const std::string& id, const CrossSectionVector& entries, const CrossSectionVector& exits, - SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold) ; + SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold); /** @brief Creates edge based mean data collector using the given specification @@ -465,7 +465,7 @@ MSDetectorFileOutput* buildSingleLaneE2Det(const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); /** @brief Builds an e2 detector that continues on preceeding lanes @@ -482,7 +482,7 @@ */ MSDetectorFileOutput* buildMultiLaneE2Det(const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, - SUMOReal jamDistThreshold) ; + SUMOReal jamDistThreshold); @@ -503,10 +503,10 @@ */ E3DetectorDefinition(const std::string& id, OutputDevice& device, SUMOReal haltingSpeedThreshold, - SUMOTime haltingTimeThreshold, int splInterval) ; + SUMOTime haltingTimeThreshold, int splInterval); /// @brief Destructor - ~E3DetectorDefinition() ; + ~E3DetectorDefinition(); /// @brief The id of the detector std::string myID; diff -Nru sumo-0.15.0~dfsg/src/netload/NLEdgeControlBuilder.cpp sumo-0.16.0~dfsg/src/netload/NLEdgeControlBuilder.cpp --- sumo-0.15.0~dfsg/src/netload/NLEdgeControlBuilder.cpp 2012-03-08 00:03:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLEdgeControlBuilder.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLEdgeControlBuilder.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NLEdgeControlBuilder.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Interface for building edges /****************************************************************************/ @@ -46,7 +46,7 @@ #include #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #endif @@ -72,14 +72,13 @@ void NLEdgeControlBuilder::beginEdgeParsing( - const std::string& id, MSEdge::EdgeBasicFunction function, + const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName) { - myActiveEdge = buildEdge(id, streetName); + myActiveEdge = buildEdge(id, function, streetName); if (MSEdge::dictionary(id) != 0) { throw InvalidArgument("Another edge with the id '" + id + "' exists."); } myEdges.push_back(myActiveEdge); - myFunction = function; } @@ -89,7 +88,7 @@ const PositionVector& shape, SUMOReal width, SVCPermissions permissions) { MSLane* lane = 0; - switch (myFunction) { + switch (myActiveEdge->getPurpose()) { case MSEdge::EDGEFUNCTION_INTERNAL: lane = new MSInternalLane(id, maxSpeed, length, myActiveEdge, myCurrentNumericalLaneID++, shape, width, permissions); @@ -109,11 +108,11 @@ MSEdge* NLEdgeControlBuilder::closeEdge() { - std::vector *lanes = new std::vector(); + std::vector* lanes = new std::vector(); lanes->reserve(myLaneStorage->size()); copy(myLaneStorage->begin(), myLaneStorage->end(), back_inserter(*lanes)); myLaneStorage->clear(); - myActiveEdge->initialize(lanes, myFunction); + myActiveEdge->initialize(lanes); return myActiveEdge; } @@ -122,7 +121,7 @@ NLEdgeControlBuilder::build() { for (EdgeCont::iterator i1 = myEdges.begin(); i1 != myEdges.end(); i1++) { (*i1)->closeBuilding(); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MSGlobals::gMesoNet->buildSegmentsFor(**i1, OptionsCont::getOptions()); } @@ -133,8 +132,11 @@ MSEdge* -NLEdgeControlBuilder::buildEdge(const std::string& id, const std::string& streetName) { - return new MSEdge(id, myCurrentNumericalEdgeID++, streetName); +NLEdgeControlBuilder::buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName) { + if (function == MSEdge::EDGEFUNCTION_INTERNAL) { + return new MSEdge(id, -1, function, streetName); + } + return new MSEdge(id, myCurrentNumericalEdgeID++, function, streetName); } diff -Nru sumo-0.15.0~dfsg/src/netload/NLEdgeControlBuilder.h sumo-0.16.0~dfsg/src/netload/NLEdgeControlBuilder.h --- sumo-0.15.0~dfsg/src/netload/NLEdgeControlBuilder.h 2012-03-08 00:03:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLEdgeControlBuilder.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLEdgeControlBuilder.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NLEdgeControlBuilder.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Interface for building edges /****************************************************************************/ @@ -87,7 +87,7 @@ * @param[in] streetName The street name of the edge * @exception InvalidArgument If an edge with the same name was already built */ - void beginEdgeParsing(const std::string& id, MSEdge::EdgeBasicFunction function, + void beginEdgeParsing(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName); @@ -101,8 +101,7 @@ * @param[in] length The lane's length * @param[in] shape The shape of the lane * @param[in] width The width of the lane - * @param[in] allowed Vehicle classes that explicitly may drive on this lane - * @param[in] disallowed Vehicle classes that are explicitly forbidden on this lane + * @param[in] permissions Encoding of vehicle classes that may drive on this lane * @see SUMOVehicleClass * @see MSLane * @see MSInternalLane @@ -130,7 +129,7 @@ * @param[in] id The id of the edge to build * @param[in] streetName The street name of the edge to build */ - virtual MSEdge* buildEdge(const std::string& id, const std::string& streetName = "") ; + virtual MSEdge* buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName = ""); protected: @@ -147,10 +146,7 @@ MSEdge* myActiveEdge; /// @brief pointer to a temporary lane storage - std::vector *myLaneStorage; - - /// the function of the current edge - MSEdge::EdgeBasicFunction myFunction; + std::vector* myLaneStorage; private: /// @brief invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/netload/NLHandler.cpp sumo-0.16.0~dfsg/src/netload/NLHandler.cpp --- sumo-0.15.0~dfsg/src/netload/NLHandler.cpp 2012-03-14 00:02:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Felix Brack /// @date Mon, 9 Jul 2001 -/// @version $Id: NLHandler.cpp 12087 2012-03-13 14:14:35Z behrisch $ +/// @version $Id: NLHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The XML-Handler for network loading /****************************************************************************/ @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -57,6 +56,7 @@ #include #include #include +#include #include #ifdef CHECK_MEMORY_LEAKS @@ -77,27 +77,8 @@ myCurrentIsInternalToSkip(false), myDetectorBuilder(detBuilder), myTriggerBuilder(triggerBuilder), myEdgeControlBuilder(edgeBuilder), myJunctionControlBuilder(junctionBuilder), - mySucceedingLaneBuilder(junctionBuilder), myAmInTLLogicMode(false), myCurrentIsBroken(false), - myHaveWarnedAboutDeprecatedE1(false), - myHaveWarnedAboutDeprecatedE2(false), - myHaveWarnedAboutDeprecatedE3(false), - myHaveWarnedAboutDeprecatedDetEntry(false), - myHaveWarnedAboutDeprecatedDetExit(false), - myHaveWarnedAboutDeprecatedRowLogic(false), - myHaveWarnedAboutDeprecatedTLLogic(false), - myHaveWarnedAboutDeprecatedTimedEvent(false), - myHaveWarnedAboutDeprecatedTLSTiming(false), - myHaveWarnedAboutDeprecatedTimeThreshold(false), - myHaveWarnedAboutDeprecatedSpeedThreshold(false), - myHaveWarnedAboutDeprecatedJamDistThreshold(false), - myHaveWarnedAboutDeprecatedVTypeProbe(false), - myHaveWarnedAboutDeprecatedRouteProbe(false), - myHaveWarnedAboutDeprecatedEdgeMean(false), - myHaveWarnedAboutDeprecatedLaneMean(false), - myHaveWarnedAboutDeprecatedVTypes(false), - myHaveWarnedAboutDeprecatedLanes(false), - myHaveWarnedAboutDeprecatedDistrict(false), myHaveWarnedAboutDeprecatedDSource(false), myHaveWarnedAboutDeprecatedDSink(false) {} + myHaveWarnedAboutDeprecatedLanes(false), myLastParameterised(0) {} NLHandler::~NLHandler() {} @@ -127,33 +108,12 @@ case SUMO_TAG_PHASE: addPhase(attrs); break; - case SUMO_TAG_SUCC: - openSucc(attrs); - break; - case SUMO_TAG_SUCCLANE: - addSuccLane(attrs); - break; case SUMO_TAG_CONNECTION: addConnection(attrs); break; - case SUMO_TAG_ROWLOGIC__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedRowLogic) { - myHaveWarnedAboutDeprecatedRowLogic = true; - WRITE_WARNING("Your network uses deprecated tags; please rebuild."); - } - initJunctionLogic(attrs); - break; - case SUMO_TAG_TLLOGIC__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedTLLogic) { - myHaveWarnedAboutDeprecatedTLLogic = true; - WRITE_WARNING("Deprecated tl-logic name; please rebuild."); - } case SUMO_TAG_TLLOGIC: initTrafficLightLogic(attrs); break; - case SUMO_TAG_LOGICITEM: // deprecated - addLogicItem(attrs); - break; case SUMO_TAG_REQUEST: addRequest(attrs); break; @@ -171,46 +131,21 @@ addMsgEmitter(attrs); break; #endif - case SUMO_TAG_E1DETECTOR__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedE1) { - myHaveWarnedAboutDeprecatedE1 = true; - WRITE_WARNING("'" + toString(SUMO_TAG_E1DETECTOR__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_E1DETECTOR) + "'."); - } case SUMO_TAG_E1DETECTOR: case SUMO_TAG_INDUCTION_LOOP: addE1Detector(attrs); break; - case SUMO_TAG_E2DETECTOR__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedE2) { - myHaveWarnedAboutDeprecatedE2 = true; - WRITE_WARNING("'" + toString(SUMO_TAG_E2DETECTOR__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_E2DETECTOR) + "'."); - } case SUMO_TAG_E2DETECTOR: case SUMO_TAG_LANE_AREA_DETECTOR: addE2Detector(attrs); break; - case SUMO_TAG_E3DETECTOR__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedE3) { - myHaveWarnedAboutDeprecatedE3 = true; - WRITE_WARNING("'" + toString(SUMO_TAG_E3DETECTOR__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_E3DETECTOR) + "'."); - } case SUMO_TAG_E3DETECTOR: case SUMO_TAG_ENTRY_EXIT_DETECTOR: beginE3Detector(attrs); break; - case SUMO_TAG_DET_ENTRY__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDetEntry) { - myHaveWarnedAboutDeprecatedDetEntry = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DET_ENTRY__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_DET_ENTRY) + "'."); - } case SUMO_TAG_DET_ENTRY: addE3Entry(attrs); break; - case SUMO_TAG_DET_EXIT__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDetExit) { - myHaveWarnedAboutDeprecatedDetExit = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DET_EXIT__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_DET_EXIT) + "'."); - } case SUMO_TAG_DET_EXIT: addE3Exit(attrs); break; @@ -220,7 +155,7 @@ case SUMO_TAG_VSS: myTriggerBuilder.parseAndBuildLaneSpeedTrigger(myNet, attrs, getFileName()); break; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL case SUMO_TAG_CALIBRATOR: myTriggerBuilder.parseAndBuildCalibrator(myNet, attrs, getFileName()); break; @@ -231,43 +166,18 @@ case SUMO_TAG_BUS_STOP: myTriggerBuilder.parseAndBuildBusStop(myNet, attrs); break; - case SUMO_TAG_VTYPEPROBE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedVTypeProbe) { - myHaveWarnedAboutDeprecatedVTypeProbe = true; - WRITE_WARNING("'" + toString(SUMO_TAG_VTYPEPROBE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_VTYPEPROBE) + "'."); - } case SUMO_TAG_VTYPEPROBE: addVTypeProbeDetector(attrs); break; - case SUMO_TAG_ROUTEPROBE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedRouteProbe) { - myHaveWarnedAboutDeprecatedRouteProbe = true; - WRITE_WARNING("'" + toString(SUMO_TAG_ROUTEPROBE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_ROUTEPROBE) + "'."); - } case SUMO_TAG_ROUTEPROBE: addRouteProbeDetector(attrs); break; - case SUMO_TAG_MEANDATA_EDGE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedEdgeMean) { - myHaveWarnedAboutDeprecatedEdgeMean = true; - WRITE_WARNING("'" + toString(SUMO_TAG_MEANDATA_EDGE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_MEANDATA_EDGE) + "'."); - } case SUMO_TAG_MEANDATA_EDGE: addEdgeLaneMeanData(attrs, SUMO_TAG_MEANDATA_EDGE); break; - case SUMO_TAG_MEANDATA_LANE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedLaneMean) { - myHaveWarnedAboutDeprecatedLaneMean = true; - WRITE_WARNING("'" + toString(SUMO_TAG_MEANDATA_LANE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_MEANDATA_LANE) + "'."); - } case SUMO_TAG_MEANDATA_LANE: addEdgeLaneMeanData(attrs, SUMO_TAG_MEANDATA_LANE); break; - case SUMO_TAG_TIMEDEVENT__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedTimedEvent) { - myHaveWarnedAboutDeprecatedTimedEvent = true; - WRITE_WARNING("'" + toString(SUMO_TAG_TIMEDEVENT__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_TIMEDEVENT) + "'."); - } case SUMO_TAG_TIMEDEVENT: myActionBuilder.addAction(attrs, getFileName()); break; @@ -277,27 +187,12 @@ case SUMO_TAG_LOCATION: setLocation(attrs); break; - case SUMO_TAG_DISTRICT__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDistrict) { - myHaveWarnedAboutDeprecatedDistrict = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DISTRICT__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZ) + "'."); - } case SUMO_TAG_TAZ: addDistrict(attrs); break; - case SUMO_TAG_DSOURCE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDSource) { - myHaveWarnedAboutDeprecatedDSource = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DSOURCE__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZSOURCE) + "'."); - } case SUMO_TAG_TAZSOURCE: addDistrictEdge(attrs, true); break; - case SUMO_TAG_DSINK__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDSink) { - myHaveWarnedAboutDeprecatedDSink = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DSINK__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZSINK) + "'."); - } case SUMO_TAG_TAZSINK: addDistrictEdge(attrs, false); break; @@ -330,17 +225,6 @@ } } break; - case SUMO_TAG_SUCC: - closeSuccLane(); - break; - case SUMO_TAG_ROWLOGIC__DEPRECATED: - try { - myJunctionControlBuilder.closeJunctionLogic(); - } catch (InvalidArgument& e) { - WRITE_ERROR(e.what()); - } - break; - case SUMO_TAG_TLLOGIC__DEPRECATED: case SUMO_TAG_TLLOGIC: try { myJunctionControlBuilder.closeTrafficLightLogic(); @@ -352,7 +236,6 @@ case SUMO_TAG_WAUT: closeWAUT(); break; - case SUMO_TAG_E3DETECTOR__DEPRECATED: case SUMO_TAG_E3DETECTOR: case SUMO_TAG_ENTRY_EXIT_DETECTOR: endE3Detector(); @@ -361,6 +244,9 @@ break; } MSRouteHandler::myEndElement(element); + if (element != SUMO_TAG_PARAM) { + myLastParameterised = 0; + } } @@ -383,16 +269,9 @@ } myCurrentIsInternalToSkip = false; // parse the function - SumoXMLEdgeFunc func = EDGEFUNC_NORMAL; - std::string funcString = attrs.getOptStringReporting(SUMO_ATTR_FUNCTION, id.c_str(), ok, toString(func)); + const SumoXMLEdgeFunc func = attrs.getEdgeFunc(ok); if (!ok) { - myCurrentIsBroken = true; - return; - } - if (SUMOXMLDefinitions::EdgeFunctions.hasString(funcString)) { - func = SUMOXMLDefinitions::EdgeFunctions.get(funcString); - } else { - WRITE_ERROR("Edge '" + id + "' has an invalid type ('" + funcString + "')."); + WRITE_ERROR("Edge '" + id + "' has an invalid type."); myCurrentIsBroken = true; return; } @@ -456,15 +335,12 @@ myCurrentIsBroken = true; return; } - SUMOReal maxSpeed = attrs.hasAttribute(SUMO_ATTR_SPEED) - ? attrs.getSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok) - : attrs.getSUMORealReporting(SUMO_ATTR_MAXSPEED__DEPRECATED, id.c_str(), ok); + SUMOReal maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok); SUMOReal length = attrs.getSUMORealReporting(SUMO_ATTR_LENGTH, id.c_str(), ok); std::string allow = attrs.getOptStringReporting(SUMO_ATTR_ALLOW, id.c_str(), ok, ""); std::string disallow = attrs.getOptStringReporting(SUMO_ATTR_DISALLOW, id.c_str(), ok, ""); SUMOReal width = attrs.getOptSUMORealReporting(SUMO_ATTR_WIDTH, id.c_str(), ok, SUMO_const_laneWidth); - int index = attrs.getOptIntReporting(SUMO_ATTR_INDEX, id.c_str(), ok, -1); - PositionVector shape = GeomConvHelper::parseShapeReporting(attrs.getStringReporting(SUMO_ATTR_SHAPE, id.c_str(), ok), "lane", id.c_str(), ok, false); + PositionVector shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, false); if (shape.size() < 2) { WRITE_ERROR("Shape of lane '" + id + "' is broken.\n Can not build according edge."); myCurrentIsBroken = true; @@ -481,6 +357,7 @@ WRITE_ERROR("Another lane with the id '" + id + "' exists."); myCurrentIsBroken = true; } + myLastParameterised = lane; } catch (InvalidArgument& e) { WRITE_ERROR(e.what()); } @@ -502,11 +379,16 @@ PositionVector shape; if (attrs.hasAttribute(SUMO_ATTR_SHAPE)) { // inner junctions have no shape - shape = GeomConvHelper::parseShapeReporting(attrs.getStringSecure(SUMO_ATTR_SHAPE, ""), attrs.getObjectType(), id.c_str(), ok, true); + shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, true); } SUMOReal x = attrs.getSUMORealReporting(SUMO_ATTR_X, id.c_str(), ok); SUMOReal y = attrs.getSUMORealReporting(SUMO_ATTR_Y, id.c_str(), ok); - std::string type = attrs.getStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok); + bool typeOK = true; + SumoXMLNodeType type = attrs.getNodeType(typeOK); + if (!typeOK) { + WRITE_ERROR("An unknown or invalid junction type occured in junction '" + id + "'."); + ok = false; + } std::string key = attrs.getOptStringReporting(SUMO_ATTR_KEY, id.c_str(), ok, ""); // incoming lanes std::vector incomingLanes; @@ -533,7 +415,7 @@ void NLHandler::parseLanes(const std::string& junctionID, - const std::string& def, std::vector &into, bool& ok) { + const std::string& def, std::vector& into, bool& ok) { StringTokenizer st(def); while (ok && st.hasNext()) { std::string laneID = st.next(); @@ -556,6 +438,9 @@ bool ok = true; std::string key = attrs.getStringReporting(SUMO_ATTR_KEY, 0, ok); std::string val = attrs.getStringReporting(SUMO_ATTR_VALUE, 0, ok); + if (myLastParameterised != 0) { + myLastParameterised->addParameter(key, val); + } // set if (ok && myAmInTLLogicMode) { assert(key != ""); @@ -645,11 +530,17 @@ SUMOReal x = attrs.getOptSUMORealReporting(SUMO_ATTR_X, id.c_str(), ok, INVALID_POSITION); SUMOReal y = attrs.getOptSUMORealReporting(SUMO_ATTR_Y, id.c_str(), ok, INVALID_POSITION); SUMOReal lanePos = attrs.getOptSUMORealReporting(SUMO_ATTR_POSITION, id.c_str(), ok, INVALID_POSITION); - int layer = attrs.getOptIntReporting(SUMO_ATTR_LAYER, id.c_str(), ok, GLO_SHAPE); + SUMOReal layer = attrs.getOptSUMORealReporting(SUMO_ATTR_LAYER, id.c_str(), ok, (SUMOReal)GLO_POI); std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok, ""); std::string laneID = attrs.getOptStringReporting(SUMO_ATTR_LANE, id.c_str(), ok, ""); - std::string colorStr = attrs.getOptStringReporting(SUMO_ATTR_COLOR, id.c_str(), ok, "1,0,0"); - RGBColor color = RGBColor::parseColorReporting(colorStr, attrs.getObjectType(), id.c_str(), true, ok); + RGBColor color = attrs.hasAttribute(SUMO_ATTR_COLOR) ? attrs.getColorReporting(id.c_str(), ok) : RGBColor(1, 0, 0); + SUMOReal angle = attrs.getOptSUMORealReporting(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); + std::string imgFile = attrs.getOptStringReporting(SUMO_ATTR_IMGFILE, id.c_str(), ok, Shape::DEFAULT_IMG_FILE); + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } + SUMOReal width = attrs.getOptSUMORealReporting(SUMO_ATTR_WIDTH, id.c_str(), ok, Shape::DEFAULT_IMG_WIDTH); + SUMOReal height = attrs.getOptSUMORealReporting(SUMO_ATTR_HEIGHT, id.c_str(), ok, Shape::DEFAULT_IMG_HEIGHT); if (!ok) { return; } @@ -665,7 +556,7 @@ } pos = lane->getShape().positionAtLengthPosition(lanePos); } - if (!myNet.getShapeContainer().addPoI(id, layer, type, color, pos)) { + if (!myNet.getShapeContainer().addPOI(id, type, color, layer, angle, imgFile, pos, width, height)) { WRITE_ERROR("PoI '" + id + "' already exists."); } } @@ -679,14 +570,19 @@ if (!ok) { return; } - int layer = attrs.getOptIntReporting(SUMO_ATTR_LAYER, id.c_str(), ok, GLO_SHAPE); + SUMOReal layer = attrs.getOptSUMORealReporting(SUMO_ATTR_LAYER, id.c_str(), ok, (SUMOReal)GLO_POLYGON); bool fill = attrs.getOptBoolReporting(SUMO_ATTR_FILL, id.c_str(), ok, false); std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok, ""); std::string colorStr = attrs.getStringReporting(SUMO_ATTR_COLOR, id.c_str(), ok); - RGBColor color = RGBColor::parseColorReporting(colorStr, attrs.getObjectType(), id.c_str(), true, ok); - PositionVector shape = GeomConvHelper::parseShapeReporting(attrs.getStringReporting(SUMO_ATTR_SHAPE, id.c_str(), ok), attrs.getObjectType(), id.c_str(), ok, false); + RGBColor color = attrs.getColorReporting(id.c_str(), ok); + PositionVector shape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, id.c_str(), ok, false); + SUMOReal angle = attrs.getOptSUMORealReporting(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); + std::string imgFile = attrs.getOptStringReporting(SUMO_ATTR_IMGFILE, id.c_str(), ok, Shape::DEFAULT_IMG_FILE); + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } if (shape.size() != 0) { - if (!myNet.getShapeContainer().addPolygon(id, layer, type, color, fill, shape)) { + if (!myNet.getShapeContainer().addPolygon(id, type, color, layer, angle, imgFile, shape, fill)) { WRITE_ERROR("Polygon '" + id + "' already exists."); } } @@ -694,30 +590,6 @@ void -NLHandler::addLogicItem(const SUMOSAXAttributes& attrs) { - bool ok = true; - int request = attrs.getIntReporting(SUMO_ATTR_REQUEST, 0, ok); - bool cont = false; -#ifdef HAVE_INTERNAL_LANES - cont = attrs.getOptBoolReporting(SUMO_ATTR_CONT, 0, ok, false); -#endif - std::string response = attrs.getStringReporting(SUMO_ATTR_RESPONSE, 0, ok); - std::string foes = attrs.getStringReporting(SUMO_ATTR_FOES, 0, ok); - if (!ok) { - return; - } - // store received information - if (request >= 0 && response.length() > 0) { - try { - myJunctionControlBuilder.addLogicItem(request, response, foes, cont); - } catch (InvalidArgument& e) { - WRITE_ERROR(e.what()); - } - } -} - - -void NLHandler::addRequest(const SUMOSAXAttributes& attrs) { if (myCurrentIsBroken) { return; @@ -797,26 +669,8 @@ } // if the traffic light is an actuated traffic light, try to get // the minimum and maximum durations - SUMOTime minDuration = -1; - if (attrs.hasAttribute(SUMO_ATTR_MINDURATION__DEPRECATED)) { - minDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_MINDURATION__DEPRECATED, myJunctionControlBuilder.getActiveKey().c_str(), ok); - if (!myHaveWarnedAboutDeprecatedTLSTiming) { - myHaveWarnedAboutDeprecatedTLSTiming = true; - WRITE_WARNING("Your tls definition contains deprecated minimum/maximum duration attribute; use minDur and maxDur instead."); - } - } else { - minDuration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MINDURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok, -1); - } - SUMOTime maxDuration = -1; - if (attrs.hasAttribute(SUMO_ATTR_MAXDURATION__DEPRECATED)) { - maxDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_MAXDURATION__DEPRECATED, myJunctionControlBuilder.getActiveKey().c_str(), ok); - if (!myHaveWarnedAboutDeprecatedTLSTiming) { - myHaveWarnedAboutDeprecatedTLSTiming = true; - WRITE_WARNING("Your tls definition contains deprecated minimum/maximum duration attribute; use minDur and maxDur instead."); - } - } else { - maxDuration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MAXDURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok, -1); - } + SUMOTime minDuration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MINDURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok, -1); + SUMOTime maxDuration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MAXDURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok, -1); myJunctionControlBuilder.addPhase(duration, state, minDuration, maxDuration); } @@ -852,7 +706,6 @@ if (!ok) { return; } - // inform the user about deprecated values const SUMOTime frequency = attrs.getSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok); const SUMOReal position = attrs.getSUMORealReporting(SUMO_ATTR_POSITION, id.c_str(), ok); const bool friendlyPos = attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false); @@ -882,7 +735,6 @@ if (!ok) { return; } - // inform the user about deprecated values const SUMOReal position = attrs.getSUMORealReporting(SUMO_ATTR_POSITION, id.c_str(), ok); const bool friendlyPos = attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false); const std::string lane = attrs.getStringReporting(SUMO_ATTR_LANE, id.c_str(), ok); @@ -999,24 +851,10 @@ void NLHandler::beginE3Detector(const SUMOSAXAttributes& attrs) { bool ok = true; - // inform the user about deprecated values std::string id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); - if (attrs.hasAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD__DEPRECATED)) { - myHaveWarnedAboutDeprecatedTimeThreshold = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_HALTING_TIME_THRESHOLD__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_ATTR_HALTING_TIME_THRESHOLD) + "'."); - } - if (attrs.hasAttribute(SUMO_ATTR_HALTING_SPEED_THRESHOLD__DEPRECATED)) { - myHaveWarnedAboutDeprecatedSpeedThreshold = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_HALTING_SPEED_THRESHOLD__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_ATTR_HALTING_SPEED_THRESHOLD) + "'."); - } - const SUMOTime frequency = attrs.getSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok); - const SUMOTime haltingTimeThreshold = attrs.hasAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD__DEPRECATED) - ? attrs.getOptSUMOTimeReporting(SUMO_ATTR_HALTING_TIME_THRESHOLD__DEPRECATED, id.c_str(), ok, TIME2STEPS(1)) - : attrs.getOptSUMOTimeReporting(SUMO_ATTR_HALTING_TIME_THRESHOLD, id.c_str(), ok, TIME2STEPS(1)); - const SUMOReal haltingSpeedThreshold = attrs.hasAttribute(SUMO_ATTR_HALTING_SPEED_THRESHOLD__DEPRECATED) - ? attrs.getOptSUMORealReporting(SUMO_ATTR_HALTING_SPEED_THRESHOLD__DEPRECATED, id.c_str(), ok, 5.0f / 3.6f) - : attrs.getOptSUMORealReporting(SUMO_ATTR_HALTING_SPEED_THRESHOLD, id.c_str(), ok, 5.0f / 3.6f); + const SUMOTime haltingTimeThreshold = attrs.getOptSUMOTimeReporting(SUMO_ATTR_HALTING_TIME_THRESHOLD, id.c_str(), ok, TIME2STEPS(1)); + const SUMOReal haltingSpeedThreshold = attrs.getOptSUMORealReporting(SUMO_ATTR_HALTING_SPEED_THRESHOLD, id.c_str(), ok, 5.0f / 3.6f); const std::string file = attrs.getStringReporting(SUMO_ATTR_FILE, id.c_str(), ok); if (!ok) { return; @@ -1072,13 +910,6 @@ const std::string file = attrs.getStringReporting(SUMO_ATTR_FILE, id.c_str(), ok); const std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok, "performance"); std::string vtypes = attrs.getOptStringReporting(SUMO_ATTR_VTYPES, id.c_str(), ok, ""); - if (attrs.hasAttribute(SUMO_ATTR_VTYPES__DEPRECATED)) { - vtypes = attrs.getStringReporting(SUMO_ATTR_VTYPES__DEPRECATED, id.c_str(), ok); - if (!myHaveWarnedAboutDeprecatedVTypes) { - WRITE_WARNING("'" + toString(SUMO_ATTR_VTYPES__DEPRECATED) + " is deprecated; please use '" + toString(SUMO_ATTR_VTYPES) + "'."); - myHaveWarnedAboutDeprecatedVTypes = true; - } - } 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"))); @@ -1101,65 +932,6 @@ } - -void -NLHandler::openSucc(const SUMOSAXAttributes& attrs) { - bool ok = true; - std::string id = attrs.getStringReporting(SUMO_ATTR_LANE, 0, ok); - if (!MSGlobals::gUsingInternalLanes && id[0] == ':') { - myCurrentIsInternalToSkip = true; - return; - } - myCurrentIsInternalToSkip = false; - mySucceedingLaneBuilder.openSuccLane(id); -} - - -void -NLHandler::addSuccLane(const SUMOSAXAttributes& attrs) { - // do not process internal lanes if not wished - if (myCurrentIsInternalToSkip) { - return; - } - try { - bool ok = true; - SUMOReal pass = attrs.getOptSUMORealReporting(SUMO_ATTR_PASS, 0, ok, -1); - std::string lane = attrs.getStringReporting(SUMO_ATTR_LANE, 0, ok); - std::string dir = attrs.getStringReporting(SUMO_ATTR_DIR, 0, ok); - std::string state = attrs.getStringReporting(SUMO_ATTR_STATE, 0, ok); - std::string tlID = attrs.getOptStringReporting(SUMO_ATTR_TLID, 0, ok, ""); -#ifdef HAVE_INTERNAL_LANES - std::string via = attrs.getOptStringReporting(SUMO_ATTR_VIA, 0, ok, ""); -#endif - if (!ok) { - return; - } - if (tlID != "") { - int linkNumber = attrs.hasAttribute(SUMO_ATTR_TLLINKINDEX) - ? attrs.getIntReporting(SUMO_ATTR_TLLINKINDEX, 0, ok) - : attrs.getIntReporting(SUMO_ATTR_TLLINKNO__DEPRECATED, 0, ok); - if (!ok) { - return; - } - mySucceedingLaneBuilder.addSuccLane(lane, -#ifdef HAVE_INTERNAL_LANES - via, pass, -#endif - parseLinkDir(dir), parseLinkState(state), tlID, linkNumber); - } else { - mySucceedingLaneBuilder.addSuccLane(lane, -#ifdef HAVE_INTERNAL_LANES - via, pass, -#endif - parseLinkDir(dir), parseLinkState(state)); - } - } catch (InvalidArgument& e) { - WRITE_ERROR(e.what()); - } -} - - - void NLHandler::addConnection(const SUMOSAXAttributes& attrs) { bool ok = true; @@ -1170,24 +942,14 @@ try { bool ok = true; - std::string toID = attrs.getStringReporting(SUMO_ATTR_TO, 0, ok); - std::string laneIndices; - if (attrs.hasAttribute(SUMO_ATTR_LANE)) { - if (!myHaveWarnedAboutDeprecatedLanes) { - myHaveWarnedAboutDeprecatedLanes = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_LANE) + "' is deprecated, please use '" + toString(SUMO_ATTR_FROM_LANE) + - "' and '" + toString(SUMO_ATTR_TO_LANE) + "' instead."); - } - laneIndices = attrs.getStringReporting(SUMO_ATTR_LANE, 0, ok); - } else { - laneIndices = attrs.getStringReporting(SUMO_ATTR_FROM_LANE, 0, ok) + ":" + attrs.getStringReporting(SUMO_ATTR_TO_LANE, 0, ok); - } + const std::string toID = attrs.getStringReporting(SUMO_ATTR_TO, 0, ok); + const int fromLaneIdx = attrs.getIntReporting(SUMO_ATTR_FROM_LANE, 0, ok); + const int toLaneIdx = attrs.getIntReporting(SUMO_ATTR_TO_LANE, 0, ok); LinkDirection dir = parseLinkDir(attrs.getStringReporting(SUMO_ATTR_DIR, 0, ok)); LinkState state = parseLinkState(attrs.getStringReporting(SUMO_ATTR_STATE, 0, ok)); std::string tlID = attrs.getOptStringReporting(SUMO_ATTR_TLID, 0, ok, ""); #ifdef HAVE_INTERNAL_LANES std::string viaID = attrs.getOptStringReporting(SUMO_ATTR_VIA, 0, ok, ""); - SUMOReal pass = attrs.getOptSUMORealReporting(SUMO_ATTR_PASS, 0, ok, -1); #endif MSEdge* from = MSEdge::dictionary(fromID); @@ -1200,23 +962,22 @@ WRITE_ERROR("Unknown to-edge '" + toID + "' in connection"); return; } - std::pair lanes = getLanesFromIndices(from, to, laneIndices, ok); - if (!ok) { + if (fromLaneIdx < 0 || static_cast(fromLaneIdx) >= from->getLanes().size() || + toLaneIdx < 0 || static_cast(toLaneIdx) >= to->getLanes().size()) { + WRITE_ERROR("Invalid lane index in connection from '" + from->getID() + "' to '" + to->getID() + "'."); return; } - MSLane* fromLane = lanes.first; - MSLane* toLane = lanes.second; + MSLane* fromLane = from->getLanes()[fromLaneIdx]; + MSLane* toLane = to->getLanes()[toLaneIdx]; assert(fromLane); assert(toLane); - int tlLinkIdx; + int tlLinkIdx = -1; if (tlID != "") { - tlLinkIdx = attrs.hasAttribute(SUMO_ATTR_TLLINKINDEX) - ? attrs.getIntReporting(SUMO_ATTR_TLLINKINDEX, 0, ok) - : attrs.getIntReporting(SUMO_ATTR_TLLINKNO__DEPRECATED, 0, ok); + tlLinkIdx = attrs.getIntReporting(SUMO_ATTR_TLLINKINDEX, 0, ok); // make sure that the index is in range MSTrafficLightLogic* logic = myJunctionControlBuilder.getTLLogic(tlID).getActive(); - if (tlLinkIdx >= (int)logic->getCurrentPhaseDef().getState().size()) { + if (tlLinkIdx < 0 || tlLinkIdx >= (int)logic->getCurrentPhaseDef().getState().size()) { WRITE_ERROR("Invalid " + toString(SUMO_ATTR_TLLINKINDEX) + " '" + toString(tlLinkIdx) + "' in connection controlled by '" + tlID + "'"); return; @@ -1240,9 +1001,6 @@ } length = via->getLength(); } - if (pass >= 0) { - static_cast(toLane)->setPassPosition(pass); - } link = new MSLink(toLane, via, dir, state, length); if (via != 0) { via->addIncomingLane(fromLane, link); @@ -1258,8 +1016,7 @@ // if a traffic light is responsible for it, inform the traffic light // check whether this link is controlled by a traffic light if (tlID != "") { - MSTLLogicControl::TLSLogicVariants& logics = myJunctionControlBuilder.getTLLogic(tlID); - logics.addLink(link, fromLane, tlLinkIdx); + myJunctionControlBuilder.getTLLogic(tlID).addLink(link, fromLane, tlLinkIdx); } // add the link fromLane->addLink(link); @@ -1295,51 +1052,20 @@ } -std::pair -NLHandler::getLanesFromIndices(MSEdge* from, MSEdge* to, const std::string& laneIndices, bool& ok) { - std::string error = "Invalid attribute in connection from '" + from->getID() + "' to '" + to->getID() + "' "; - StringTokenizer st(laneIndices, ':'); - if (st.size() == 2) { - int fromLaneIdx; - int toLaneIdx; - try { - fromLaneIdx = TplConvertSec::_2intSec(st.next().c_str(), -1); - toLaneIdx = TplConvertSec::_2intSec(st.next().c_str(), -1); - if (fromLaneIdx >= 0 && static_cast(fromLaneIdx) < from->getLanes().size() && - toLaneIdx >= 0 && static_cast(toLaneIdx) < to->getLanes().size()) { - return std::pair(from->getLanes()[fromLaneIdx], to->getLanes()[toLaneIdx]); - } else { - error += "(invalid index)"; - } - } catch (NumberFormatException&) { - error += "(number format)"; - } - } else { - error += "(malformed)"; - } - WRITE_ERROR(error); - ok = false; - return std::pair(static_cast(0), static_cast(0)); -} - - // ---------------------------------- void NLHandler::setLocation(const SUMOSAXAttributes& attrs) { bool ok = true; - PositionVector s = GeomConvHelper::parseShapeReporting( - attrs.getStringReporting(SUMO_ATTR_NET_OFFSET, 0, ok), - attrs.getObjectType(), 0, ok, false); - Boundary convBoundary = GeomConvHelper::parseBoundaryReporting( - attrs.getStringReporting(SUMO_ATTR_CONV_BOUNDARY, 0, ok), - attrs.getObjectType(), 0, ok); - Boundary origBoundary = GeomConvHelper::parseBoundaryReporting( - attrs.getStringReporting(SUMO_ATTR_ORIG_BOUNDARY, 0, ok), - attrs.getObjectType(), 0, ok); + PositionVector s = attrs.getShapeReporting(SUMO_ATTR_NET_OFFSET, 0, ok, false); + Boundary convBoundary = attrs.getBoundaryReporting(SUMO_ATTR_CONV_BOUNDARY, 0, ok); + Boundary origBoundary = attrs.getBoundaryReporting(SUMO_ATTR_ORIG_BOUNDARY, 0, ok); std::string proj = attrs.getStringReporting(SUMO_ATTR_ORIG_PROJ, 0, ok); if (ok) { Position networkOffset = s[0]; GeoConvHelper::init(proj, networkOffset, origBoundary, convBoundary); + if (OptionsCont::getOptions().getBool("fcd-output.geo") && !GeoConvHelper::getFinal().usingGeoProjection()) { + WRITE_WARNING("no valid geo projection loaded from network. fcd-output.geo will not work"); + } } } @@ -1355,18 +1081,18 @@ return; } try { - MSEdge* sink = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-sink"); + MSEdge* sink = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-sink", MSEdge::EDGEFUNCTION_DISTRICT); if (!MSEdge::dictionary(myCurrentDistrictID + "-sink", sink)) { delete sink; throw InvalidArgument("Another edge with the id '" + myCurrentDistrictID + "-sink' exists."); } - sink->initialize(new std::vector(), MSEdge::EDGEFUNCTION_DISTRICT); - MSEdge* source = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-source"); + sink->initialize(new std::vector()); + MSEdge* source = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-source", MSEdge::EDGEFUNCTION_DISTRICT); if (!MSEdge::dictionary(myCurrentDistrictID + "-source", source)) { delete source; throw InvalidArgument("Another edge with the id '" + myCurrentDistrictID + "-source' exists."); } - source->initialize(new std::vector(), MSEdge::EDGEFUNCTION_DISTRICT); + source->initialize(new std::vector()); if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { std::vector desc = StringTokenizer(attrs.getString(SUMO_ATTR_EDGES)).getVector(); for (std::vector::const_iterator i = desc.begin(); i != desc.end(); ++i) { @@ -1409,22 +1135,6 @@ // ---------------------------------- - - -void -NLHandler::closeSuccLane() { - // do not process internal lanes if not wished - if (myCurrentIsInternalToSkip) { - return; - } - try { - mySucceedingLaneBuilder.closeSuccLane(); - } catch (InvalidArgument& e) { - WRITE_ERROR(e.what()); - } -} - - void NLHandler::endE3Detector() { try { diff -Nru sumo-0.15.0~dfsg/src/netload/NLHandler.h sumo-0.16.0~dfsg/src/netload/NLHandler.h --- sumo-0.15.0~dfsg/src/netload/NLHandler.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLHandler.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Clemens Honomichl /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NLHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NLHandler.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The XML-Handler for network loading /****************************************************************************/ @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,6 @@ #include #include "NLBuilder.h" #include "NLDiscreteEventBuilder.h" -#include "NLSucceedingLaneBuilder.h" // =========================================================================== @@ -86,11 +86,11 @@ NLHandler(const std::string& file, MSNet& net, NLDetectorBuilder& detBuilder, NLTriggerBuilder& triggerBuilder, NLEdgeControlBuilder& edgeBuilder, - NLJunctionControlBuilder& junctionBuilder) ; + NLJunctionControlBuilder& junctionBuilder); /// @brief Destructor - virtual ~NLHandler() ; + virtual ~NLHandler(); protected: @@ -106,7 +106,7 @@ * @todo Refactor/describe */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -116,7 +116,7 @@ * @see GenericSAXHandler::myEndElement * @todo Refactor/describe */ - virtual void myEndElement(int element) ; + virtual void myEndElement(int element); //@} @@ -161,7 +161,7 @@ */ virtual void addVTypeProbeDetector(const SUMOSAXAttributes& attrs); - /** @brief Builds a routeprobe-detector using the given specification + /** @brief Builds a routeProbe-detector using the given specification * @param[in] attrs The attributes that define the detector */ virtual void addRouteProbeDetector(const SUMOSAXAttributes& attrs); @@ -194,9 +194,6 @@ /// adds a polygon void addPoly(const SUMOSAXAttributes& attrs); - /// (deprecated) adds a logic item to the current logic - void addLogicItem(const SUMOSAXAttributes& attrs); - /// adds a request item to the current junction logic void addRequest(const SUMOSAXAttributes& attrs); @@ -213,19 +210,13 @@ /// opens a junction for processing virtual void openJunction(const SUMOSAXAttributes& attrs); - void parseLanes(const std::string& junctionID, const std::string& def, std::vector &into, bool& ok); + void parseLanes(const std::string& junctionID, const std::string& def, std::vector& into, bool& ok); #ifdef _MESSAGES /// adds a message emitter void addMsgEmitter(const SUMOSAXAttributes& attrs); #endif - /// opens the container of succeeding lanes for processing (deprecated, see addConnection)) - void openSucc(const SUMOSAXAttributes& attrs); - - /// adds a succeeding lane (deprecated, see addConnection) - void addSuccLane(const SUMOSAXAttributes& attrs); - /// adds a connection void addConnection(const SUMOSAXAttributes& attrs); @@ -245,7 +236,7 @@ * @param[in] attrs The attributes (of the "district"-element) to parse * @exception ProcessError If an edge given in district@edges is not known */ - void addDistrict(const SUMOSAXAttributes& attrs) ; + void addDistrict(const SUMOSAXAttributes& attrs); /** @begin Parses a district edge and connects it to the district @@ -263,18 +254,12 @@ void closeWAUT(); - /// closes the processing of a lane - void closeSuccLane(); - /// @brief Parses the given character into an enumeration typed link direction LinkDirection parseLinkDir(const std::string& dir); /// @brief Parses the given character into an enumeration typed link state LinkState parseLinkState(const std::string& state); - /// @brief retrieves based on the edges and an index specifier (i.e. '0:1') - std::pair getLanesFromIndices(MSEdge* from, MSEdge* to, const std::string& laneIndices, bool& ok); - protected: /// @brief A builder for object actions @@ -296,9 +281,6 @@ /// @brief The junction builder to use NLJunctionControlBuilder& myJunctionControlBuilder; - /// @brief The lane-to-lane connections builder to use - NLSucceedingLaneBuilder mySucceedingLaneBuilder; - /// The id of the current district @@ -318,19 +300,9 @@ bool myCurrentIsBroken; - bool myHaveWarnedAboutDeprecatedE1, myHaveWarnedAboutDeprecatedE2, - myHaveWarnedAboutDeprecatedE3, myHaveWarnedAboutDeprecatedDetEntry, - myHaveWarnedAboutDeprecatedDetExit, myHaveWarnedAboutDeprecatedTimedEvent; - bool myHaveWarnedAboutDeprecatedRowLogic, myHaveWarnedAboutDeprecatedTLLogic; - bool myHaveWarnedAboutDeprecatedTLSTiming; - bool myHaveWarnedAboutDeprecatedTimeThreshold, - myHaveWarnedAboutDeprecatedSpeedThreshold, - myHaveWarnedAboutDeprecatedJamDistThreshold; - bool myHaveWarnedAboutDeprecatedVTypeProbe, myHaveWarnedAboutDeprecatedRouteProbe, - myHaveWarnedAboutDeprecatedEdgeMean, myHaveWarnedAboutDeprecatedLaneMean; - bool myHaveWarnedAboutDeprecatedVTypes, myHaveWarnedAboutDeprecatedLanes; - bool myHaveWarnedAboutDeprecatedDistrict, myHaveWarnedAboutDeprecatedDSource, myHaveWarnedAboutDeprecatedDSink; + bool myHaveWarnedAboutDeprecatedLanes; + Parameterised* myLastParameterised; private: /** invalid copy constructor */ diff -Nru sumo-0.15.0~dfsg/src/netload/NLJunctionControlBuilder.cpp sumo-0.16.0~dfsg/src/netload/NLJunctionControlBuilder.cpp --- sumo-0.15.0~dfsg/src/netload/NLJunctionControlBuilder.cpp 2012-01-26 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLJunctionControlBuilder.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLJunctionControlBuilder.cpp 11788 2012-01-25 12:19:02Z namdre $ +/// @version $Id: NLJunctionControlBuilder.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Builder of microsim-junctions and tls /****************************************************************************/ @@ -84,22 +84,20 @@ void NLJunctionControlBuilder::openJunction(const std::string& id, const std::string& key, - const std::string& type, + const SumoXMLNodeType type, SUMOReal x, SUMOReal y, const PositionVector& shape, - const std::vector &incomingLanes, - const std::vector &internalLanes) throw(InvalidArgument) { + const std::vector& incomingLanes, + const std::vector& internalLanes) throw(InvalidArgument) { #ifdef HAVE_INTERNAL_LANES myActiveInternalLanes = internalLanes; +#else + UNUSED_PARAMETER(internalLanes); #endif myActiveIncomingLanes = incomingLanes; myActiveID = id; myActiveKey = key; - if (!SUMOXMLDefinitions::NodeTypes.hasString(type)) { - throw InvalidArgument("An unknown or invalid junction type '" + type + "' occured in junction '" + id + "'."); - } - - myType = SUMOXMLDefinitions::NodeTypes.get(type); + myType = type; myPosition.set(x, y); myShape = shape; } @@ -306,12 +304,12 @@ // initialize myRequestSize = (int)response.size(); } - if (response.size() != myRequestSize) { + if (static_cast(response.size()) != myRequestSize) { myCurrentHasError = true; throw InvalidArgument("Invalid response size " + toString(response.size()) + " in Junction logic '" + myActiveKey + "' (expected " + toString(myRequestSize) + ")"); } - if (foes.size() != myRequestSize) { + if (static_cast(foes.size()) != myRequestSize) { myCurrentHasError = true; throw InvalidArgument("Invalid foes size " + toString(foes.size()) + " in Junction logic '" + myActiveKey + "' (expected " + toString(myRequestSize) + ")"); diff -Nru sumo-0.15.0~dfsg/src/netload/NLJunctionControlBuilder.h sumo-0.16.0~dfsg/src/netload/NLJunctionControlBuilder.h --- sumo-0.15.0~dfsg/src/netload/NLJunctionControlBuilder.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLJunctionControlBuilder.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLJunctionControlBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NLJunctionControlBuilder.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Builder of microsim-junctions and tls /****************************************************************************/ @@ -79,7 +79,7 @@ * @param[in] net The network to fill * @param[in] db The detector builder to use */ - NLJunctionControlBuilder(MSNet& net, NLDetectorBuilder& db) ; + NLJunctionControlBuilder(MSNet& net, NLDetectorBuilder& db); /** @brief Destructor @@ -87,7 +87,7 @@ * Deletes previously allocated "myLogicControl" and "myJunctions" if * they were not previously returned (this may happen if an error occured). */ - virtual ~NLJunctionControlBuilder() ; + virtual ~NLJunctionControlBuilder(); /** @brief Begins the processing of the named junction @@ -104,10 +104,10 @@ * @todo Check why "key" is given */ void openJunction(const std::string& id, const std::string& key, - const std::string& type, SUMOReal x, SUMOReal y, + const SumoXMLNodeType type, SUMOReal x, SUMOReal y, const PositionVector& shape, - const std::vector &incomingLanes, - const std::vector &internalLanes) throw(InvalidArgument); + const std::vector& incomingLanes, + const std::vector& internalLanes) throw(InvalidArgument); /** @brief Closes (ends) the processing of the current junction @@ -132,13 +132,13 @@ * * @return The built junction control */ - MSJunctionControl* build() const ; + MSJunctionControl* build() const; /** @brief Initialises a junction logic * @param[in] id The id of the row-logic */ - void initJunctionLogic(const std::string& id) ; + void initJunctionLogic(const std::string& id); /** @brief Adds a logic item @@ -166,7 +166,7 @@ * @todo Recheck, describe usage of detectorOffset (where does the information come from?) */ void initTrafficLightLogic(const std::string& id, const std::string& programID, - TrafficLightType type, SUMOTime offset) ; + TrafficLightType type, SUMOTime offset); /** @brief Adds a phase to the currently built traffic lights logic @@ -179,7 +179,7 @@ * @todo min/max: maybe only one type of a phase definition should be built */ void addPhase(SUMOTime duration, const std::string& state, - int min, int max) ; + int min, int max); /** @brief Returns a previously build tls logic @@ -201,7 +201,7 @@ * @exception ProcessError If the traffic lights were not correct * @see MSTLLogicControl::closeNetworkReading */ - MSTLLogicControl* buildTLLogics() const ; + MSTLLogicControl* buildTLLogics() const; /** @brief Ends the building of a traffic lights logic @@ -235,19 +235,19 @@ * @todo Where are these parameter used? Describe! * @todo Can a parameter be overwritten? */ - void addParam(const std::string& key, const std::string& value) ; + void addParam(const std::string& key, const std::string& value); /** @brief Returns the active key * @return The active key */ - const std::string& getActiveKey() const ; + const std::string& getActiveKey() const; /** @brief Returns the active sub key * @return The active sub key */ - const std::string& getActiveSubKey() const ; + const std::string& getActiveSubKey() const; /** @brief Returns the used tls control @@ -257,7 +257,7 @@ * * @return The tls control to use */ - MSTLLogicControl& getTLLogicControlToUse() const ; + MSTLLogicControl& getTLLogicControlToUse() const; protected: @@ -283,7 +283,7 @@ * * @return The built junction */ - virtual MSJunction* buildNoLogicJunction() ; + virtual MSJunction* buildNoLogicJunction(); /** @brief Builds a junction with a logic @@ -304,7 +304,7 @@ * * @return The built junction */ - virtual MSJunction* buildInternalJunction() ; + virtual MSJunction* buildInternalJunction(); #endif /// @} diff -Nru sumo-0.15.0~dfsg/src/netload/NLSucceedingLaneBuilder.cpp sumo-0.16.0~dfsg/src/netload/NLSucceedingLaneBuilder.cpp --- sumo-0.15.0~dfsg/src/netload/NLSucceedingLaneBuilder.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLSucceedingLaneBuilder.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,191 +0,0 @@ -/****************************************************************************/ -/// @file NLSucceedingLaneBuilder.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Mon, 22 Oct 2001 -/// @version $Id: NLSucceedingLaneBuilder.cpp 11671 2012-01-07 20:14:30Z behrisch $ -/// -// Temporary storage for a lanes succeeding lanes while parsing them -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "NLBuilder.h" -#include "NLSucceedingLaneBuilder.h" -#include "NLJunctionControlBuilder.h" -#include -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -NLSucceedingLaneBuilder::NLSucceedingLaneBuilder(NLJunctionControlBuilder& jb) - : myJunctionControlBuilder(jb) { - mySuccLanes = new MSLinkCont(); - mySuccLanes->reserve(10); -} - - -NLSucceedingLaneBuilder::~NLSucceedingLaneBuilder() { - delete mySuccLanes; -} - - -void -NLSucceedingLaneBuilder::openSuccLane(const std::string& laneId) { - myCurrentLane = laneId; -} - - -void -NLSucceedingLaneBuilder::addSuccLane(const std::string& laneId, -#ifdef HAVE_INTERNAL_LANES - const std::string& viaID, - SUMOReal pass, -#endif - LinkDirection dir, - LinkState state, - const std::string& tlid, unsigned int linkNo) throw(InvalidArgument) { - // check whether the link is a dead link - if (laneId == "SUMO_NO_DESTINATION") { - // build the dead link and add it to the container -#ifdef HAVE_INTERNAL_LANES - MSLink* link = new MSLink(0, 0, LINKDIR_NODIR, LINKSTATE_DEADEND, 0.); -#else - MSLink* link = new MSLink(0, LINKDIR_NODIR, LINKSTATE_DEADEND, 0.); -#endif - mySuccLanes->push_back(link); - if (tlid != "") { - MSTLLogicControl::TLSLogicVariants& logics = myJunctionControlBuilder.getTLLogic(tlid); - MSLane* current = MSLane::dictionary(myCurrentLane); - if (current == 0) { - throw InvalidArgument("An unknown lane ('" + myCurrentLane + "') should be assigned to a tl-logic."); - } - logics.addLink(link, current, linkNo); - } - return; - } - - // get the lane the link belongs to - MSLane* lane = MSLane::dictionary(laneId); - if (lane == 0) { - throw InvalidArgument("An unknown lane ('" + laneId + "') should be set as a follower for lane '" + myCurrentLane + "'."); - } -#ifdef HAVE_INTERNAL_LANES - MSLane* via = 0; - if (viaID != "" && MSGlobals::gUsingInternalLanes) { - via = MSLane::dictionary(viaID); - if (via == 0) { - throw InvalidArgument("An unknown lane ('" + viaID + "') should be set as a via-lane for lane '" + myCurrentLane + "'."); - } - } - if (pass >= 0) { - static_cast(lane)->setPassPosition(pass); - } -#endif - MSLane* orig = MSLane::dictionary(myCurrentLane); - if (orig == 0) { - return; - } - - - // build the link - SUMOReal length = orig != 0 && lane != 0 - ? orig->getShape()[-1].distanceTo(lane->getShape()[0]) - : 0; -#ifdef HAVE_INTERNAL_LANES - if (via != 0) { - length = via->getLength(); - } - MSLink* link = new MSLink(lane, via, dir, state, length); -#else - MSLink* link = new MSLink(lane, dir, state, length); -#endif - - MSLane* clane = MSLane::dictionary(myCurrentLane); - if (clane != 0) { -#ifdef HAVE_INTERNAL_LANES - if (via != 0) { - via->addIncomingLane(clane, link); - } else { - lane->addIncomingLane(clane, link); - } -#else - lane->addIncomingLane(clane, link); -#endif - lane->addApproachingLane(clane); - } - // if a traffic light is responsible for it, inform the traffic light - // check whether this link is controlled by a traffic light - if (tlid != "") { - MSTLLogicControl::TLSLogicVariants& logics = myJunctionControlBuilder.getTLLogic(tlid); - MSLane* current = MSLane::dictionary(myCurrentLane); - if (current == 0) { - throw InvalidArgument("An unknown lane ('" + myCurrentLane + "') should be assigned to a tl-logic."); - } - logics.addLink(link, current, linkNo); - } - // add the link to the container - mySuccLanes->push_back(link); -} - - -void -NLSucceedingLaneBuilder::closeSuccLane() throw(InvalidArgument) { - MSLane* current = MSLane::dictionary(myCurrentLane); - if (current == 0) { - throw InvalidArgument("Trying to close connections of an unknown lane ('" + myCurrentLane + "')."); - } - MSLinkCont* cont = new MSLinkCont(); - cont->reserve(mySuccLanes->size()); - copy(mySuccLanes->begin(), mySuccLanes->end(), back_inserter(*cont)); - current->initialize(cont); - mySuccLanes->clear(); -} - - -const std::string& -NLSucceedingLaneBuilder::getCurrentLaneName() const { - return myCurrentLane; -} - - - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/netload/NLSucceedingLaneBuilder.h sumo-0.16.0~dfsg/src/netload/NLSucceedingLaneBuilder.h --- sumo-0.15.0~dfsg/src/netload/NLSucceedingLaneBuilder.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLSucceedingLaneBuilder.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,145 +0,0 @@ -/****************************************************************************/ -/// @file NLSucceedingLaneBuilder.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @date Mon, 22 Oct 2001 -/// @version $Id: NLSucceedingLaneBuilder.h 11671 2012-01-07 20:14:30Z behrisch $ -/// -// Temporary storage for a lanes succeeding lanes while parsing them -// This class is only used when parsing legacy networks using tags succ/succlane -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ -#ifndef NLSucceedingLaneBuilder_h -#define NLSucceedingLaneBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class MSJunction; -class NLJunctionControlBuilder; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class NLSucceedingLaneBuilder - * @brief Temporary storage for a lanes succeeding lanes while parsing them - * @todo Consider moving this functionality to another class - */ -class NLSucceedingLaneBuilder { -public: - /** @brief Constructor - * - * @param[in] jb The junction control builder to obtain referenced tls from - */ - NLSucceedingLaneBuilder(NLJunctionControlBuilder& jb) ; - - - /// @brief Destructor - ~NLSucceedingLaneBuilder() ; - - - /** @brief Begins the computation of a container holding the succeeding lanes of a lane - * - * @param[in] laneId The id of the lane from which connections will be built - * @todo Why is the ID kept, not already the lane itself? - */ - void openSuccLane(const std::string& laneId) ; - - - /** @brief Adds a succeeding lane - * - * If either the current, or the succeeding lane is not known, an InvalidArgument - * is thrown (with the proper message). Also if a tls-logic is referenced, but - * not known to the junction control builder, an InvalidArgument is thrown. - * - * @param[in] laneId ID of the lane to add a connection to (from the last opened lane) - * @param[in] viaID The junction-internal lane to use to reach the destination lane - * @param[in] pass Theoretically: the maximum filling rate at the internal link; unused currently - * @param[in] dir The abstract direction of the link - * @param[in] state The abstract state of the link - * @param[in] tlid (optional) ID of the tls that controls the link - * @param[in] linkNo (optional) index of the link within the controlling tls - * @todo Recheck usage of "pass" - * @exception InvalidArgument If one of the referenced structures was not found or is invalid - * @see LinkDirection - * @see LinkState - * @see MSLink - */ - void addSuccLane(const std::string& laneId, -#ifdef HAVE_INTERNAL_LANES - const std::string& viaID, SUMOReal pass, -#endif - LinkDirection dir, LinkState state, - const std::string& tlid = "", unsigned int linkNo = 0) throw(InvalidArgument); - - - /** @brief Ends the computation of a container holding the succeeding lanes of a lane - * - * The current lane is determined and the parsed connections are added to it. - * If the lane is not known, an InvalidArgument is thrown. - * - * @exception InvalidArgument If the current lane is not known - */ - void closeSuccLane() throw(InvalidArgument); - - - /** @brief Returns the name of the lane the succeeding lanes are added to - * @return The ID of the currently opened lane - */ - const std::string& getCurrentLaneName() const ; - - -private: - /// @brief ID of the lane the succeeding lanes are added to - /// @todo Why is not the lane itself saved? - std::string myCurrentLane; - - /// @brief The list of connections - /// @todo Is it really necessary to have this as a pointer - the link container is rebuilt anyway - MSLinkCont* mySuccLanes; - - /// @brief The junction control builder to obtain referenced tls from - NLJunctionControlBuilder& myJunctionControlBuilder; - - -private: - /** @brief invalid copy constructor */ - NLSucceedingLaneBuilder(const NLSucceedingLaneBuilder& s); - - /** @brief invalid assignment operator */ - NLSucceedingLaneBuilder& operator=(const NLSucceedingLaneBuilder& s); - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/netload/NLTriggerBuilder.cpp sumo-0.16.0~dfsg/src/netload/NLTriggerBuilder.cpp --- sumo-0.15.0~dfsg/src/netload/NLTriggerBuilder.cpp 2012-03-02 00:03:34.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLTriggerBuilder.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Thu, 17 Oct 2002 -/// @version $Id: NLTriggerBuilder.cpp 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: NLTriggerBuilder.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Builds trigger objects for microsim /****************************************************************************/ @@ -50,7 +50,7 @@ #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #endif @@ -63,7 +63,7 @@ // method definitions // =========================================================================== NLTriggerBuilder::NLTriggerBuilder() - : myHandler(0), myHaveWarnedAboutDeprecatedFriendlyPos(false) {} + : myHandler(0) {} NLTriggerBuilder::~NLTriggerBuilder() {} @@ -159,22 +159,11 @@ throw ProcessError(); } // get the lane - MSLane* lane = getLane(attrs, "bus_stop", id); + MSLane* lane = getLane(attrs, "busStop", id); // get the positions SUMOReal frompos = attrs.getOptSUMORealReporting(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0); SUMOReal topos = attrs.getOptSUMORealReporting(SUMO_ATTR_ENDPOS, id.c_str(), ok, lane->getLength()); - if (attrs.hasAttribute(SUMO_ATTR_FROM) || attrs.hasAttribute(SUMO_ATTR_TO)) { - WRITE_WARNING("Deprecated attribute 'from' or 'to' in description of bus stop '" + id + "'."); - frompos = attrs.getOptSUMORealReporting(SUMO_ATTR_FROM, id.c_str(), ok, 0); - topos = attrs.getOptSUMORealReporting(SUMO_ATTR_TO, id.c_str(), ok, lane->getLength()); - } - if (attrs.hasAttribute(SUMO_ATTR_FRIENDLY_POS__DEPRECATED) && !myHaveWarnedAboutDeprecatedFriendlyPos) { - myHaveWarnedAboutDeprecatedFriendlyPos = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_FRIENDLY_POS__DEPRECATED) + "' is deprecated, use '" + toString(SUMO_ATTR_FRIENDLY_POS) + "' instead."); - } - const bool friendlyPos = attrs.hasAttribute(SUMO_ATTR_FRIENDLY_POS__DEPRECATED) - ? attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS__DEPRECATED, id.c_str(), ok, false) - : attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false); + const bool friendlyPos = attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false); if (!ok || !myHandler->checkStopPos(frompos, topos, lane->getLength(), 10., friendlyPos)) { throw InvalidArgument("Invalid position for bus stop '" + id + "'."); } @@ -186,7 +175,7 @@ } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL void NLTriggerBuilder::parseAndBuildCalibrator(MSNet& net, const SUMOSAXAttributes& attrs, const std::string& base) throw(InvalidArgument) { @@ -258,13 +247,13 @@ MSLaneSpeedTrigger* NLTriggerBuilder::buildLaneSpeedTrigger(MSNet& /*net*/, const std::string& id, - const std::vector &destLanes, + const std::vector& destLanes, const std::string& file) { return new MSLaneSpeedTrigger(id, destLanes, file); } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL METriggeredCalibrator* NLTriggerBuilder::buildCalibrator(MSNet& net, const std::string& id, const MSEdge* edge, SUMOReal pos, @@ -278,7 +267,7 @@ MSTriggeredRerouter* NLTriggerBuilder::buildRerouter(MSNet&, const std::string& id, - std::vector &edges, + std::vector& edges, SUMOReal prob, const std::string& file, bool off) { return new MSTriggeredRerouter(id, edges, prob, file, off); } @@ -286,7 +275,7 @@ void NLTriggerBuilder::buildBusStop(MSNet& net, const std::string& id, - const std::vector &lines, + const std::vector& lines, MSLane* lane, SUMOReal frompos, SUMOReal topos) throw(InvalidArgument) { MSBusStop* stop = new MSBusStop(id, lines, *lane, frompos, topos); if (!net.addBusStop(stop)) { @@ -337,15 +326,9 @@ NLTriggerBuilder::getPosition(const SUMOSAXAttributes& attrs, MSLane* lane, const std::string& tt, const std::string& tid) throw(InvalidArgument) { - if (attrs.hasAttribute(SUMO_ATTR_FRIENDLY_POS__DEPRECATED) && !myHaveWarnedAboutDeprecatedFriendlyPos) { - myHaveWarnedAboutDeprecatedFriendlyPos = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_FRIENDLY_POS__DEPRECATED) + "' is deprecated, use '" + toString(SUMO_ATTR_FRIENDLY_POS) + "' instead."); - } bool ok = true; SUMOReal pos = attrs.getSUMORealReporting(SUMO_ATTR_POSITION, 0, ok); - const bool friendlyPos = attrs.hasAttribute(SUMO_ATTR_FRIENDLY_POS__DEPRECATED) - ? attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS__DEPRECATED, 0, ok, false) - : attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, 0, ok, false); + const bool friendlyPos = attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, 0, ok, false); if (!ok) { throw InvalidArgument("Error on parsing a position information."); } diff -Nru sumo-0.15.0~dfsg/src/netload/NLTriggerBuilder.h sumo-0.16.0~dfsg/src/netload/NLTriggerBuilder.h --- sumo-0.15.0~dfsg/src/netload/NLTriggerBuilder.h 2012-01-25 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netload/NLTriggerBuilder.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 17 Oct 2002 -/// @version $Id: NLTriggerBuilder.h 11784 2012-01-24 22:35:56Z behrisch $ +/// @version $Id: NLTriggerBuilder.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Builds trigger objects for microsim /****************************************************************************/ @@ -49,7 +49,7 @@ class MSEdge; class MSBusStop; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL class METriggeredCalibrator; #endif @@ -68,18 +68,18 @@ class NLTriggerBuilder { public: /// @brief Constructor - NLTriggerBuilder() ; + NLTriggerBuilder(); /// @brief Destructor - virtual ~NLTriggerBuilder() ; + virtual ~NLTriggerBuilder(); /** @brief Sets the parent handler to use for nested parsing * * @param[in] handler The netload handler to set */ - void setHandler(NLHandler* handler) ; + void setHandler(NLHandler* handler); /** @brief Builds a vaporization @@ -91,7 +91,7 @@ * @param[in] attrs SAX-attributes which define the vaporizer * @note recheck throwing the exception */ - void buildVaporizer(const SUMOSAXAttributes& attrs) ; + void buildVaporizer(const SUMOSAXAttributes& attrs); /// @name parsing methods @@ -138,7 +138,7 @@ void parseAndBuildBusStop(MSNet& net, const SUMOSAXAttributes& attrs) throw(InvalidArgument); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /** @brief Parses his values and builds a mesoscopic or microscopic calibrator * * @param[in] net The network the calibrator belongs to @@ -175,8 +175,8 @@ * @exception ProcessError If the XML definition file is errornous */ virtual MSLaneSpeedTrigger* buildLaneSpeedTrigger(MSNet& net, - const std::string& id, const std::vector &destLanes, - const std::string& file) ; + const std::string& id, const std::vector& destLanes, + const std::string& file); /** @brief Builds a bus stop @@ -192,11 +192,11 @@ * @exception InvalidArgument If the bus stop can not be added to the net (is duplicate) */ virtual void buildBusStop(MSNet& net, - const std::string& id, const std::vector &lines, + const std::string& id, const std::vector& lines, MSLane* lane, SUMOReal frompos, SUMOReal topos) throw(InvalidArgument); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /** @brief builds a mesoscopic calibrator * * Simply calls the METriggeredCalibrator constructor. @@ -211,7 +211,7 @@ METriggeredCalibrator* buildCalibrator(MSNet& net, const std::string& id, const MSEdge* edge, SUMOReal pos, const std::string& file, const std::string& outfile, - const SUMOTime freq) ; + const SUMOTime freq); #endif @@ -226,8 +226,8 @@ * @param[in] file The file to read the reroute definitions from */ virtual MSTriggeredRerouter* buildRerouter(MSNet& net, - const std::string& id, std::vector &edges, - SUMOReal prob, const std::string& file, bool off) ; + const std::string& id, std::vector& edges, + SUMOReal prob, const std::string& file, bool off); //@} @@ -288,7 +288,6 @@ /// @brief The parent handler to set for subhandlers NLHandler* myHandler; - bool myHaveWarnedAboutDeprecatedFriendlyPos; }; diff -Nru sumo-0.15.0~dfsg/src/netwrite/Makefile.am sumo-0.16.0~dfsg/src/netwrite/Makefile.am --- sumo-0.15.0~dfsg/src/netwrite/Makefile.am 2011-09-16 23:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/Makefile.am 2012-11-03 00:02:19.000000000 +0000 @@ -3,6 +3,7 @@ libnetwrite_a_SOURCES = NWFrame.cpp NWFrame.h \ NWWriter_MATSim.cpp NWWriter_MATSim.h \ NWWriter_OpenDrive.cpp NWWriter_OpenDrive.h \ +NWWriter_DlrNavteq.cpp NWWriter_DlrNavteq.h \ NWWriter_SUMO.cpp NWWriter_SUMO.h \ NWWriter_XML.cpp NWWriter_XML.h diff -Nru sumo-0.15.0~dfsg/src/netwrite/Makefile.in sumo-0.16.0~dfsg/src/netwrite/Makefile.in --- sumo-0.15.0~dfsg/src/netwrite/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -50,8 +50,8 @@ libnetwrite_a_AR = $(AR) $(ARFLAGS) libnetwrite_a_LIBADD = am_libnetwrite_a_OBJECTS = NWFrame.$(OBJEXT) NWWriter_MATSim.$(OBJEXT) \ - NWWriter_OpenDrive.$(OBJEXT) NWWriter_SUMO.$(OBJEXT) \ - NWWriter_XML.$(OBJEXT) + NWWriter_OpenDrive.$(OBJEXT) NWWriter_DlrNavteq.$(OBJEXT) \ + NWWriter_SUMO.$(OBJEXT) NWWriter_XML.$(OBJEXT) libnetwrite_a_OBJECTS = $(am_libnetwrite_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -223,6 +225,7 @@ libnetwrite_a_SOURCES = NWFrame.cpp NWFrame.h \ NWWriter_MATSim.cpp NWWriter_MATSim.h \ NWWriter_OpenDrive.cpp NWWriter_OpenDrive.h \ +NWWriter_DlrNavteq.cpp NWWriter_DlrNavteq.h \ NWWriter_SUMO.cpp NWWriter_SUMO.h \ NWWriter_XML.cpp NWWriter_XML.h @@ -275,6 +278,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NWFrame.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NWWriter_DlrNavteq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NWWriter_MATSim.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NWWriter_OpenDrive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NWWriter_SUMO.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWFrame.cpp sumo-0.16.0~dfsg/src/netwrite/NWFrame.cpp --- sumo-0.15.0~dfsg/src/netwrite/NWFrame.cpp 2012-03-06 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWFrame.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NWFrame.cpp 12006 2012-03-05 09:06:38Z namdre $ +/// @version $Id: NWFrame.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Sets and checks options for netwrite /****************************************************************************/ @@ -42,6 +42,7 @@ #include "NWWriter_MATSim.h" #include "NWWriter_XML.h" #include "NWWriter_OpenDrive.h" +#include "NWWriter_DlrNavteq.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -90,8 +91,17 @@ oc.doRegister("opendrive-output", new Option_FileName()); oc.addDescription("opendrive-output", "Output", "The generated net will be written to FILE using openDRIVE format."); + oc.doRegister("dlr-navteq-output", new Option_FileName()); + oc.addDescription("dlr-navteq-output", "Output", "The generated net will be written to dlr-navteq files with the given PREFIX."); + oc.doRegister("output.street-names", new Option_Bool(false)); oc.addDescription("output.street-names", "Output", "Street names will be included in the output (if available)."); + + oc.doRegister("output.original-names", new Option_Bool(false)); + oc.addDescription("output.original-names", "Output", "Writes original names, if given, as parameter."); + + oc.doRegister("street-sign-output", new Option_FileName()); + oc.addDescription("street-sign-output", "Output", "Writes street signs as POIs to FILE."); } @@ -100,11 +110,15 @@ OptionsCont& oc = OptionsCont::getOptions(); bool ok = true; // check whether the output is valid and can be build - if (!oc.isSet("output-file")&&!oc.isSet("plain-output-prefix")&&!oc.isSet("matsim-output")&&!oc.isSet("opendrive-output")) { + if (!oc.isSet("output-file") + && !oc.isSet("plain-output-prefix") + && !oc.isSet("matsim-output") + && !oc.isSet("opendrive-output") + && !oc.isSet("dlr-navteq-output")) { oc.set("output-file", "net.net.xml"); } // some outputs need internal lanes - if (oc.isSet("opendrive-output")&&oc.getBool("no-internal-links")) { + if (oc.isSet("opendrive-output") && oc.getBool("no-internal-links")) { WRITE_ERROR("openDRIVE export needs internal links computation."); ok = false; } @@ -117,6 +131,7 @@ NWWriter_SUMO::writeNetwork(oc, nb); NWWriter_MATSim::writeNetwork(oc, nb); NWWriter_OpenDrive::writeNetwork(oc, nb); + NWWriter_DlrNavteq::writeNetwork(oc, nb); NWWriter_XML::writeNetwork(oc, nb); // save the mapping information when wished if (oc.isSet("map-output")) { diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_DlrNavteq.cpp sumo-0.16.0~dfsg/src/netwrite/NWWriter_DlrNavteq.cpp --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_DlrNavteq.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_DlrNavteq.cpp 2012-12-02 13:45:17.000000000 +0000 @@ -0,0 +1,294 @@ +/****************************************************************************/ +/// @file NWWriter_DlrNavteq.h +/// @author Jakob Erdmann +/// @date 26.10.2012 +/// @version $Id: NWWriter_DlrNavteq.cpp 13106 2012-12-02 13:44:57Z behrisch $ +/// +// Exporter writing networks using DlrNavteq (Elmar) format +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "NWFrame.h" +#include "NWWriter_DlrNavteq.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// --------------------------------------------------------------------------- +// static members +// --------------------------------------------------------------------------- +const std::string NWWriter_DlrNavteq::UNDEFINED("-1"); + +// --------------------------------------------------------------------------- +// static methods +// --------------------------------------------------------------------------- +void +NWWriter_DlrNavteq::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) { + // check whether a matsim-file shall be generated + if (!oc.isSet("dlr-navteq-output")) { + return; + } + writeNodesUnsplitted(oc, nb.getNodeCont(), nb.getEdgeCont()); + writeLinksUnsplitted(oc, nb.getEdgeCont()); +} + + +void NWWriter_DlrNavteq::writeHeader(OutputDevice& device, const OptionsCont& oc) { + time_t rawtime; + time(&rawtime); + char buffer [80]; + strftime(buffer, 80, "on %c", localtime(&rawtime)); + device << "# Generated " << buffer << " by " << oc.getFullName() << "\n"; + device << "# Format matches GdfExtractor version: V6.0\n"; + std::stringstream tmp; + oc.writeConfiguration(tmp, true, false, false); + tmp.seekg(std::ios_base::beg); + std::string line; + while (!tmp.eof()) { + std::getline(tmp, line); + device << "# " << line << "\n"; + } + device << "#\n"; +} + +void +NWWriter_DlrNavteq::writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec) { + // For "real" nodes we simply use the node id. + // For internal nodes (geometry vectors describing edge geometry in the parlance of this format) + // we use the id of the edge and do not bother with + // compression (each direction gets its own internal node). + // XXX add option for generating numerical ids in case the input network has string ids and the target process needs integers + OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_nodes_unsplitted.txt"); + writeHeader(device, oc); + const GeoConvHelper& gch = GeoConvHelper::getFinal(); + const bool haveGeo = gch.usingGeoProjection(); + const SUMOReal geoScale = pow(10.0f, haveGeo ? 5 : 2); // see NIImporter_DlrNavteq::GEO_SCALE + device.setPrecision(0); + if (!haveGeo) { + WRITE_WARNING("DlrNavteq node data will be written in (floating point) cartesian coordinates"); + } + // write format specifier + device << "# NODE_ID\tIS_BETWEEN_NODE\tamount_of_geocoordinates\tx1\ty1\t[x2 y2 ... xn yn]\n"; + // write normal nodes + for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { + NBNode* n = (*i).second; + Position pos = n->getPosition(); + gch.cartesian2geo(pos); + pos.mul(geoScale); + device << n->getID() << "\t0\t1\t" << pos.x() << "\t" << pos.y() << "\n"; + } + // write "internal" nodes + for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { + NBEdge* e = (*i).second; + const PositionVector& geom = e->getGeometry(); + if (geom.size() > 2) { + if (e->getID() == UNDEFINED) { + WRITE_WARNING("Edge id '" + UNDEFINED + + "' clashes with the magic value for NO_BETWEEN_NODE. Internal geometry for this edge will be lost."); + } + device << e->getID() << "\t1\t" << geom.size() - 2; + for (size_t ii = 1; ii < geom.size() - 1; ++ii) { + Position pos = geom[(int)ii]; + gch.cartesian2geo(pos); + pos.mul(geoScale); + device << "\t" << pos.x() << "\t" << pos.y(); + } + device << "\n"; + } + } + device.close(); +} + + +void +NWWriter_DlrNavteq::writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec) { + OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_links_unsplitted.txt"); + writeHeader(device, oc); + // write format specifier + device << "# LINK_ID\tNODE_ID_FROM\tNODE_ID_TO\tBETWEEN_NODE_ID\tLENGTH\tVEHICLE_TYPE\tFORM_OF_WAY\tBRUNNEL_TYPE\tFUNCTIONAL_ROAD_CLASS\tSPEED_CATEGORY\tNUMBER_OF_LANES\tSPEED_LIMIT\tSPEED_RESTRICTION\tNAME_ID1_REGIONAL\tNAME_ID2_LOCAL\tHOUSENUMBERS_RIGHT\tHOUSENUMBERS_LEFT\tZIP_CODE\tAREA_ID\tSUBAREA_ID\tTHROUGH_TRAFFIC\tSPECIAL_RESTRICTIONS\tEXTENDED_NUMBER_OF_LANES\tISRAMP\tCONNECTION\n"; + // write edges + for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { + NBEdge* e = (*i).second; + const int kph = speedInKph(e->getSpeed()); + const std::string& betweenNodeID = (e->getGeometry().size() > 2) ? e->getID() : UNDEFINED; + device << e->getID() << "\t" + << e->getFromNode()->getID() << "\t" + << e->getToNode()->getID() << "\t" + << betweenNodeID << "\t" + << getGraphLength(e) << "\t" + << getAllowedTypes(e->getPermissions()) << "\t" + << "3\t" // Speed Category 1-8 XXX refine this + << UNDEFINED << "\t" // no special brunnel type (we don't know yet) + << getRoadClass(e) << "\t" + << getSpeedCategory(kph) << "\t" + << getNavteqLaneCode(e->getNumLanes()) << "\t" + << getSpeedCategoryUpperBound(kph) << "\t" + << kph << "\t" + << UNDEFINED << "\t" // NAME_ID1_REGIONAL XXX + << UNDEFINED << "\t" // NAME_ID2_LOCAL XXX + << UNDEFINED << "\t" // housenumbers_right + << UNDEFINED << "\t" // housenumbers_left + << UNDEFINED << "\t" // ZIP_CODE + << UNDEFINED << "\t" // AREA_ID + << UNDEFINED << "\t" // SUBAREA_ID + << "1\t" // through_traffic (allowed) + << UNDEFINED << "\t" // special_restrictions + << UNDEFINED << "\t" // extended_number_of_lanes + << UNDEFINED << "\t" // isRamp + << "0\t" // connection (between nodes always in order) + << "\n"; + } +} + + +std::string +NWWriter_DlrNavteq::getAllowedTypes(SVCPermissions permissions) { + if (permissions == SVCFreeForAll) { + return "1000000000"; + } + std::ostringstream oss; + oss << "0"; + oss << (permissions & SVC_PASSENGER) > 0 ? 1 : 0; + oss << (permissions & SVC_HOV) > 0 ? 1 : 0; + oss << (permissions & SVC_PUBLIC_EMERGENCY) > 0 ? 1 : 0; + oss << (permissions & SVC_TAXI) > 0 ? 1 : 0; + oss << (permissions & (SVC_PUBLIC_TRANSPORT | SVC_BUS)) > 0 ? 1 : 0; + oss << (permissions & SVC_DELIVERY) > 0 ? 1 : 0; + oss << (permissions & SVC_TRANSPORT) > 0 ? 1 : 0; + oss << (permissions & SVC_BICYCLE) > 0 ? 1 : 0; + oss << (permissions & SVC_PEDESTRIAN) > 0 ? 1 : 0; + return oss.str(); +} + + +int +NWWriter_DlrNavteq::getRoadClass(NBEdge* edge) { + // quoting the navteq manual: + // As a general rule, Functional Road Class assignments have no direct + // correlation with other road attributes like speed, controlled access, route type, etc. + // + // we do a simple speed / lane-count mapping anyway + // XXX the resulting functional road class layers probably won't be connected as required + const int kph = speedInKph(edge->getSpeed()); + if ((kph) > 100) { + return 0; + } + if ((kph) > 70) { + return 1; + } + if ((kph) > 50) { + return (edge->getNumLanes() > 1 ? 2 : 3); + } + if ((kph) > 30) { + return 3; + } + return 4; +} + + +int +NWWriter_DlrNavteq::getSpeedCategory(int kph) { + if ((kph) > 130) { + return 1; + } + if ((kph) > 100) { + return 2; + } + if ((kph) > 90) { + return 3; + } + if ((kph) > 70) { + return 4; + } + if ((kph) > 50) { + return 5; + } + if ((kph) > 30) { + return 6; + } + if ((kph) > 10) { + return 7; + } + return 8; +} + + +int +NWWriter_DlrNavteq::getSpeedCategoryUpperBound(int kph) { + if ((kph) > 130) { + return 131; + } + if ((kph) > 100) { + return 130; + } + if ((kph) > 90) { + return 100; + } + if ((kph) > 70) { + return 90; + } + if ((kph) > 50) { + return 70; + } + if ((kph) > 30) { + return 50; + } + if ((kph) > 10) { + return 30; + } + return 10; +} + + +unsigned int +NWWriter_DlrNavteq::getNavteqLaneCode(const unsigned int numLanes) { + const unsigned int code = (numLanes == 1 ? 1 : + (numLanes < 4 ? 2 : 3)); + return numLanes * 10 + code; +} + + +SUMOReal +NWWriter_DlrNavteq::getGraphLength(NBEdge* edge) { + PositionVector geom = edge->getGeometry(); + geom.push_back_noDoublePos(edge->getToNode()->getPosition()); + geom.push_front_noDoublePos(edge->getFromNode()->getPosition()); + return geom.length(); +} +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_DlrNavteq.h sumo-0.16.0~dfsg/src/netwrite/NWWriter_DlrNavteq.h --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_DlrNavteq.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_DlrNavteq.h 2012-12-02 13:45:17.000000000 +0000 @@ -0,0 +1,119 @@ +/****************************************************************************/ +/// @file NWWriter_DlrNavteq.h +/// @author Jakob Erdmann +/// @date 26.10.2012 +/// @version $Id: NWWriter_DlrNavteq.h 13106 2012-12-02 13:44:57Z behrisch $ +/// +// Exporter writing networks using DlrNavteq (Elmar) format +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef NWWriter_DlrNavteq_h +#define NWWriter_DlrNavteq_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class NBEdge; +class NBEdgeCont; +class NBNetBuilder; +class NBNode; +class NBNodeCont; +class NBTrafficLightLogicCont; +class NBTypeCont; +class OptionsCont; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class NWWriter_DlrNavteq + * @brief Exporter writing networks using XML (native input) format + * + */ +class NWWriter_DlrNavteq { +public: + /** @brief Writes the network into XML-files (nodes, edges, connections, + * traffic lights) + * @param[in] oc The options to use + * @param[in] nb The network builder from which to read data + */ + static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb); + +private: + /** @brief Writes the nodes_unsplitted file + * @param[in] oc The options to use + * @param[in] nc The node-container from which to read data + * @param[in] ec The edge-container from which to read data + */ + static void writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec); + + /** @brief Writes the links_unsplitted files + * @param[in] oc The options to use + * @param[in] nc The node-container from which to read data + * @param[in] ec The edge-container from which to read data + */ + static void writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec); + + + /// @brief write header comments (input paramters, date, etc...) + static void writeHeader(OutputDevice& device, const OptionsCont& oc); + + /// @brief build the ascii-bit-vector for column vehicle_type + static std::string getAllowedTypes(SVCPermissions permissions); + + /// @brief get the navteq road class + static int getRoadClass(NBEdge* edge); + + /// @brief get the navteq speed class based on the speed in km/h + static int getSpeedCategory(int kph); + + /// @brief get the SPEED_LIMIT as defined by elmar (upper bound of speed category) + static int getSpeedCategoryUpperBound(int kph); + + /// @brief get the lane number encoding + static unsigned int getNavteqLaneCode(const unsigned int numLanes); + + /// @brief get the length of the edge when measured up to the junction center + static SUMOReal getGraphLength(NBEdge* edge); + + /// @brief magic value for undefined stuff + static const std::string UNDEFINED; + + /// @brief get edge speed rounded to kmh + static inline int speedInKph(SUMOReal metersPerSecond) { + return (int)std::floor(metersPerSecond * 3.6 + 0.5); + } +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_OpenDrive.cpp sumo-0.16.0~dfsg/src/netwrite/NWWriter_OpenDrive.cpp --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_OpenDrive.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_OpenDrive.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NWWriter_OpenDrive.cpp /// @author Daniel Krajzewicz /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_OpenDrive.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NWWriter_OpenDrive.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Exporter writing networks using the openDRIVE format /****************************************************************************/ @@ -27,6 +27,8 @@ #else #include #endif + +#include #include "NWWriter_OpenDrive.h" #include #include @@ -36,7 +38,10 @@ #include #include #include +#include #include +#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -52,7 +57,7 @@ // --------------------------------------------------------------------------- void NWWriter_OpenDrive::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) { - // check whether a matsim-file shall be generated + // check whether an opendrive-file shall be generated if (!oc.isSet("opendrive-output")) { return; } @@ -65,35 +70,45 @@ OutputDevice& device = OutputDevice::getDevice(oc.getString("opendrive-output")); device << "\n"; device << "\n"; - device << "
\n"; - // write normal edges (road) + time_t now = time(0); + std::string dstr(ctime(&now)); + const NBNodeCont& nc = nb.getNodeCont(); const NBEdgeCont& ec = nb.getEdgeCont(); + const Boundary& b = GeoConvHelper::getFinal().getConvBoundary(); + device << "
\n"; + // write normal edges (road) for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { const NBEdge* e = (*i).second; - device << " getStreetName() << "\" length=\"" << e->getLength() << "\" id=\"" << getID(e->getID(), edgeMap, edgeID) << "\" junction=\"-1\">\n"; + device << " getStreetName()) << "\" length=\"" << e->getLength() << "\" id=\"" << getID(e->getID(), edgeMap, edgeID) << "\" junction=\"-1\">\n"; device << " \n"; device << " getFromNode()->getID(), nodeMap, nodeID) << "\"/>\n"; device << " getToNode()->getID(), nodeMap, nodeID) << "\"/>\n"; device << " \n"; device << " \n"; - writePlanView(e->getGeometry(), device); + const std::vector& lanes = e->getLanes(); + unsigned int li = (unsigned int)lanes.size() - 1; + PositionVector ls = e->getLaneShape(li); + SUMOReal width = lanes[li].width < 0 || !e->hasLaneSpecificWidth() ? SUMO_const_laneWidth : lanes[li].width; + ls.move2side(-width / 2.); + writePlanView(ls, device); device << " \n"; - device << " \n"; + device << " \n"; device << " \n"; device << " \n"; - writeEmptyCenterLane(device); + writeEmptyCenterLane(device, "solid", 0.13); device << " \n"; - const std::vector &lanes = e->getLanes(); for (int j = e->getNumLanes(); --j >= 0;) { device << " getNumLanes() - j << "\" type=\"driving\" level=\"0\">\n"; device << " \n"; device << " \n"; // internal roads have this device << " \n"; // internal roads have this device << " \n"; - SUMOReal width = lanes[j].width<0||!e->hasLaneSpecificWidth() ? SUMO_const_laneWidth : lanes[j].width; + SUMOReal width = lanes[j].width < 0 || !e->hasLaneSpecificWidth() ? SUMO_const_laneWidth : lanes[j].width; device << " \n"; std::string markType = "broken"; - if(j==0) { + if (j == 0) { markType = "solid"; } device << " \n"; @@ -102,18 +117,17 @@ device << " \n"; device << " \n"; device << " \n"; - device << " \n"; - device << " \n"; + device << " \n"; + device << " \n"; device << " \n"; } device << "\n"; // write junction-internal edges (road) - const NBNodeCont& nc = nb.getNodeCont(); for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { NBNode* n = (*i).second; - const std::vector &incoming = (*i).second->getIncomingEdges(); + const std::vector& incoming = (*i).second->getIncomingEdges(); for (std::vector::const_iterator j = incoming.begin(); j != incoming.end(); ++j) { - const std::vector &elv = (*j)->getConnections(); + const std::vector& elv = (*j)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == 0) { continue; @@ -123,6 +137,14 @@ if (c.haveVia) { shape.appendWithCrossingPoint(c.viaShape); } + const SUMOReal width = SUMO_const_laneWidth; + // @todo: this if-clause is a hack which assures that the code also works with connections of zero length, what may be possible + // probably, it would make sense to mark such connections and connect the incoming/outgoing streets directly in such cases. + if (shape.length() != 0) { + shape.move2side(-width / 2.); + } else { + WRITE_WARNING("Same position problem at internal edge '" + c.id + "'."); + } device << " getID(), nodeMap, nodeID) << "\">\n"; device << " \n"; device << " getID(), edgeMap, edgeID) << "\"/>\n"; @@ -131,24 +153,24 @@ device << " \n"; writePlanView(shape, device); device << " \n"; - device << " \n"; + device << " \n"; device << " \n"; device << " \n"; - writeEmptyCenterLane(device); + writeEmptyCenterLane(device, "none", 0); device << " \n"; device << " \n"; device << " \n"; - //device << " \n";// !!! - //device << " \n";// !!! + device << " getNumLanes() - c.fromLane << "\"/>\n"; + device << " getNumLanes() - c.toLane << "\"/>\n"; device << " \n"; - device << " \n"; - device << " \n"; + device << " \n"; + device << " \n"; device << " \n"; device << " \n"; device << " \n"; device << " \n"; - device << " \n"; - device << " \n"; + device << " \n"; + device << " \n"; device << " \n"; } } @@ -159,9 +181,9 @@ NBNode* n = (*i).second; device << " getID() << "\" id=\"" << getID(n->getID(), nodeMap, nodeID) << "\">\n"; unsigned int index = 0; - const std::vector &incoming = n->getIncomingEdges(); + const std::vector& incoming = n->getIncomingEdges(); for (std::vector::const_iterator j = incoming.begin(); j != incoming.end(); ++j) { - const std::vector &elv = (*j)->getConnections(); + const std::vector& elv = (*j)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == 0) { continue; @@ -195,11 +217,11 @@ void -NWWriter_OpenDrive::writeEmptyCenterLane(OutputDevice& device) { +NWWriter_OpenDrive::writeEmptyCenterLane(OutputDevice& device, const std::string& mark, SUMOReal markWidth) { device << "
\n"; device << " \n"; - device << " \n"; - device << " \n"; + device << " \n"; + device << " \n"; device << " \n"; device << " \n"; device << "
\n"; @@ -207,7 +229,7 @@ int -NWWriter_OpenDrive::getID(const std::string& origID, StringBijection &map, int& lastID) { +NWWriter_OpenDrive::getID(const std::string& origID, StringBijection& map, int& lastID) { if (map.hasString(origID)) { return map.get(origID); } diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_OpenDrive.h sumo-0.16.0~dfsg/src/netwrite/NWWriter_OpenDrive.h --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_OpenDrive.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_OpenDrive.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file NWWriter_OpenDrive.h /// @author Daniel Krajzewicz /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_OpenDrive.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NWWriter_OpenDrive.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Exporter writing networks using the openDRIVE format /****************************************************************************/ @@ -61,8 +61,8 @@ protected: static void writePlanView(const PositionVector& shape, OutputDevice& device); - static void writeEmptyCenterLane(OutputDevice& device); - static int getID(const std::string& origID, StringBijection &map, int& lastID); + static void writeEmptyCenterLane(OutputDevice& device, const std::string& mark, SUMOReal markWidth); + static int getID(const std::string& origID, StringBijection& map, int& lastID); }; diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_SUMO.cpp sumo-0.16.0~dfsg/src/netwrite/NWWriter_SUMO.cpp --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_SUMO.cpp 2012-03-08 00:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_SUMO.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_SUMO.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NWWriter_SUMO.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Exporter writing networks using the SUMO format /****************************************************************************/ @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ // --------------------------------------------------------------------------- void NWWriter_SUMO::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) { - // check whether a matsim-file shall be generated + // check whether a sumo net-file shall be generated if (!oc.isSet("output-file")) { return; } @@ -75,10 +76,11 @@ writeLocation(device); // write inner lanes + bool origNames = oc.getBool("output.original-names"); if (!oc.getBool("no-internal-links")) { bool hadAny = false; for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { - hadAny |= writeInternalEdges(device, *(*i).second); + hadAny |= writeInternalEdges(device, *(*i).second, origNames); } if (hadAny) { device.lf(); @@ -88,7 +90,7 @@ // write edges with lanes and connected edges bool noNames = !oc.getBool("output.street-names"); for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { - writeEdge(device, *(*i).second, noNames); + writeEdge(device, *(*i).second, noNames, origNames); } device.lf(); @@ -142,7 +144,7 @@ } // write roundabout information - const std::vector > &roundabouts = nb.getRoundabouts(); + const std::vector >& roundabouts = nb.getRoundabouts(); for (std::vector >::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { writeRoundabout(device, *i); } @@ -162,18 +164,19 @@ bool -NWWriter_SUMO::writeInternalEdges(OutputDevice& into, const NBNode& n) { +NWWriter_SUMO::writeInternalEdges(OutputDevice& into, const NBNode& n, bool origNames) { bool ret = false; const EdgeVector& incoming = n.getIncomingEdges(); for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) { - const std::vector &elv = (*i)->getConnections(); + const std::vector& elv = (*i)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == 0) { continue; } - writeInternalEdge(into, (*k).id, (*k).vmax, (*k).shape); + std::string origID = origNames ? (*k).origID : ""; + writeInternalEdge(into, (*k).id, (*k).vmax, (*k).shape, origID); if ((*k).haveVia) { - writeInternalEdge(into, (*k).viaID, (*k).viaVmax, (*k).viaShape); + writeInternalEdge(into, (*k).viaID, (*k).viaVmax, (*k).viaShape, origID); } ret = true; } @@ -183,31 +186,41 @@ void -NWWriter_SUMO::writeInternalEdge(OutputDevice& into, const std::string& id, SUMOReal vmax, const PositionVector& shape) { +NWWriter_SUMO::writeInternalEdge(OutputDevice& into, const std::string& id, SUMOReal vmax, const PositionVector& shape, + const std::string& origID) { SUMOReal length = MAX2(shape.length(), (SUMOReal)POSITION_EPS); // microsim needs positive length into.openTag(SUMO_TAG_EDGE); into.writeAttr(SUMO_ATTR_ID, id); into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_INTERNAL); - into.closeOpener(); + into.closeOpener(); into.openTag(SUMO_TAG_LANE); into.writeAttr(SUMO_ATTR_ID, id + "_0"); into.writeAttr(SUMO_ATTR_INDEX, 0); into.writeAttr(SUMO_ATTR_SPEED, vmax); into.writeAttr(SUMO_ATTR_LENGTH, length); into.writeAttr(SUMO_ATTR_SHAPE, shape); - into.closeTag(true); + if (origID != "") { + into.closeOpener(); + into.openTag(SUMO_TAG_PARAM); + into.writeAttr(SUMO_ATTR_KEY, "origId"); + into.writeAttr(SUMO_ATTR_VALUE, origID); + into.closeTag(true); + into.closeTag(); + } else { + into.closeTag(true); + } into.closeTag(); } void -NWWriter_SUMO::writeEdge(OutputDevice& into, const NBEdge& e, bool noNames) { +NWWriter_SUMO::writeEdge(OutputDevice& into, const NBEdge& e, bool noNames, bool origNames) { // write the edge's begin into.openTag(SUMO_TAG_EDGE).writeAttr(SUMO_ATTR_ID, e.getID()); into.writeAttr(SUMO_ATTR_FROM, e.getFromNode()->getID()); into.writeAttr(SUMO_ATTR_TO, e.getToNode()->getID()); if (!noNames && e.getStreetName() != "") { - into.writeAttr(SUMO_ATTR_NAME, e.getStreetName()); + into.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(e.getStreetName())); } into.writeAttr(SUMO_ATTR_PRIORITY, e.getPriority()); if (e.getTypeName() != "") { @@ -226,15 +239,15 @@ if (!e.hasDefaultGeometry()) { into.writeAttr(SUMO_ATTR_SHAPE, e.getGeometry()); } - into.closeOpener(); + into.closeOpener(); // write the lanes - const std::vector &lanes = e.getLanes(); + const std::vector& lanes = e.getLanes(); SUMOReal length = e.getLoadedLength(); if (length <= 0) { length = (SUMOReal) .1; } for (unsigned int i = 0; i < (unsigned int) lanes.size(); i++) { - writeLane(into, e.getID(), e.getLaneID(i), lanes[i], length, i); + writeLane(into, e.getID(), e.getLaneID(i), lanes[i], length, i, origNames); } // close the edge into.closeTag(); @@ -242,7 +255,8 @@ void -NWWriter_SUMO::writeLane(OutputDevice& into, const std::string& eID, const std::string& lID, const NBEdge::Lane& lane, SUMOReal length, unsigned int index) { +NWWriter_SUMO::writeLane(OutputDevice& into, const std::string& eID, const std::string& lID, const NBEdge::Lane& lane, + SUMOReal length, unsigned int index, bool origNames) { // output the lane's attributes into.openTag(SUMO_TAG_LANE).writeAttr(SUMO_ATTR_ID, lID); // the first lane of an edge will be the depart lane @@ -261,7 +275,7 @@ } into.writeAttr(SUMO_ATTR_SPEED, lane.speed); into.writeAttr(SUMO_ATTR_LENGTH, length); - if (lane.offset > 0) { + if (lane.offset != NBEdge::UNSPECIFIED_OFFSET) { into.writeAttr(SUMO_ATTR_ENDOFFSET, lane.offset); } if (lane.width != NBEdge::UNSPECIFIED_WIDTH) { @@ -272,7 +286,16 @@ shape = shape.getSubpart(0, shape.length() - lane.offset); } into.writeAttr(SUMO_ATTR_SHAPE, shape); - into.closeTag(true); + if (origNames && lane.origID != "") { + into.closeOpener(); + into.openTag(SUMO_TAG_PARAM); + into.writeAttr(SUMO_ATTR_KEY, "origId"); + into.writeAttr(SUMO_ATTR_VALUE, lane.origID); + into.closeTag(true); + into.closeTag(); + } else { + into.closeTag(true); + } } @@ -284,7 +307,7 @@ NWFrame::writePositionLong(n.getPosition(), into); // write the incoming lanes std::string incLanes; - const std::vector &incoming = n.getIncomingEdges(); + const std::vector& incoming = n.getIncomingEdges(); for (std::vector::const_iterator i = incoming.begin(); i != incoming.end(); ++i) { unsigned int noLanes = (*i)->getNumLanes(); for (unsigned int j = 0; j < noLanes; j++) { @@ -300,7 +323,7 @@ if (!OptionsCont::getOptions().getBool("no-internal-links")) { unsigned int l = 0; for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) { - const std::vector &elv = (*i)->getConnections(); + const std::vector& elv = (*i)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == 0) { continue; @@ -323,7 +346,7 @@ if (n.getType() == NODETYPE_DEAD_END) { into.closeTag(true); } else { - into.closeOpener(); + into.closeOpener(); // write right-of-way logics n.writeLogic(into); into.closeTag(); @@ -334,9 +357,9 @@ bool NWWriter_SUMO::writeInternalNodes(OutputDevice& into, const NBNode& n) { bool ret = false; - const std::vector &incoming = n.getIncomingEdges(); + const std::vector& incoming = n.getIncomingEdges(); for (std::vector::const_iterator i = incoming.begin(); i != incoming.end(); i++) { - const std::vector &elv = (*i)->getConnections(); + const std::vector& elv = (*i)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == 0 || !(*k).haveVia) { continue; @@ -368,7 +391,9 @@ into.writeAttr(SUMO_ATTR_TO, c.toEdge->getID()); into.writeAttr(SUMO_ATTR_FROM_LANE, c.fromLane); into.writeAttr(SUMO_ATTR_TO_LANE, c.toLane); - + if (c.mayDefinitelyPass) { + into.writeAttr(SUMO_ATTR_PASS, c.mayDefinitelyPass); + } if (style != PLAIN) { if (includeInternal) { into.writeAttr(SUMO_ATTR_VIA, c.id + "_0"); @@ -384,13 +409,9 @@ assert(dir != LINKDIR_NODIR); into.writeAttr(SUMO_ATTR_DIR, toString(dir)); // write the state information - std::string stateCode; - if (c.tlID != "") { - stateCode = toString(LINKSTATE_TL_OFF_BLINKING); - } else { - stateCode = from.getToNode()->stateCode(&from, c.toEdge, c.toLane, c.mayDefinitelyPass); - } - into.writeAttr(SUMO_ATTR_STATE, stateCode); + const LinkState linkState = from.getToNode()->getLinkState( + &from, c.toEdge, c.toLane, c.mayDefinitelyPass, c.tlID); + into.writeAttr(SUMO_ATTR_STATE, linkState); } } into.closeTag(true); @@ -400,10 +421,10 @@ bool NWWriter_SUMO::writeInternalConnections(OutputDevice& into, const NBNode& n) { bool ret = false; - const std::vector &incoming = n.getIncomingEdges(); + const std::vector& incoming = n.getIncomingEdges(); for (std::vector::const_iterator i = incoming.begin(); i != incoming.end(); ++i) { NBEdge* from = *i; - const std::vector &connections = from->getConnections(); + const std::vector& connections = from->getConnections(); for (std::vector::const_iterator j = connections.begin(); j != connections.end(); ++j) { const NBEdge::Connection& c = *j; assert(c.toEdge != 0); @@ -440,7 +461,7 @@ void -NWWriter_SUMO::writeRoundabout(OutputDevice& into, const std::set &r) { +NWWriter_SUMO::writeRoundabout(OutputDevice& into, const std::set& r) { std::set nodes; for (std::set::const_iterator j = r.begin(); j != r.end(); ++j) { nodes.insert((*j)->getToNode()->getID()); @@ -463,21 +484,21 @@ std::vector sinkW = d.getSinkWeights(); VectorHelper::normaliseSum(sinkW, 1.0); // write the head and the id of the district - into.openTag(SUMO_TAG_TAZ).writeAttr(SUMO_ATTR_ID, d.getID()); + into.openTag(SUMO_TAG_TAZ).writeAttr(SUMO_ATTR_ID, d.getID()); if (d.getShape().size() > 0) { - into.writeAttr(SUMO_ATTR_SHAPE, d.getShape()); + into.writeAttr(SUMO_ATTR_SHAPE, d.getShape()); } - into.closeOpener(); + into.closeOpener(); size_t i; // write all sources - const std::vector &sources = d.getSourceEdges(); + const std::vector& sources = d.getSourceEdges(); for (i = 0; i < sources.size(); i++) { // write the head and the id of the source into.openTag(SUMO_TAG_TAZSOURCE).writeAttr(SUMO_ATTR_ID, sources[i]->getID()).writeAttr(SUMO_ATTR_WEIGHT, sourceW[i]); into.closeTag(true); } // write all sinks - const std::vector &sinks = d.getSinkEdges(); + const std::vector& sinks = d.getSinkEdges(); for (i = 0; i < sinks.size(); i++) { // write the head and the id of the sink into.openTag(SUMO_TAG_TAZSINK).writeAttr(SUMO_ATTR_ID, sinks[i]->getID()).writeAttr(SUMO_ATTR_WEIGHT, sinkW[i]); @@ -530,9 +551,9 @@ into.writeAttr(SUMO_ATTR_TYPE, toString(TLTYPE_STATIC)); into.writeAttr(SUMO_ATTR_PROGRAMID, (*it)->getProgramID()); into.writeAttr(SUMO_ATTR_OFFSET, writeSUMOTime((*it)->getOffset())); - into.closeOpener(); + into.closeOpener(); // write the phases - const std::vector &phases = (*it)->getPhases(); + const std::vector& phases = (*it)->getPhases(); for (std::vector::const_iterator j = phases.begin(); j != phases.end(); ++j) { into.openTag(SUMO_TAG_PHASE); into.writeAttr(SUMO_ATTR_DURATION, writeSUMOTime(j->duration)); @@ -555,18 +576,18 @@ into.writeAttr(SUMO_ATTR_CONV_BOUNDARY, geoConvHelper.getConvBoundary()); if (geoConvHelper.usingGeoProjection()) { into.setPrecision(GEO_OUTPUT_ACCURACY); - } + } into.writeAttr(SUMO_ATTR_ORIG_BOUNDARY, geoConvHelper.getOrigBoundary()); if (geoConvHelper.usingGeoProjection()) { into.setPrecision(); - } + } into.writeAttr(SUMO_ATTR_ORIG_PROJ, geoConvHelper.getProjString()); into.closeTag(true); into.lf(); } -void +void NWWriter_SUMO::writePermissions(OutputDevice& into, SVCPermissions permissions) { if (permissions == SVCFreeForAll) { return; @@ -585,7 +606,7 @@ } -void +void NWWriter_SUMO::writePreferences(OutputDevice& into, SVCPermissions preferred) { if (preferred == SVCFreeForAll || preferred == 0) { return; diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_SUMO.h sumo-0.16.0~dfsg/src/netwrite/NWWriter_SUMO.h --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_SUMO.h 2012-03-08 00:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_SUMO.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_SUMO.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NWWriter_SUMO.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Exporter writing networks using the SUMO format /****************************************************************************/ @@ -108,18 +108,20 @@ /** @brief Writes internal edges ( &r); + static void writeRoundabout(OutputDevice& into, const std::set& r); /** @brief Writes a district @@ -177,7 +181,8 @@ * @param[in] vmax The maximum speed of the edge * @param[in] shape The shape of the edge */ - static void writeInternalEdge(OutputDevice& into, const std::string& id, SUMOReal vmax, const PositionVector& shape); + static void writeInternalEdge(OutputDevice& into, const std::string& id, SUMOReal vmax, const PositionVector& shape, + const std::string& origID); /** @brief Writes a single internal connection * @param[in] from The id of the from-edge diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_XML.cpp sumo-0.16.0~dfsg/src/netwrite/NWWriter_XML.cpp --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_XML.cpp 2012-03-08 00:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_XML.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 11.05.2011 -/// @version $Id: NWWriter_XML.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: NWWriter_XML.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Exporter writing networks using XML (native input) format /****************************************************************************/ @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -58,7 +59,7 @@ // --------------------------------------------------------------------------- void NWWriter_XML::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) { - // check whether a matsim-file shall be generated + // check whether plain-output files shall be generated if (oc.isSet("plain-output-prefix")) { writeNodes(oc, nb.getNodeCont()); writeEdgesAndConnections(oc, nb.getNodeCont(), nb.getEdgeCont()); @@ -67,6 +68,9 @@ if (oc.isSet("junctions.join-output")) { writeJoinedJunctions(oc, nb.getNodeCont()); } + if (oc.isSet("street-sign-output")) { + writeStreetSigns(oc, nb.getEdgeCont()); + } } @@ -108,7 +112,7 @@ device.writeAttr(SUMO_ATTR_TYPE, toString(n->getType())); if (n->isTLControlled()) { - const std::set &tlss = n->getControllingTLS(); + const std::set& tlss = n->getControllingTLS(); // set may contain multiple programs for the same id. // make sure ids are unique and sorted std::set tlsIDs; @@ -144,7 +148,7 @@ edevice.writeAttr(SUMO_ATTR_FROM, e->getFromNode()->getID()); edevice.writeAttr(SUMO_ATTR_TO, e->getToNode()->getID()); if (!noNames && e->getStreetName() != "") { - edevice.writeAttr(SUMO_ATTR_NAME, e->getStreetName()); + edevice.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(e->getStreetName())); } edevice.writeAttr(SUMO_ATTR_PRIORITY, e->getPriority()); // write the type if given @@ -262,7 +266,7 @@ device.openTag(SUMO_TAG_JOIN); // prepare string std::ostringstream oss; - for (std::set::iterator it_id = it->begin(); it_id != it->end(); it_id++) { + for (std::set::const_iterator it_id = it->begin(); it_id != it->end(); it_id++) { oss << *it_id << " "; } // remove final space @@ -272,5 +276,20 @@ } device.close(); } + + +void +NWWriter_XML::writeStreetSigns(const OptionsCont& oc, NBEdgeCont& ec) { + OutputDevice& device = OutputDevice::getDevice(oc.getString("street-sign-output")); + device.writeXMLHeader("pois", SUMOSAXAttributes::ENCODING, NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/poi_file.xsd\""); + for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { + NBEdge* e = (*i).second; + const std::vector& signs = e->getSigns(); + for (std::vector::const_iterator it = signs.begin(); it != signs.end(); ++it) { + it->writeAsPOI(device, e); + } + } + device.close(); +} /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/netwrite/NWWriter_XML.h sumo-0.16.0~dfsg/src/netwrite/NWWriter_XML.h --- sumo-0.15.0~dfsg/src/netwrite/NWWriter_XML.h 2012-03-06 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/netwrite/NWWriter_XML.h 2012-11-06 00:02:37.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 11.05.2011 -/// @version $Id: NWWriter_XML.h 12012 2012-03-05 09:41:53Z namdre $ +/// @version $Id: NWWriter_XML.h 12930 2012-11-05 06:46:51Z namdre $ /// // Exporter writing networks using XML (native input) format /****************************************************************************/ @@ -74,6 +74,12 @@ */ static void writeJoinedJunctions(const OptionsCont& oc, NBNodeCont& nc); + /** @brief Writes street signs as POIs to file + * @param[in] oc The options to use + * @param[in] ec The edge-container from which to read data + */ + static void writeStreetSigns(const OptionsCont& oc, NBEdgeCont& ec); + private: /** @brief Writes the nodes file * @param[in] oc The options to use diff -Nru sumo-0.15.0~dfsg/src/od2trips/Makefile.am sumo-0.16.0~dfsg/src/od2trips/Makefile.am --- sumo-0.15.0~dfsg/src/od2trips/Makefile.am 2010-03-06 00:02:56.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -5,8 +5,8 @@ endif COMMON_LIBS = ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../foreign/tcpip/libtcpip.a \ diff -Nru sumo-0.15.0~dfsg/src/od2trips/Makefile.in sumo-0.16.0~dfsg/src/od2trips/Makefile.in --- sumo-0.15.0~dfsg/src/od2trips/Makefile.in 2012-03-14 00:11:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -54,7 +54,7 @@ od2trips_OBJECTS = $(am_od2trips_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../utils/options/liboptions.a \ - ../utils/common/libcommon.a ../utils/xml/libxml.a \ + ../utils/xml/libxml.a ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) $(am__DEPENDENCIES_1) @@ -113,6 +113,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -143,6 +144,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -177,6 +179,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -210,7 +213,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -232,8 +234,8 @@ top_srcdir = @top_srcdir@ @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a COMMON_LIBS = ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../foreign/tcpip/libtcpip.a \ diff -Nru sumo-0.15.0~dfsg/src/od2trips/ODDistrict.h sumo-0.16.0~dfsg/src/od2trips/ODDistrict.h --- sumo-0.15.0~dfsg/src/od2trips/ODDistrict.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/ODDistrict.h 2012-09-25 22:01:56.000000000 +0000 @@ -2,7 +2,7 @@ /// @file ODDistrict.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: ODDistrict.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ODDistrict.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A district (origin/destination) /****************************************************************************/ @@ -54,11 +54,11 @@ * * @param[in] id The id of the district */ - ODDistrict(const std::string& id) ; + ODDistrict(const std::string& id); /// @brief Destructor - ~ODDistrict() ; + ~ODDistrict(); /** @brief Adds a source connection @@ -74,7 +74,7 @@ * @param[in] id The id of the source * @param[in] weight The weight (probability to be chosen) of the source */ - void addSource(const std::string& id, SUMOReal weight) ; + void addSource(const std::string& id, SUMOReal weight); /** @brief Adds a sink connection @@ -90,7 +90,7 @@ * @param[in] id The id of the sink * @param[in] weight The weight (probability to be chosen) of the sink */ - void addSink(const std::string& id, SUMOReal weight) ; + void addSink(const std::string& id, SUMOReal weight); /** @brief Returns the id of a source to use diff -Nru sumo-0.15.0~dfsg/src/od2trips/ODDistrictCont.h sumo-0.16.0~dfsg/src/od2trips/ODDistrictCont.h --- sumo-0.15.0~dfsg/src/od2trips/ODDistrictCont.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/ODDistrictCont.h 2012-09-25 22:01:56.000000000 +0000 @@ -2,7 +2,7 @@ /// @file ODDistrictCont.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: ODDistrictCont.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ODDistrictCont.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A container for districts /****************************************************************************/ @@ -47,11 +47,11 @@ class ODDistrictCont : public NamedObjectCont { public: /// Constructor - ODDistrictCont() ; + ODDistrictCont(); /// Destructor - ~ODDistrictCont() ; + ~ODDistrictCont(); /** @brief Returns the id of a random source from the named district diff -Nru sumo-0.15.0~dfsg/src/od2trips/ODDistrictHandler.cpp sumo-0.16.0~dfsg/src/od2trips/ODDistrictHandler.cpp --- sumo-0.15.0~dfsg/src/od2trips/ODDistrictHandler.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/ODDistrictHandler.cpp 2012-09-25 22:01:56.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ODDistrictHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ODDistrictHandler.cpp 12567 2012-08-20 10:01:44Z dkrajzew $ /// // An XML-Handler for districts /****************************************************************************/ @@ -52,8 +52,7 @@ // =========================================================================== ODDistrictHandler::ODDistrictHandler(ODDistrictCont& cont, const std::string& file) - : SUMOSAXHandler(file), myContainer(cont), myCurrentDistrict(0), - myHaveWarnedAboutDeprecatedDistrict(false), myHaveWarnedAboutDeprecatedDSource(false), myHaveWarnedAboutDeprecatedDSink(false) {} + : SUMOSAXHandler(file), myContainer(cont), myCurrentDistrict(0) {} ODDistrictHandler::~ODDistrictHandler() {} @@ -63,27 +62,12 @@ ODDistrictHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { switch (element) { - case SUMO_TAG_DISTRICT__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDistrict) { - myHaveWarnedAboutDeprecatedDistrict = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DISTRICT__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZ) + "'."); - } case SUMO_TAG_TAZ: openDistrict(attrs); break; - case SUMO_TAG_DSOURCE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDSource) { - myHaveWarnedAboutDeprecatedDSource = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DSOURCE__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZSOURCE) + "'."); - } case SUMO_TAG_TAZSOURCE: addSource(attrs); break; - case SUMO_TAG_DSINK__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDSink) { - myHaveWarnedAboutDeprecatedDSink = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DSINK__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZSINK) + "'."); - } case SUMO_TAG_TAZSINK: addSink(attrs); break; @@ -95,7 +79,7 @@ void ODDistrictHandler::myEndElement(int element) { - if (element == SUMO_TAG_DISTRICT__DEPRECATED || element == SUMO_TAG_TAZ) { + if (element == SUMO_TAG_TAZ) { closeDistrict(); } } @@ -149,8 +133,7 @@ SUMOReal weight = attrs.getSUMORealReporting(SUMO_ATTR_WEIGHT, id.c_str(), ok); if (ok) { if (weight < 0) { - WRITE_ERROR("'probability' must be positive (in definition of " + - attrs.getObjectType() + " '" + id + "')."); + WRITE_ERROR("'probability' must be positive (in definition of " + attrs.getObjectType() + " '" + id + "')."); } else { return std::pair(id, weight); } diff -Nru sumo-0.15.0~dfsg/src/od2trips/ODDistrictHandler.h sumo-0.16.0~dfsg/src/od2trips/ODDistrictHandler.h --- sumo-0.15.0~dfsg/src/od2trips/ODDistrictHandler.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/ODDistrictHandler.h 2012-09-25 22:01:56.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ODDistrictHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ODDistrictHandler.h 12567 2012-08-20 10:01:44Z dkrajzew $ /// // An XML-Handler for districts /****************************************************************************/ @@ -62,11 +62,11 @@ * @param[in] cont The container of districts to fill * @param[in] file The file that will be processed */ - ODDistrictHandler(ODDistrictCont& cont, const std::string& file) ; + ODDistrictHandler(ODDistrictCont& cont, const std::string& file); /// @brief Destructor - ~ODDistrictHandler() ; + ~ODDistrictHandler(); protected: @@ -84,7 +84,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -94,7 +94,7 @@ * @param[in] element ID of the currently opened element * @exception ProcessError If an error within the parsed file occurs */ - void myEndElement(int element) ; + void myEndElement(int element); //@} @@ -107,7 +107,7 @@ * * @param[in] attrs Attributes of the currently opened element */ - void openDistrict(const SUMOSAXAttributes& attrs) ; + void openDistrict(const SUMOSAXAttributes& attrs); /** @brief Adds a read source to the current district @@ -121,7 +121,7 @@ * @param[in] attrs Attributes of the currently opened element * @todo Checking whether myCurrentDistrict is valid through getValues is not quite nice */ - void addSource(const SUMOSAXAttributes& attrs) ; + void addSource(const SUMOSAXAttributes& attrs); /** @brief Adds a read sink to the current district @@ -135,14 +135,14 @@ * @param[in] attrs Attributes of the currently opened element * @todo Checking whether myCurrentDistrict is valid through getValues is not quite nice */ - void addSink(const SUMOSAXAttributes& attrs) ; + void addSink(const SUMOSAXAttributes& attrs); /** @brief Closes the processing of the current district * * Adds myCurrentDistrict to myContainer. */ - void closeDistrict() ; + void closeDistrict(); /** @brief Returns the id and weight for a sink/source @@ -160,7 +160,7 @@ * @param[in] type The type of the currntly processed connection (sink/source) * @return The id and the weight of a connection */ - std::pair parseConnection(const SUMOSAXAttributes& attrs) ; + std::pair parseConnection(const SUMOSAXAttributes& attrs); private: /// The container to add read districts to @@ -169,8 +169,6 @@ /// The currently parsed district ODDistrict* myCurrentDistrict; - bool myHaveWarnedAboutDeprecatedDistrict, myHaveWarnedAboutDeprecatedDSource, myHaveWarnedAboutDeprecatedDSink; - private: /// @brief invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/od2trips/ODMatrix.cpp sumo-0.16.0~dfsg/src/od2trips/ODMatrix.cpp --- sumo-0.15.0~dfsg/src/od2trips/ODMatrix.cpp 2012-02-29 00:03:21.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/ODMatrix.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 05 Apr. 2006 -/// @version $Id: ODMatrix.cpp 11973 2012-02-28 22:26:32Z behrisch $ +/// @version $Id: ODMatrix.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An O/D (origin/destination) matrix /****************************************************************************/ @@ -55,7 +55,7 @@ ODMatrix::~ODMatrix() { - for (CellVector::iterator i = myContainer.begin(); i != myContainer.end(); ++i) { + for (std::vector::iterator i = myContainer.begin(); i != myContainer.end(); ++i) { delete *i; } myContainer.clear(); @@ -98,25 +98,24 @@ SUMOReal ODMatrix::computeDeparts(ODCell* cell, - size_t& vehName, std::vector &into, + size_t& vehName, std::vector& into, bool uniform, const std::string& prefix) { int vehicles2insert = (int) cell->vehicleNumber; // compute whether the fraction forces an additional vehicle insertion - SUMOReal mrand = RandHelper::rand(); SUMOReal mprob = (SUMOReal) cell->vehicleNumber - (SUMOReal) vehicles2insert; - if (mrand < mprob) { + if (RandHelper::rand() < mprob) { vehicles2insert++; } - SUMOReal offset = (SUMOReal)(cell->end - cell->begin) / (SUMOReal) vehicles2insert / (SUMOReal) 2.; + const SUMOReal offset = (SUMOReal)(cell->end - cell->begin) / (SUMOReal) vehicles2insert / (SUMOReal) 2.; for (int i = 0; i < vehicles2insert; ++i) { ODVehicle veh; veh.id = prefix + toString(vehName++); if (uniform) { - veh.depart = (unsigned int)(offset + cell->begin + ((SUMOReal)(cell->end - cell->begin) * (SUMOReal) i / (SUMOReal) vehicles2insert)); + veh.depart = (SUMOTime)(offset + cell->begin + ((SUMOReal)(cell->end - cell->begin) * (SUMOReal) i / (SUMOReal) vehicles2insert)); } else { - veh.depart = (unsigned int) RandHelper::rand((int) cell->begin, (int) cell->end); + veh.depart = (SUMOTime)RandHelper::rand(cell->begin, cell->end); } veh.from = myDistricts.getRandomSourceFromDistrict(cell->origin); @@ -140,14 +139,15 @@ size_t vehName = 0; sort(myContainer.begin(), myContainer.end(), cell_by_begin_sorter()); // recheck begin time - ODCell* first = *myContainer.begin(); - begin = MAX2(begin, first->begin); - CellVector::iterator next = myContainer.begin(); + begin = MAX2(begin, myContainer.front()->begin); + std::vector::iterator next = myContainer.begin(); std::vector vehicles; + SUMOTime lastOut = -DELTA_T; // go through the time steps - for (SUMOTime t = begin; t != end; t++) { - if (stepLog) { - std::cout << "Parsing time " + toString(t) << '\r'; + for (SUMOTime t = begin; t != end;) { + if (stepLog && t - lastOut >= DELTA_T) { + std::cout << "Parsing time " + time2string(t) << '\r'; + lastOut = t; } // recheck whether a new cell got valid bool changed = false; @@ -159,61 +159,58 @@ fractionLeft[odID] = 0; } // get the new departures (into tmp) - std::vector tmp; - SUMOReal fraction = computeDeparts(*next, vehName, tmp, uniform, prefix); - // copy new departures if any - if (tmp.size() != 0) { - copy(tmp.begin(), tmp.end(), back_inserter(vehicles)); + const size_t oldSize = vehicles.size(); + const SUMOReal fraction = computeDeparts(*next, vehName, vehicles, uniform, prefix); + if (oldSize != vehicles.size()) { changed = true; } - // save the fraction if (fraction != 0) { - if (fractionLeft.find(odID) == fractionLeft.end()) { - fractionLeft[odID] = fraction; - } else { - fractionLeft[odID] += fraction; - } + fractionLeft[odID] = fraction; } - // ++next; } if (changed) { sort(vehicles.begin(), vehicles.end(), descending_departure_comperator()); } - std::vector::reverse_iterator i = vehicles.rbegin(); - for (; i != vehicles.rend() && (*i).depart == t; ++i) { + for (std::vector::reverse_iterator i = vehicles.rbegin(); i != vehicles.rend() && (*i).depart == t; ++i) { myNoWritten++; - dev.openTag("trip") << " id=\"" << (*i).id << "\" depart=\"" << t << ".00\" " - << "from=\"" << (*i).from << "\" " - << "to=\"" << (*i).to << "\""; + dev.openTag(SUMO_TAG_TRIP).writeAttr(SUMO_ATTR_ID, (*i).id).writeAttr(SUMO_ATTR_DEPART, time2string(t)).writeAttr(SUMO_ATTR_FROM, (*i).from).writeAttr(SUMO_ATTR_TO, (*i).to); if (!noVtype && (*i).cell->vehicleType.length() != 0) { - dev << " type=\"" << (*i).cell->vehicleType << "\""; + dev.writeAttr(SUMO_ATTR_TYPE, (*i).cell->vehicleType); } - dev << " fromTaz=\"" << (*i).cell->origin << "\""; - dev << " toTaz=\"" << (*i).cell->destination << "\""; + dev.writeAttr(SUMO_ATTR_FROM_TAZ, (*i).cell->origin).writeAttr(SUMO_ATTR_TO_TAZ, (*i).cell->destination); if (oc.isSet("departlane") && oc.getString("departlane") != "default") { - dev << " departLane=\"" << oc.getString("departlane") << "\""; + dev.writeAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane")); } if (oc.isSet("departpos")) { - dev << " departPos=\"" << oc.getString("departpos") << "\""; + dev.writeAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos")); } if (oc.isSet("departspeed") && oc.getString("departspeed") != "default") { - dev << " departSpeed=\"" << oc.getString("departspeed") << "\""; + dev.writeAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed")); } if (oc.isSet("arrivallane")) { - dev << " arrivalLane=\"" << oc.getString("arrivallane") << "\""; + dev.writeAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane")); } if (oc.isSet("arrivalpos")) { - dev << " arrivalPos=\"" << oc.getString("arrivalpos") << "\""; + dev.writeAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos")); } if (oc.isSet("arrivalspeed")) { - dev << " arrivalSpeed=\"" << oc.getString("arrivalspeed") << "\""; + dev.writeAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed")); } dev.closeTag(true); } - while (vehicles.size() != 0 && (*vehicles.rbegin()).depart == t) { + while (vehicles.size() != 0 && vehicles.back().depart == t) { vehicles.pop_back(); } + if (!vehicles.empty()) { + t = vehicles.back().depart; + } + if (next != myContainer.end() && (t > (*next)->begin || vehicles.empty())) { + t = (*next)->begin; + } + if (next == myContainer.end() && vehicles.empty()) { + break; + } } } @@ -237,11 +234,11 @@ void -ODMatrix::applyCurve(const Distribution_Points& ps, ODCell* cell, CellVector& newCells) { +ODMatrix::applyCurve(const Distribution_Points& ps, ODCell* cell, std::vector& newCells) { for (size_t i = 0; i < ps.getAreaNo(); ++i) { ODCell* ncell = new ODCell(); - ncell->begin = (SUMOTime) ps.getAreaBegin(i); - ncell->end = (SUMOTime) ps.getAreaEnd(i); + ncell->begin = TIME2STEPS(ps.getAreaBegin(i)); + ncell->end = TIME2STEPS(ps.getAreaEnd(i)); ncell->origin = cell->origin; ncell->destination = cell->destination; ncell->vehicleType = cell->vehicleType; @@ -253,10 +250,10 @@ void ODMatrix::applyCurve(const Distribution_Points& ps) { - CellVector oldCells = myContainer; + std::vector oldCells = myContainer; myContainer.clear(); - for (CellVector::iterator i = oldCells.begin(); i != oldCells.end(); ++i) { - CellVector newCells; + for (std::vector::iterator i = oldCells.begin(); i != oldCells.end(); ++i) { + std::vector newCells; applyCurve(ps, *i, newCells); copy(newCells.begin(), newCells.end(), back_inserter(myContainer)); delete *i; diff -Nru sumo-0.15.0~dfsg/src/od2trips/ODMatrix.h sumo-0.16.0~dfsg/src/od2trips/ODMatrix.h --- sumo-0.15.0~dfsg/src/od2trips/ODMatrix.h 2012-02-29 00:03:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/ODMatrix.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 05. Apr. 2006 -/// @version $Id: ODMatrix.h 11973 2012-02-28 22:26:32Z behrisch $ +/// @version $Id: ODMatrix.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An O/D (origin/destination) matrix /****************************************************************************/ @@ -75,11 +75,11 @@ * * @param[in] dc The district container to obtain referenced distrivts from */ - ODMatrix(const ODDistrictCont& dc) ; + ODMatrix(const ODDistrictCont& dc); /// Destructor - ~ODMatrix() ; + ~ODMatrix(); /** @brief Builds a single cell from the given values, verifying them @@ -105,7 +105,7 @@ */ void add(SUMOReal vehicleNumber, SUMOTime begin, SUMOTime end, const std::string& origin, const std::string& destination, - const std::string& vehicleType) ; + const std::string& vehicleType); /** @brief Writes the vehicles stored in the matrix assigning the sources and sinks @@ -134,7 +134,7 @@ */ void write(SUMOTime begin, SUMOTime end, OutputDevice& dev, bool uniform, bool noVtype, - const std::string& prefix, bool stepLog) ; + const std::string& prefix, bool stepLog); /** @brief Returns the number of loaded vehicles @@ -143,7 +143,7 @@ * * @return The number of loaded vehicles */ - SUMOReal getNoLoaded() const ; + SUMOReal getNoLoaded() const; /** @brief Returns the number of written vehicles @@ -152,7 +152,7 @@ * * @return The number of written vehicles */ - SUMOReal getNoWritten() const ; + SUMOReal getNoWritten() const; /** @brief Returns the number of discarded vehicles @@ -161,13 +161,13 @@ * * @return The number of discarded vehicles */ - SUMOReal getNoDiscarded() const ; + SUMOReal getNoDiscarded() const; /** @brief Splits the stored cells dividing them on the given time line * @todo Describe */ - void applyCurve(const Distribution_Points& ps) ; + void applyCurve(const Distribution_Points& ps); protected: @@ -190,10 +190,6 @@ }; - /// Definition of a container for cells - typedef std::vector CellVector; - - /** @brief Computes the vehicle departs stored in the given cell and saves them in "into" * * At first, the number of vehicles to insert is computed using the @@ -219,8 +215,8 @@ * @return The number of left vehicles to insert */ SUMOReal computeDeparts(ODCell* cell, - size_t& vehName, std::vector &into, bool uniform, - const std::string& prefix) ; + size_t& vehName, std::vector& into, bool uniform, + const std::string& prefix); /** @brief Splits the given cell dividing it on the given time line and @@ -239,12 +235,12 @@ * @todo describe better!!! */ void applyCurve(const Distribution_Points& ps, ODCell* cell, - CellVector& newCells) ; + std::vector& newCells); protected: /// @brief The loaded cells - CellVector myContainer; + std::vector myContainer; /// @brief The districts to retrieve sources/sinks from const ODDistrictCont& myDistricts; diff -Nru sumo-0.15.0~dfsg/src/od2trips/od2trips_main.cpp sumo-0.16.0~dfsg/src/od2trips/od2trips_main.cpp --- sumo-0.15.0~dfsg/src/od2trips/od2trips_main.cpp 2012-02-29 00:03:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/od2trips/od2trips_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Thu, 12 September 2002 -/// @version $Id: od2trips_main.cpp 11973 2012-02-28 22:26:32Z behrisch $ +/// @version $Id: od2trips_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for OD2TRIPS /****************************************************************************/ @@ -59,11 +59,9 @@ #include #include #include -#include #include #include #include -#include #ifdef CHECK_MEMORY_LEAKS #include @@ -168,7 +166,7 @@ Distribution_Points -parseTimeLine(const std::vector &def, bool timelineDayInHours) { +parseTimeLine(const std::vector& def, bool timelineDayInHours) { bool interpolating = !timelineDayInHours; PositionVector points; SUMOReal prob = 0; @@ -177,7 +175,7 @@ throw ProcessError("Assuming 24 entries for a day timeline, but got " + toString(def.size()) + "."); } for (int chour = 0; chour < 24; ++chour) { - prob = TplConvert::_2SUMOReal(def[chour].c_str()); + prob = TplConvert::_2SUMOReal(def[chour].c_str()); points.push_back(Position((SUMOReal)(chour * 3600), prob)); } points.push_back(Position((SUMOReal)(24 * 3600), prob)); @@ -188,8 +186,8 @@ if (st2.size() != 2) { throw ProcessError("Broken time line definition: missing a value in '" + def[i - 1] + "'."); } - int time = TplConvert::_2int(st2.next().c_str()); - prob = TplConvert::_2SUMOReal(st2.next().c_str()); + int time = TplConvert::_2int(st2.next().c_str()); + prob = TplConvert::_2SUMOReal(st2.next().c_str()); points.push_back(Position((SUMOReal) time, prob)); } } @@ -214,12 +212,32 @@ ok = false; } // - ok &= (!oc.isSet("departlane") || SUMOVehicleParameter::departlaneValidate(oc.getString("departlane"))); - ok &= (!oc.isSet("departpos") || SUMOVehicleParameter::departposValidate(oc.getString("departpos"))); - ok &= (!oc.isSet("departspeed") || SUMOVehicleParameter::departspeedValidate(oc.getString("departspeed"))); - ok &= (!oc.isSet("arrivallane") || SUMOVehicleParameter::arrivallaneValidate(oc.getString("arrivallane"))); - ok &= (!oc.isSet("arrivalpos") || SUMOVehicleParameter::arrivalposValidate(oc.getString("arrivalpos"))); - ok &= (!oc.isSet("arrivalspeed") || SUMOVehicleParameter::arrivalspeedValidate(oc.getString("arrivalspeed"))); + SUMOVehicleParameter p; + std::string error; + if (oc.isSet("departlane") && !SUMOVehicleParameter::parseDepartLane(oc.getString("departlane"), "option", "departlane", p.departLane, p.departLaneProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("departpos") && !SUMOVehicleParameter::parseDepartPos(oc.getString("departpos"), "option", "departpos", p.departPos, p.departPosProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("departspeed") && !SUMOVehicleParameter::parseDepartSpeed(oc.getString("departspeed"), "option", "departspeed", p.departSpeed, p.departSpeedProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivallane") && !SUMOVehicleParameter::parseArrivalLane(oc.getString("arrivallane"), "option", "arrivallane", p.arrivalLane, p.arrivalLaneProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivalpos") && !SUMOVehicleParameter::parseArrivalPos(oc.getString("arrivalpos"), "option", "arrivalpos", p.arrivalPos, p.arrivalPosProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } + if (oc.isSet("arrivalspeed") && !SUMOVehicleParameter::parseArrivalSpeed(oc.getString("arrivalspeed"), "option", "arrivalspeed", p.arrivalSpeed, p.arrivalSpeedProcedure, error)) { + WRITE_ERROR(error); + ok = false; + } return ok; } @@ -267,7 +285,7 @@ } std::string hours = time.substr(0, time.find('.')); std::string minutes = time.substr(time.find('.') + 1); - return (SUMOTime) TplConvert::_2int(hours.c_str()) * 3600 + TplConvert::_2int(minutes.c_str()) * 60; + return TIME2STEPS(TplConvert::_2int(hours.c_str()) * 3600 + TplConvert::_2int(minutes.c_str()) * 60); } @@ -295,7 +313,7 @@ std::string line = getNextNonCommentLine(lr); SUMOReal factor = -1; try { - factor = TplConvert::_2SUMOReal(line.c_str()) * scale; + factor = TplConvert::_2SUMOReal(line.c_str()) * scale; } catch (NumberFormatException&) { throw ProcessError("Broken factor: '" + line + "'."); } @@ -327,7 +345,7 @@ // districts line = getNextNonCommentLine(lr); - int districtNo = TplConvert::_2int(StringUtils::prune(line).c_str()); + int districtNo = TplConvert::_2int(StringUtils::prune(line).c_str()); // parse district names (normally ints) std::vector names; do { @@ -351,7 +369,7 @@ StringTokenizer st2(line, StringTokenizer::WHITECHARS); while (st2.hasNext()) { assert(di != names.end()); - SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; + SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; if (vehNumber != 0) { into.add(vehNumber, begin, end, *si, *di, vehType); } @@ -380,7 +398,7 @@ std::string line; if (matrixHasVehType) { line = getNextNonCommentLine(lr); - int type = TplConvert::_2int(StringUtils::prune(line).c_str()); + int type = TplConvert::_2int(StringUtils::prune(line).c_str()); if (vehType == "") { vehType = toString(type); } @@ -407,7 +425,7 @@ try { std::string sourceD = st2.next(); std::string destD = st2.next(); - SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; + SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; if (vehNumber != 0) { into.add(vehNumber, begin, end, sourceD, destD, vehType); } @@ -471,14 +489,14 @@ int ret = 0; try { // initialise subsystems - XMLSubSys::init(false); + XMLSubSys::init(); fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!checkOptions()) { throw ProcessError(); @@ -509,24 +527,30 @@ throw ProcessError("No output name is given."); } OutputDevice& dev = OutputDevice::getDeviceByOption("output-file"); - matrix.write(SUMOTime(string2time(oc.getString("begin")) / 1000.), SUMOTime(string2time(oc.getString("end")) / 1000.), - dev, oc.getBool("spread.uniform"), oc.getBool("ignore-vehicle-type"), oc.getString("prefix"), !oc.getBool("no-step-log")); + matrix.write(string2time(oc.getString("begin")), string2time(oc.getString("end")), + dev, oc.getBool("spread.uniform"), oc.getBool("ignore-vehicle-type"), + oc.getString("prefix"), !oc.getBool("no-step-log")); WRITE_MESSAGE(toString(matrix.getNoDiscarded()) + " vehicles discarded."); WRITE_MESSAGE(toString(matrix.getNoWritten()) + " vehicles written."); - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } SystemFrame::close(); - OutputDevice::closeAll(); if (ret == 0) { std::cout << "Success." << std::endl; } diff -Nru sumo-0.15.0~dfsg/src/polyconvert/Makefile.am sumo-0.16.0~dfsg/src/polyconvert/Makefile.am --- sumo-0.15.0~dfsg/src/polyconvert/Makefile.am 2010-03-06 00:02:56.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/Makefile.am 2012-11-19 00:02:17.000000000 +0000 @@ -13,8 +13,8 @@ endif COMMON_LIBS = ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../foreign/tcpip/libtcpip.a \ diff -Nru sumo-0.15.0~dfsg/src/polyconvert/Makefile.in sumo-0.16.0~dfsg/src/polyconvert/Makefile.in --- sumo-0.15.0~dfsg/src/polyconvert/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -57,7 +57,7 @@ polyconvert_OBJECTS = $(am_polyconvert_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../utils/options/liboptions.a \ - ../utils/common/libcommon.a ../utils/xml/libxml.a \ + ../utils/xml/libxml.a ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) $(am__DEPENDENCIES_1) @@ -117,6 +117,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -147,6 +148,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -181,6 +183,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -214,7 +217,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -238,8 +240,8 @@ @WITH_GDAL_TRUE@GDAL_LIBS = -l$(LIB_GDAL) @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a COMMON_LIBS = ../utils/options/liboptions.a \ -../utils/common/libcommon.a \ ../utils/xml/libxml.a \ +../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ ../foreign/tcpip/libtcpip.a \ diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderArcView.cpp sumo-0.16.0~dfsg/src/polyconvert/PCLoaderArcView.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderArcView.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderArcView.cpp 2012-11-07 00:02:21.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: PCLoaderArcView.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCLoaderArcView.cpp 12943 2012-11-06 09:20:20Z dkrajzew $ /// // A reader of pois and polygons from shape files /****************************************************************************/ @@ -81,6 +81,7 @@ RGBColor color = RGBColor::parseColor(oc.getString("color")); int layer = oc.getInt("layer"); std::string idField = oc.getString("shapefile.id-column"); + bool useRunningID = oc.getBool("shapefile.use-running-id"); // start parsing std::string shpName = file + ".shp"; OGRRegisterAll(); @@ -112,9 +113,11 @@ OGRFeature* poFeature; poLayer->ResetReading(); + unsigned int runningID = 0; while ((poFeature = poLayer->GetNextFeature()) != NULL) { // read in edge attributes - std::string id = poFeature->GetFieldAsString(idField.c_str()); + std::string id = useRunningID ? toString(runningID) : poFeature->GetFieldAsString(idField.c_str()); + ++runningID; id = StringUtils::prune(id); if (id == "") { throw ProcessError("Missing id under '" + idField + "'"); @@ -134,9 +137,9 @@ if (!geoConvHelper.x2cartesian(pos)) { WRITE_ERROR("Unable to project coordinates for POI '" + id + "'."); } - PointOfInterest* poi = new PointOfInterest(id, type, pos, color); + PointOfInterest* poi = new PointOfInterest(id, type, color, pos, (SUMOReal)layer); if (!toFill.insert(id, poi, layer)) { - WRITE_ERROR("POI '" + id + "' could not been added."); + WRITE_ERROR("POI '" + id + "' could not be added."); delete poi; } } @@ -151,9 +154,9 @@ } shape.push_back_noDoublePos(pos); } - Polygon* poly = new Polygon(id, type, color, shape, false); + Polygon* poly = new Polygon(id, type, color, shape, false, (SUMOReal)layer); if (!toFill.insert(id, poly, layer)) { - WRITE_ERROR("Polygon '" + id + "' could not been added."); + WRITE_ERROR("Polygon '" + id + "' could not be added."); delete poly; } } @@ -168,9 +171,9 @@ } shape.push_back_noDoublePos(pos); } - Polygon* poly = new Polygon(id, type, color, shape, true); + Polygon* poly = new Polygon(id, type, color, shape, true, (SUMOReal)layer); if (!toFill.insert(id, poly, layer)) { - WRITE_ERROR("Polygon '" + id + "' could not been added."); + WRITE_ERROR("Polygon '" + id + "' could not be added."); delete poly; } } @@ -184,9 +187,9 @@ if (!geoConvHelper.x2cartesian(pos)) { WRITE_ERROR("Unable to project coordinates for POI '" + tid + "'."); } - PointOfInterest* poi = new PointOfInterest(tid, type, pos, color); + PointOfInterest* poi = new PointOfInterest(tid, type, color, pos, (SUMOReal)layer); if (!toFill.insert(tid, poi, layer)) { - WRITE_ERROR("POI '" + tid + "' could not been added."); + WRITE_ERROR("POI '" + tid + "' could not be added."); delete poi; } } @@ -205,9 +208,9 @@ } shape.push_back_noDoublePos(pos); } - Polygon* poly = new Polygon(tid, type, color, shape, false); + Polygon* poly = new Polygon(tid, type, color, shape, false, (SUMOReal)layer); if (!toFill.insert(tid, poly, layer)) { - WRITE_ERROR("Polygon '" + tid + "' could not been added."); + WRITE_ERROR("Polygon '" + tid + "' could not be added."); delete poly; } } @@ -226,9 +229,9 @@ } shape.push_back_noDoublePos(pos); } - Polygon* poly = new Polygon(tid, type, color, shape, true); + Polygon* poly = new Polygon(tid, type, color, shape, true, (SUMOReal)layer); if (!toFill.insert(tid, poly, layer)) { - WRITE_ERROR("Polygon '" + tid + "' could not been added."); + WRITE_ERROR("Polygon '" + tid + "' could not be added."); delete poly; } } diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderArcView.h sumo-0.16.0~dfsg/src/polyconvert/PCLoaderArcView.h --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderArcView.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderArcView.h 2012-09-25 22:01:39.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: PCLoaderArcView.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCLoaderArcView.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A reader of pois and polygons from shape files /****************************************************************************/ @@ -70,7 +70,7 @@ * @exception ProcessError if something fails */ static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); protected: @@ -81,7 +81,7 @@ * @exception ProcessError if something fails */ static void load(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); private: diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.cpp sumo-0.16.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.cpp 2012-10-18 23:02:43.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderDlrNavteq.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCLoaderDlrNavteq.cpp 12857 2012-10-18 11:33:33Z namdre $ /// // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format /****************************************************************************/ @@ -174,9 +174,9 @@ if (OptionsCont::getOptions().isInStringVector("prune.keep-list", name)) { ignorePrunning = true; } - PointOfInterest* poi = new PointOfInterest(name, type, pos, color); + PointOfInterest* poi = new PointOfInterest(name, type, color, pos, (SUMOReal)layer); if (!toFill.insert(name, poi, layer, ignorePrunning)) { - WRITE_ERROR("POI '" + name + "' could not been added."); + WRITE_ERROR("POI '" + name + "' could not be added."); delete poi; } } @@ -221,8 +221,8 @@ std::string xpos = values[index]; std::string ypos = values[index + 1]; index += 2; - SUMOReal x = TplConvert::_2SUMOReal(xpos.c_str()); - SUMOReal y = TplConvert::_2SUMOReal(ypos.c_str()); + SUMOReal x = TplConvert::_2SUMOReal(xpos.c_str()); + SUMOReal y = TplConvert::_2SUMOReal(ypos.c_str()); Position pos(x, y); if (!GeoConvHelper::getProcessing().x2cartesian(pos)) { WRITE_WARNING("Unable to project coordinates for polygon '" + id + "'."); @@ -264,9 +264,9 @@ color = c; } if (!discard) { - Polygon* poly = new Polygon(name, type, color, vec, fill); + Polygon* poly = new Polygon(name, type, color, vec, fill, (SUMOReal)layer); if (!toFill.insert(name, poly, layer)) { - WRITE_ERROR("Polygon '" + name + "' could not been added."); + WRITE_ERROR("Polygon '" + name + "' could not be added."); delete poly; } } diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.h sumo-0.16.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.h --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderDlrNavteq.h 2012-09-25 22:01:39.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderDlrNavteq.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCLoaderDlrNavteq.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format /****************************************************************************/ @@ -74,7 +74,7 @@ * @exception ProcessError if something fails */ static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); protected: @@ -89,7 +89,7 @@ * @exception ProcessError if something fails */ static void loadPOIFiles(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); /** @brief Loads polygons assumed to be stored as according DLR-Navteq (Elmar)-files @@ -103,7 +103,7 @@ * @exception ProcessError if something fails */ static void loadPolyFiles(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); /** @brief Loads DLR-Navteq (Elmar)-pois from the given file @@ -115,7 +115,7 @@ */ static void loadPOIFile(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); /** @brief Loads DLR-Navteq (Elmar)-polygons from the given file @@ -127,7 +127,7 @@ */ static void loadPolyFile(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); }; diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderOSM.cpp sumo-0.16.0~dfsg/src/polyconvert/PCLoaderOSM.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderOSM.cpp 2012-02-16 15:57:42.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderOSM.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Wed, 19.11.2008 -/// @version $Id: PCLoaderOSM.cpp 11908 2012-02-16 11:33:57Z dkrajzew $ +/// @version $Id: PCLoaderOSM.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A reader of pois and polygons stored in OSM-format /****************************************************************************/ @@ -71,7 +71,7 @@ // parse file(s) std::vector files = oc.getStringVector("osm-files"); // load nodes, first - std::map nodes; + std::map nodes; NodesHandler nodesHandler(nodes); for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { // nodes @@ -104,7 +104,7 @@ } // compute shape PositionVector vec; - for (std::vector::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { + for (std::vector::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { PCOSMNode* n = nodes.find(*j)->second; Position pos(n->lon, n->lat); if (!GeoConvHelper::getProcessing().x2cartesian(pos)) { @@ -146,15 +146,15 @@ } name = StringUtils::escapeXML(name); type = StringUtils::escapeXML(type); - Polygon* poly = new Polygon(name, type, color, vec, fill); + Polygon* poly = new Polygon(name, type, color, vec, fill, (SUMOReal)layer); if (!toFill.insert(name, poly, layer)) { - WRITE_ERROR("Polygon '" + name + "' could not been added."); + WRITE_ERROR("Polygon '" + name + "' could not be added."); delete poly; } } } // instantiate pois - for (std::map::iterator i = nodes.begin(); i != nodes.end(); ++i) { + for (std::map::iterator i = nodes.begin(); i != nodes.end(); ++i) { PCOSMNode* n = (*i).second; if (!n->myIsAdditional) { continue; @@ -199,9 +199,9 @@ } name = StringUtils::escapeXML(name); type = StringUtils::escapeXML(type); - PointOfInterest* poi = new PointOfInterest(name, type, pos, color); + PointOfInterest* poi = new PointOfInterest(name, type, color, pos, (SUMOReal)layer); if (!toFill.insert(name, poi, layer, ignorePrunning)) { - WRITE_ERROR("POI '" + name + "' could not been added."); + WRITE_ERROR("POI '" + name + "' could not be added."); delete poi; } } @@ -209,7 +209,7 @@ // delete nodes - for (std::map::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { + for (std::map::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { delete(*i).second; } // delete edges @@ -223,7 +223,7 @@ // --------------------------------------------------------------------------- // definitions of PCLoaderOSM::NodesHandler-methods // --------------------------------------------------------------------------- -PCLoaderOSM::NodesHandler::NodesHandler(std::map &toFill) +PCLoaderOSM::NodesHandler::NodesHandler(std::map& toFill) : SUMOSAXHandler("osm - file"), myToFill(toFill), myLastNodeID(-1) {} @@ -235,7 +235,7 @@ myParentElements.push_back(element); if (element == SUMO_TAG_NODE) { bool ok = true; - long id = attrs.getLongReporting(SUMO_ATTR_ID, 0, ok); + SUMOLong id = attrs.getLongReporting(SUMO_ATTR_ID, 0, ok); if (!ok) { return; } @@ -260,7 +260,7 @@ if (element == SUMO_TAG_TAG && myParentElements.size() > 2 && myParentElements[myParentElements.size() - 2] == SUMO_TAG_NODE) { bool ok = true; std::string key = attrs.getStringReporting(SUMO_ATTR_K, toString(myLastNodeID).c_str(), ok); - std::string value = attrs.getOptStringReporting(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, ""); + std::string value = attrs.getStringReporting(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, false); if (!ok) { return; } @@ -292,8 +292,8 @@ // definitions of PCLoaderOSM::EdgesHandler-methods // --------------------------------------------------------------------------- PCLoaderOSM::EdgesHandler::EdgesHandler( - const std::map &osmNodes, - std::map &toFill) + const std::map& osmNodes, + std::map& toFill) : SUMOSAXHandler("osm - file"), myOSMNodes(osmNodes), myEdgeMap(toFill) { } @@ -321,7 +321,7 @@ // parse "nd" (node) elements if (element == SUMO_TAG_ND) { bool ok = true; - long ref = attrs.getLongReporting(SUMO_ATTR_REF, 0, ok); + SUMOLong ref = attrs.getLongReporting(SUMO_ATTR_REF, 0, ok); if (ok) { if (myOSMNodes.find(ref) == myOSMNodes.end()) { WRITE_WARNING("The referenced geometry information (ref='" + toString(ref) + "') is not known"); @@ -334,7 +334,7 @@ if (element == SUMO_TAG_TAG && myParentElements.size() > 2 && myParentElements[myParentElements.size() - 2] == SUMO_TAG_WAY) { bool ok = true; std::string key = attrs.getStringReporting(SUMO_ATTR_K, toString(myCurrentEdge->id).c_str(), ok); - std::string value = attrs.getStringReporting(SUMO_ATTR_V, toString(myCurrentEdge->id).c_str(), ok); + std::string value = attrs.getStringReporting(SUMO_ATTR_V, toString(myCurrentEdge->id).c_str(), ok, false); if (!ok) { return; } diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderOSM.h sumo-0.16.0~dfsg/src/polyconvert/PCLoaderOSM.h --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderOSM.h 2012-02-11 00:02:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderOSM.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 19.11.2008 -/// @version $Id: PCLoaderOSM.h 11877 2012-02-10 14:20:46Z dkrajzew $ +/// @version $Id: PCLoaderOSM.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A reader of pois and polygons stored in OSM-format /****************************************************************************/ @@ -67,7 +67,7 @@ * @exception ProcessError if something fails */ static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); protected: @@ -75,7 +75,7 @@ */ struct PCOSMNode { /// @brief The node's id - long id; + SUMOLong id; /// @brief The longitude the node is located at SUMOReal lon; /// @brief The latitude the node is located at @@ -99,7 +99,7 @@ /// @brief Information whether this area is closed bool myIsClosed; /// @brief The list of nodes this edge is made of - std::vector myCurrentNodes; + std::vector myCurrentNodes; /// @brief Information whether this shall be parsed bool myIsAdditional; }; @@ -115,11 +115,11 @@ /** @brief Contructor * @param[in] toFill The nodes container to fill */ - NodesHandler(std::map &toFill) ; + NodesHandler(std::map& toFill); /// @brief Destructor - ~NodesHandler() ; + ~NodesHandler(); protected: @@ -133,7 +133,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 @@ -142,19 +142,19 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} private: /// @brief The nodes container to fill - std::map &myToFill; + std::map& myToFill; /// @brief Current path in order to know to what occuring values belong std::vector myParentElements; /// @brief The id of the last parsed node - long myLastNodeID; + SUMOLong myLastNodeID; private: @@ -179,12 +179,12 @@ * @param[in] osmNodes The previously parsed (osm-)nodes * @param[in] toFill The edges container to fill with read edges */ - EdgesHandler(const std::map &osmNodes, - std::map &toFill) ; + EdgesHandler(const std::map& osmNodes, + std::map& toFill); /// @brief Destructor - ~EdgesHandler() ; + ~EdgesHandler(); protected: @@ -198,7 +198,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 @@ -207,16 +207,16 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} private: /// @brief The previously parsed nodes - const std::map &myOSMNodes; + const std::map& myOSMNodes; /// @brief A map of built edges - std::map &myEdgeMap; + std::map& myEdgeMap; /// @brief The currently built edge PCOSMEdge* myCurrentEdge; diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderVisum.cpp sumo-0.16.0~dfsg/src/polyconvert/PCLoaderVisum.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderVisum.cpp 2012-02-21 00:03:06.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderVisum.cpp 2012-10-18 23:02:43.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderVisum.cpp 11937 2012-02-20 13:19:22Z dkrajzew $ +/// @version $Id: PCLoaderVisum.cpp 12857 2012-10-18 11:33:33Z namdre $ /// // A reader of pois and polygons stored in VISUM-format /****************************************************************************/ @@ -87,10 +87,10 @@ PCTypeMap& tm) { GeoConvHelper& geoConvHelper = GeoConvHelper::getProcessing(); std::string what; - std::map punkte; - std::map kanten; - std::map teilflaechen; - std::map flaechenelemente; + std::map punkte; + std::map kanten; + std::map teilflaechen; + std::map flaechenelemente; NamedColumnsParser lineParser; LineReader lr(file); while (lr.hasMore()) { @@ -102,9 +102,9 @@ // read items if (what == "$PUNKT") { lineParser.parseLine(line); - long id = TplConvert::_2long(lineParser.get("ID").c_str()); - SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str()); - SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str()); + SUMOLong id = TplConvert::_2long(lineParser.get("ID").c_str()); + SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str()); + SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str()); Position pos(x, y); if (!geoConvHelper.x2cartesian(pos)) { WRITE_WARNING("Unable to project coordinates for point '" + toString(id) + "'."); @@ -113,9 +113,9 @@ continue; } else if (what == "$KANTE") { lineParser.parseLine(line); - long id = TplConvert::_2long(lineParser.get("ID").c_str()); - long fromID = TplConvert::_2long(lineParser.get("VONPUNKTID").c_str()); - long toID = TplConvert::_2long(lineParser.get("NACHPUNKTID").c_str()); + SUMOLong id = TplConvert::_2long(lineParser.get("ID").c_str()); + SUMOLong fromID = TplConvert::_2long(lineParser.get("VONPUNKTID").c_str()); + SUMOLong toID = TplConvert::_2long(lineParser.get("NACHPUNKTID").c_str()); PositionVector vec; vec.push_back(punkte[fromID]); vec.push_back(punkte[toID]); @@ -123,10 +123,10 @@ continue; } else if (what == "$ZWISCHENPUNKT") { lineParser.parseLine(line); - long id = TplConvert::_2long(lineParser.get("KANTEID").c_str()); - int index = TplConvert::_2int(lineParser.get("INDEX").c_str()); - SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str()); - SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str()); + SUMOLong id = TplConvert::_2long(lineParser.get("KANTEID").c_str()); + int index = TplConvert::_2int(lineParser.get("INDEX").c_str()); + SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str()); + SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str()); Position pos(x, y); if (!geoConvHelper.x2cartesian(pos)) { WRITE_WARNING("Unable to project coordinates for edge '" + toString(id) + "'."); @@ -135,11 +135,11 @@ continue; } else if (what == "$TEILFLAECHENELEMENT") { lineParser.parseLine(line); - long id = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str()); - //int index = TplConvert::_2int(lineParser.get("INDEX").c_str()); + SUMOLong id = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str()); + //int index = TplConvert::_2int(lineParser.get("INDEX").c_str()); //index = 0; /// hmmmm - assume it's sorted... - long kid = TplConvert::_2long(lineParser.get("KANTEID").c_str()); - int dir = TplConvert::_2int(lineParser.get("RICHTUNG").c_str()); + SUMOLong kid = TplConvert::_2long(lineParser.get("KANTEID").c_str()); + int dir = TplConvert::_2int(lineParser.get("RICHTUNG").c_str()); if (teilflaechen.find(id) == teilflaechen.end()) { teilflaechen[id] = PositionVector(); } @@ -155,9 +155,9 @@ continue; } else if (what == "$FLAECHENELEMENT") { lineParser.parseLine(line); - long id = TplConvert::_2long(lineParser.get("FLAECHEID").c_str()); - long tid = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str()); - int enklave = TplConvert::_2int(lineParser.get("ENKLAVE").c_str()); // !!! unused + SUMOLong id = TplConvert::_2long(lineParser.get("FLAECHEID").c_str()); + SUMOLong tid = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str()); + int enklave = TplConvert::_2int(lineParser.get("ENKLAVE").c_str()); // !!! unused enklave = 0; flaechenelemente[id] = tid; continue; @@ -223,12 +223,12 @@ // parse the poi // $POI:Nr;CATID;CODE;NAME;Kommentar;XKoord;YKoord; lineParser.parseLine(line); - long idL = TplConvert::_2long(lineParser.get("Nr").c_str()); + SUMOLong idL = TplConvert::_2long(lineParser.get("Nr").c_str()); std::string id = toString(idL); std::string catid = lineParser.get("CATID"); // process read values - SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKoord").c_str()); - SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKoord").c_str()); + SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKoord").c_str()); + SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKoord").c_str()); Position pos(x, y); if (!geoConvHelper.x2cartesian(pos)) { WRITE_WARNING("Unable to project coordinates for POI '" + id + "'."); @@ -251,9 +251,9 @@ color = c; } if (!discard) { - PointOfInterest* poi = new PointOfInterest(id, type, pos, color); + PointOfInterest* poi = new PointOfInterest(id, type, color, pos, (SUMOReal)layer); if (!toFill.insert(id, poi, layer)) { - WRITE_ERROR("POI '" + id + "' could not been added."); + WRITE_ERROR("POI '" + id + "' could not be added."); delete poi; } } @@ -282,9 +282,9 @@ color = c; } if (!discard) { - Polygon* poly = new Polygon(id, type, color, vec, false); + Polygon* poly = new Polygon(id, type, color, vec, false, (SUMOReal)layer); if (!toFill.insert(id, poly, 1)) { - WRITE_ERROR("Polygon '" + id + "' could not been added."); + WRITE_ERROR("Polygon '" + id + "' could not be added."); delete poly; } } @@ -307,11 +307,11 @@ if (parsingDistrictsDirectly) { //$BEZIRK:NR CODE NAME TYPNR XKOORD YKOORD FLAECHEID BEZART IVANTEIL_Q IVANTEIL_Z OEVANTEIL METHODEANBANTEILE ZWERT1 ZWERT2 ZWERT3 ISTINAUSWAHL OBEZNR NOM_COM COD_COM lineParser.parseLine(line); - long idL = TplConvert::_2long(lineParser.get("NR").c_str()); + SUMOLong idL = TplConvert::_2long(lineParser.get("NR").c_str()); std::string id = toString(idL); - long area = TplConvert::_2long(lineParser.get("FLAECHEID").c_str()); - SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str()); - SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str()); + SUMOLong area = TplConvert::_2long(lineParser.get("FLAECHEID").c_str()); + SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str()); + SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str()); // patch the values std::string type = "district"; bool discard = oc.getBool("discard"); @@ -331,9 +331,9 @@ } if (!discard) { if (teilflaechen[flaechenelemente[area]].size() > 0) { - Polygon* poly = new Polygon(id, type, color, teilflaechen[flaechenelemente[area]], false); + Polygon* poly = new Polygon(id, type, color, teilflaechen[flaechenelemente[area]], false, (SUMOReal)layer); if (!toFill.insert(id, poly, layer)) { - WRITE_ERROR("Polygon '" + id + "' could not been added."); + WRITE_ERROR("Polygon '" + id + "' could not be added."); delete poly; } } else { @@ -341,9 +341,9 @@ if (!geoConvHelper.x2cartesian(pos)) { WRITE_WARNING("Unable to project coordinates for POI '" + id + "'."); } - PointOfInterest* poi = new PointOfInterest(id, type, pos, color); + PointOfInterest* poi = new PointOfInterest(id, type, color, pos, (SUMOReal)layer); if (!toFill.insert(id, poi, layer)) { - WRITE_ERROR("POI '" + id + "' could not been added."); + WRITE_ERROR("POI '" + id + "' could not be added."); delete poi; } } diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderVisum.h sumo-0.16.0~dfsg/src/polyconvert/PCLoaderVisum.h --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderVisum.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderVisum.h 2012-09-25 22:01:39.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderVisum.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCLoaderVisum.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A reader of pois and polygons stored in VISUM-format /****************************************************************************/ @@ -64,7 +64,7 @@ * @exception ProcessError if something fails */ static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); protected: @@ -75,7 +75,7 @@ * @exception ProcessError if something fails */ static void load(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); }; diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderXML.cpp sumo-0.16.0~dfsg/src/polyconvert/PCLoaderXML.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderXML.cpp 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderXML.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderXML.cpp 11852 2012-02-08 09:24:17Z behrisch $ +/// @version $Id: PCLoaderXML.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A reader for polygons and pois stored in XML-format /****************************************************************************/ @@ -108,7 +108,7 @@ std::string id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); SUMOReal x = attrs.getSUMORealReporting(SUMO_ATTR_X, id.c_str(), ok); SUMOReal y = attrs.getSUMORealReporting(SUMO_ATTR_Y, id.c_str(), ok); - std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok, ""); + std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, id.c_str(), ok, myOptions.getString("type")); if (!ok) { return; } @@ -118,7 +118,7 @@ } // patch the values bool discard = myOptions.getBool("discard"); - int layer = myOptions.getInt("layer"); + SUMOReal layer = (SUMOReal)myOptions.getInt("layer"); RGBColor color; if (myTypeMap.has(type)) { const PCTypeMap::TypeDef& def = myTypeMap.get(type); @@ -126,30 +126,43 @@ type = def.id; color = RGBColor::parseColor(def.color); discard = def.discard; - layer = def.layer; + layer = (SUMOReal)def.layer; } else { id = myOptions.getString("prefix") + id; - type = myOptions.getString("type"); color = RGBColor::parseColor(myOptions.getString("color")); } + layer = attrs.getOptSUMORealReporting(SUMO_ATTR_LAYER, id.c_str(), ok, layer); + if (attrs.hasAttribute(SUMO_ATTR_COLOR)) { + color = attrs.getColorReporting(id.c_str(), ok); + } + SUMOReal angle = attrs.getOptSUMORealReporting(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); + std::string imgFile = attrs.getOptStringReporting(SUMO_ATTR_IMGFILE, id.c_str(), ok, Shape::DEFAULT_IMG_FILE); + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } + SUMOReal imgWidth = attrs.getOptSUMORealReporting(SUMO_ATTR_WIDTH, id.c_str(), ok, Shape::DEFAULT_IMG_WIDTH); + SUMOReal imgHeight = attrs.getOptSUMORealReporting(SUMO_ATTR_HEIGHT, id.c_str(), ok, Shape::DEFAULT_IMG_HEIGHT); + if (!ok) { + return; + } if (!discard) { bool ignorePrunning = false; if (OptionsCont::getOptions().isInStringVector("prune.keep-list", id)) { ignorePrunning = true; } - PointOfInterest* poi = new PointOfInterest(id, type, pos, color); - if (!myCont.insert(id, poi, layer, ignorePrunning)) { - WRITE_ERROR("POI '" + id + "' could not been added."); + PointOfInterest* poi = new PointOfInterest(id, type, color, pos, layer, angle, imgFile, imgWidth, imgHeight); + if (!myCont.insert(id, poi, (int)layer, ignorePrunning)) { + WRITE_ERROR("POI '" + id + "' could not be added."); delete poi; } } } if (element == SUMO_TAG_POLY) { bool discard = myOptions.getBool("discard"); - int layer = myOptions.getInt("layer"); + SUMOReal layer = (SUMOReal)myOptions.getInt("layer"); bool ok = true; std::string id = attrs.getOptStringReporting(SUMO_ATTR_ID, myCurrentID.c_str(), ok, ""); - std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, myCurrentID.c_str(), ok, ""); + std::string type = attrs.getOptStringReporting(SUMO_ATTR_TYPE, myCurrentID.c_str(), ok, myOptions.getString("type")); if (!ok) { return; } @@ -160,12 +173,24 @@ type = def.id; color = RGBColor::parseColor(def.color); discard = def.discard; - layer = def.layer; + layer = (SUMOReal)def.layer; } else { id = myOptions.getString("prefix") + id; - type = myOptions.getString("type"); color = RGBColor::parseColor(myOptions.getString("color")); } + layer = attrs.getOptSUMORealReporting(SUMO_ATTR_LAYER, id.c_str(), ok, layer); + if (attrs.hasAttribute(SUMO_ATTR_COLOR)) { + color = attrs.getColorReporting(id.c_str(), ok); + } + SUMOReal angle = attrs.getOptSUMORealReporting(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); + std::string imgFile = attrs.getOptStringReporting(SUMO_ATTR_IMGFILE, id.c_str(), ok, Shape::DEFAULT_IMG_FILE); + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } + bool fill = attrs.getOptBoolReporting(SUMO_ATTR_FILL, id.c_str(), ok, false); + if (!ok) { + return; + } if (!discard) { bool ignorePrunning = false; if (OptionsCont::getOptions().isInStringVector("prune.keep-list", id)) { @@ -176,36 +201,23 @@ myCurrentColor = color; myCurrentIgnorePrunning = ignorePrunning; myCurrentLayer = layer; - if (attrs.hasAttribute(SUMO_ATTR_SHAPE)) { - // @deprecated At some time, no shape definition using characters will be allowed - myCharacters(element, attrs.getStringReporting(SUMO_ATTR_SHAPE, myCurrentID.c_str(), ok)); + PositionVector pshape = attrs.getShapeReporting(SUMO_ATTR_SHAPE, myCurrentID.c_str(), ok, false); + if (!ok) { + return; + } + PositionVector shape; + for (PositionVector::ContType::const_iterator i = pshape.begin(); i != pshape.end(); ++i) { + Position pos((*i)); + if (!GeoConvHelper::getProcessing().x2cartesian(pos)) { + WRITE_WARNING("Unable to project coordinates for polygon '" + myCurrentID + "'."); + } + shape.push_back(pos); + } + Polygon* poly = new Polygon(myCurrentID, myCurrentType, myCurrentColor, shape, fill, layer, angle, imgFile); + if (!myCont.insert(myCurrentID, poly, (int)myCurrentLayer, myCurrentIgnorePrunning)) { + WRITE_ERROR("Polygon '" + myCurrentID + "' could not be added."); + delete poly; } - } - } -} - - -void -PCLoaderXML::myCharacters(int element, - const std::string& chars) { - if (element == SUMO_TAG_POLY) { - bool ok = true; - PositionVector pshape = GeomConvHelper::parseShapeReporting(chars, "poly", myCurrentID.c_str(), ok, false); - if (!ok) { - return; - } - PositionVector shape; - for (PositionVector::ContType::const_iterator i = pshape.begin(); i != pshape.end(); ++i) { - Position pos((*i)); - if (!GeoConvHelper::getProcessing().x2cartesian(pos)) { - WRITE_WARNING("Unable to project coordinates for polygon '" + myCurrentID + "'."); - } - shape.push_back(pos); - } - Polygon* poly = new Polygon(myCurrentID, myCurrentType, myCurrentColor, shape, false); - if (!myCont.insert(myCurrentID, poly, myCurrentLayer, myCurrentIgnorePrunning)) { - WRITE_ERROR("Polygon '" + myCurrentID + "' could not been added."); - delete poly; } } } diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCLoaderXML.h sumo-0.16.0~dfsg/src/polyconvert/PCLoaderXML.h --- sumo-0.15.0~dfsg/src/polyconvert/PCLoaderXML.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCLoaderXML.h 2012-11-06 00:02:37.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderXML.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCLoaderXML.h 12929 2012-11-05 06:33:56Z namdre $ /// // A reader for polygons and pois stored in XML-format /****************************************************************************/ @@ -69,7 +69,7 @@ * @exception ProcessError if something fails */ static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, - PCTypeMap& tm) ; + PCTypeMap& tm); protected: @@ -79,11 +79,11 @@ * @param[in] oc The options container to get further options from */ PCLoaderXML(PCPolyContainer& toFill, - PCTypeMap& tm, OptionsCont& oc) ; + PCTypeMap& tm, OptionsCont& oc); /// @brief Destructor - ~PCLoaderXML() ; + ~PCLoaderXML(); protected: @@ -97,19 +97,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; - - - /** @brief Called when characters occure - * - * @param[in] element ID of the last opened element - * @param[in] chars The read characters (complete) - * @exception ProcessError If something fails - * @see GenericSAXHandler::myCharacters - */ - void myCharacters(int element, - const std::string& chars) ; + virtual void myStartElement(int element, const SUMOSAXAttributes& attrs); //@} @@ -140,7 +128,7 @@ bool myCurrentIgnorePrunning; /// @brief The layer of the currently parsed polygon - int myCurrentLayer; + SUMOReal myCurrentLayer; /// @} diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCNetProjectionLoader.cpp sumo-0.16.0~dfsg/src/polyconvert/PCNetProjectionLoader.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCNetProjectionLoader.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCNetProjectionLoader.cpp 2012-11-13 00:02:16.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCNetProjectionLoader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCNetProjectionLoader.cpp 12968 2012-11-12 07:45:56Z behrisch $ /// // A reader for a SUMO network's projection description /****************************************************************************/ @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -76,15 +77,14 @@ // build handler and parser PCNetProjectionLoader handler(netOffset, origNetBoundary, convNetBoundary, projParameter); handler.setFileName(file); - XMLPScanToken token; - XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader* parser = XMLSubSys::getSAXReader(handler); + SUMOSAXReader* parser = XMLSubSys::getSAXReader(handler); PROGRESS_BEGIN_MESSAGE("Parsing network projection from '" + file + "'"); - if (!parser->parseFirst(file.c_str(), token)) { + if (!parser->parseFirst(file)) { delete parser; throw ProcessError("Can not read XML-file '" + handler.getFileName() + "'."); } // parse - while (parser->parseNext(token) && !handler.hasReadAll()); + while (parser->parseNext() && !handler.hasReadAll()); // clean up PROGRESS_DONE_MESSAGE(); if (!handler.hasReadAll()) { @@ -118,31 +118,17 @@ return; } bool ok = true; - PositionVector tmp = GeomConvHelper::parseShapeReporting( - attrs.getOptStringReporting(SUMO_ATTR_NET_OFFSET, 0, ok, ""), - attrs.getObjectType(), 0, ok, false); + PositionVector tmp = attrs.getShapeReporting(SUMO_ATTR_NET_OFFSET, 0, ok, false); if (ok) { myNetOffset = tmp[0]; } - myOrigNetBoundary = GeomConvHelper::parseBoundaryReporting( - attrs.getOptStringReporting(SUMO_ATTR_ORIG_BOUNDARY, 0, ok, ""), - attrs.getObjectType(), 0, ok); - myConvNetBoundary = GeomConvHelper::parseBoundaryReporting( - attrs.getOptStringReporting(SUMO_ATTR_CONV_BOUNDARY, 0, ok, ""), - attrs.getObjectType(), 0, ok); + myOrigNetBoundary = attrs.getBoundaryReporting(SUMO_ATTR_ORIG_BOUNDARY, 0, ok); + myConvNetBoundary = attrs.getBoundaryReporting(SUMO_ATTR_CONV_BOUNDARY, 0, ok); myProjParameter = attrs.getOptStringReporting(SUMO_ATTR_ORIG_PROJ, 0, ok, ""); myFoundOffset = myFoundOrigNetBoundary = myFoundConvNetBoundary = myFoundProj = ok; } -void -PCNetProjectionLoader::myCharacters(int element, - const std::string& chars) { - UNUSED_PARAMETER(element); - UNUSED_PARAMETER(chars); -} - - bool PCNetProjectionLoader::hasReadAll() const { return myFoundOffset && myFoundOrigNetBoundary && myFoundConvNetBoundary && myFoundProj; diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCNetProjectionLoader.h sumo-0.16.0~dfsg/src/polyconvert/PCNetProjectionLoader.h --- sumo-0.15.0~dfsg/src/polyconvert/PCNetProjectionLoader.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCNetProjectionLoader.h 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCNetProjectionLoader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCNetProjectionLoader.h 12615 2012-08-29 15:17:25Z dkrajzew $ /// // A reader for a SUMO network's projection description /****************************************************************************/ @@ -67,7 +67,7 @@ * @exception ProcessError if something fails */ static void loadIfSet(OptionsCont& oc, Position& netOffset, Boundary& origNetBoundary, - Boundary& convNetBoundary, std::string& projParameter) ; + Boundary& convNetBoundary, std::string& projParameter); protected: @@ -78,17 +78,17 @@ * @param[out] projParameter The projection parameter to fill from values read from the network */ PCNetProjectionLoader(Position& netOffset, - Boundary& origNetBoundary, Boundary& convNetBoundary, std::string& projParameter) ; + Boundary& origNetBoundary, Boundary& convNetBoundary, std::string& projParameter); /// @brief Destructor - ~PCNetProjectionLoader() ; + ~PCNetProjectionLoader(); /** @brief Returns whether all needed values were read * @return Whether all needed values were read */ - bool hasReadAll() const ; + bool hasReadAll() const; protected: @@ -103,18 +103,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; - - - /** @brief Called when characters occure - * - * @param[in] element ID of the last opened element - * @param[in] chars The read characters (complete) - * @exception ProcessError If something fails - * @see GenericSAXHandler::myCharacters - */ - void myCharacters(int element, - const std::string& chars) ; + const SUMOSAXAttributes& attrs); //@} diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCPolyContainer.cpp sumo-0.16.0~dfsg/src/polyconvert/PCPolyContainer.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCPolyContainer.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCPolyContainer.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 05 Dec 2005 -/// @version $Id: PCPolyContainer.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCPolyContainer.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A storage for loaded polygons and pois /****************************************************************************/ @@ -31,6 +31,7 @@ #endif #include +#include #include #include #include @@ -51,7 +52,7 @@ // =========================================================================== PCPolyContainer::PCPolyContainer(bool prune, const Boundary& prunningBoundary, - const std::vector &removeByNames) + const std::vector& removeByNames) : myPrunningBoundary(prunningBoundary), myDoPrunne(prune), myRemoveByNames(removeByNames) {} @@ -152,22 +153,44 @@ out.writeXMLHeader("shapes", SUMOSAXAttributes::ENCODING); // write polygons for (PolyCont::iterator i = myPolyCont.begin(); i != myPolyCont.end(); ++i) { - out.openTag("poly") << " id=\"" << StringUtils::escapeXML((*i).second->getID()) - << "\" type=\"" << (*i).second->getType() - << "\" color=\"" << (*i).second->getColor() - << "\" fill=\"" << (*i).second->fill() - << "\" layer=\"" << myPolyLayerMap[(*i).second] - << "\" shape=\"" << (*i).second->getShape() << "\""; + Polygon* p = i->second; + out.openTag(SUMO_TAG_POLY); + out.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(p->getID())); + out.writeAttr(SUMO_ATTR_TYPE, StringUtils::escapeXML(p->getType())); + out.writeAttr(SUMO_ATTR_COLOR, p->getColor()); + out.writeAttr(SUMO_ATTR_FILL, p->getFill()); + out.writeAttr(SUMO_ATTR_LAYER, p->getLayer()); + out.writeAttr(SUMO_ATTR_SHAPE, p->getShape()); + if (p->getAngle() != Shape::DEFAULT_ANGLE) { + out.writeAttr(SUMO_ATTR_ANGLE, p->getAngle()); + } + if (p->getImgFile() != Shape::DEFAULT_IMG_FILE) { + out.writeAttr(SUMO_ATTR_IMGFILE, p->getImgFile()); + } out.closeTag(true); } // write pois for (POICont::iterator i = myPOICont.begin(); i != myPOICont.end(); ++i) { - out.openTag("poi") << " id=\"" << StringUtils::escapeXML((*i).second->getID()) - << "\" type=\"" << StringUtils::escapeXML((*i).second->getType()) - << "\" color=\"" << *static_cast((*i).second) - << "\" layer=\"" << myPOILayerMap[(*i).second] - << "\" x=\"" << (*i).second->x() - << "\" y=\"" << (*i).second->y() << "\""; + PointOfInterest* p = i->second; + out.openTag(SUMO_TAG_POI); + out.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(p->getID())); + out.writeAttr(SUMO_ATTR_TYPE, StringUtils::escapeXML(p->getType())); + out.writeAttr(SUMO_ATTR_COLOR, p->getColor()); + out.writeAttr(SUMO_ATTR_LAYER, p->getLayer()); + out.writeAttr(SUMO_ATTR_X, p->x()); + out.writeAttr(SUMO_ATTR_Y, p->y()); + if (p->getAngle() != Shape::DEFAULT_ANGLE) { + out.writeAttr(SUMO_ATTR_ANGLE, p->getAngle()); + } + if (p->getImgFile() != Shape::DEFAULT_IMG_FILE) { + out.writeAttr(SUMO_ATTR_IMGFILE, p->getImgFile()); + } + if (p->getWidth() != Shape::DEFAULT_IMG_WIDTH) { + out.writeAttr(SUMO_ATTR_WIDTH, p->getWidth()); + } + if (p->getHeight() != Shape::DEFAULT_IMG_HEIGHT) { + out.writeAttr(SUMO_ATTR_HEIGHT, p->getHeight()); + } out.closeTag(true); } out.close(); diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCPolyContainer.h sumo-0.16.0~dfsg/src/polyconvert/PCPolyContainer.h --- sumo-0.15.0~dfsg/src/polyconvert/PCPolyContainer.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCPolyContainer.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 05 Dec 2005 -/// @version $Id: PCPolyContainer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCPolyContainer.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A storage for loaded polygons and pois /****************************************************************************/ @@ -38,6 +38,7 @@ #include #include #include +using namespace SUMO; // =========================================================================== @@ -55,11 +56,11 @@ * @param[in] removeByNames Names of objects that shall not be added */ PCPolyContainer(bool prune, const Boundary& prunningBoundary, - const std::vector &removeByNames) ; + const std::vector& removeByNames); /// @brief Destructor - ~PCPolyContainer() ; + ~PCPolyContainer(); /** @brief Adds a polygon to the storage @@ -78,7 +79,7 @@ * @return Whether the polygon could been added (no one with the same id was added before) */ bool insert(const std::string& id, Polygon* poly, int layer, - bool ignorePrunning = false) ; + bool ignorePrunning = false); /** @brief Adds a poi to the storage @@ -97,7 +98,7 @@ * @return Whether the poi could been added (no one with the same id was added before) */ bool insert(const std::string& id, PointOfInterest* poi, int layer, - bool ignorePrunning = false) ; + bool ignorePrunning = false); /** @brief Returns the number of stored polygons @@ -120,23 +121,23 @@ * * All items are deleted */ - void clear() ; + void clear(); /** @brief Reports how many polygons and pois were added */ - void report() ; + void report(); /** @brief Returns the information whether a polygon with the given key is in the container * @param[in] id The id of the polygon to get the information about * @return Whether the named polygon was added before */ - bool containsPolygon(const std::string& kidey) ; + bool containsPolygon(const std::string& kidey); /** @brief Saves the stored polygons into the given file * @param[in] file The name of the file to write stored objects' definitions into - * @exception IOError If the file could not been opened + * @exception IOError If the file could not be opened */ void save(const std::string& file); @@ -149,7 +150,7 @@ * @param[in] key The key to get a running number for * @return Unique id (running number of calls that used this key) */ - int getEnumIDFor(const std::string& key) ; + int getEnumIDFor(const std::string& key); public: diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCTypeDefHandler.cpp sumo-0.16.0~dfsg/src/polyconvert/PCTypeDefHandler.cpp --- sumo-0.15.0~dfsg/src/polyconvert/PCTypeDefHandler.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCTypeDefHandler.cpp 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: PCTypeDefHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCTypeDefHandler.cpp 12599 2012-08-27 11:15:34Z dkrajzew $ /// // A handler for loading polygon type maps /****************************************************************************/ @@ -60,7 +60,7 @@ void PCTypeDefHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { - if (element == SUMO_TAG_POLYTYPE || element == SUMO_TAG_POLYTYPE__DEPRECATED) { + if (element == SUMO_TAG_POLYTYPE) { bool ok = true; // get the id, report an error if not given or empty... std::string id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCTypeDefHandler.h sumo-0.16.0~dfsg/src/polyconvert/PCTypeDefHandler.h --- sumo-0.15.0~dfsg/src/polyconvert/PCTypeDefHandler.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCTypeDefHandler.h 2012-09-25 22:01:39.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: PCTypeDefHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCTypeDefHandler.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A handler for loading polygon type maps /****************************************************************************/ @@ -57,11 +57,11 @@ * @param[in] oc The options used while loading the type map * @param[out] con The container to fill */ - PCTypeDefHandler(OptionsCont& oc, PCTypeMap& con) ; + PCTypeDefHandler(OptionsCont& oc, PCTypeMap& con); /// @brief Destructor - virtual ~PCTypeDefHandler() ; + virtual ~PCTypeDefHandler(); protected: @@ -77,7 +77,7 @@ * @todo Completely unsecure currently (invalid values may force abortion with no error message) */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} diff -Nru sumo-0.15.0~dfsg/src/polyconvert/PCTypeMap.h sumo-0.16.0~dfsg/src/polyconvert/PCTypeMap.h --- sumo-0.15.0~dfsg/src/polyconvert/PCTypeMap.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/PCTypeMap.h 2012-09-25 22:01:39.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 05 Dec 2005 -/// @version $Id: PCTypeMap.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PCTypeMap.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A storage for type mappings /****************************************************************************/ @@ -48,11 +48,11 @@ class PCTypeMap { public: /// @brief Constructor - PCTypeMap() ; + PCTypeMap(); /// @brief Destructor - ~PCTypeMap() ; + ~PCTypeMap(); /** @@ -88,7 +88,7 @@ * @return Whether the type could been added (was not known before) */ bool add(const std::string& id, const std::string& newid, const std::string& color, - const std::string& prefix, int layer, bool discard, bool allowFill) ; + const std::string& prefix, int layer, bool discard, bool allowFill); /** @brief Returns a type definition @@ -98,14 +98,14 @@ * @param[in] id The id of the type to get the definitions of * @return Definition of the named type */ - const TypeDef& get(const std::string& id) ; + const TypeDef& get(const std::string& id); /** @brief Returns the information whether the named type is known * @param[in] id The id of the type * @return Whether a definition of the named type was added before */ - bool has(const std::string& id) ; + bool has(const std::string& id); protected: diff -Nru sumo-0.15.0~dfsg/src/polyconvert/polyconvert_main.cpp sumo-0.16.0~dfsg/src/polyconvert/polyconvert_main.cpp --- sumo-0.15.0~dfsg/src/polyconvert/polyconvert_main.cpp 2012-02-18 00:03:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/polyconvert/polyconvert_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Mon, 05 Dec 2005 -/// @version $Id: polyconvert_main.cpp 11927 2012-02-17 10:03:39Z namdre $ +/// @version $Id: polyconvert_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for POLYCONVERT /****************************************************************************/ @@ -132,6 +132,9 @@ oc.addSynonyme("shapefile.id-column", "shape-files.id-name", true); oc.addDescription("shapefile.id-column", "Input", "Defines in which column the id can be found"); + oc.doRegister("shapefile.use-running-id", new Option_Bool()); + oc.addDescription("shapefile.use-running-id", "Input", "A running number will be used as id."); + // typemap reading oc.doRegister("type-file", new Option_FileName()); oc.addSynonyme("type-file", "typemap", true); @@ -201,14 +204,14 @@ int ret = 0; try { // initialise subsystems - XMLSubSys::init(false); + XMLSubSys::init(); fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); // build the projection Boundary origNetBoundary, pruningBoundary; @@ -287,19 +290,24 @@ } else { throw ProcessError(); } - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } - OutputDevice::closeAll(); SystemFrame::close(); // report about ending if (ret == 0) { diff -Nru sumo-0.15.0~dfsg/src/router/Makefile.am sumo-0.16.0~dfsg/src/router/Makefile.am --- sumo-0.15.0~dfsg/src/router/Makefile.am 2012-02-21 00:03:01.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/Makefile.am 2012-09-25 22:01:29.000000000 +0000 @@ -12,11 +12,7 @@ RORDLoader_SUMOBase.cpp RORDLoader_SUMOBase.h \ RORDLoader_TripDefs.cpp RORDLoader_TripDefs.h \ RORoute.cpp RORoute.h RORouteDef.cpp RORouteDef.h \ -RORouteDef_Alternatives.cpp RORouteDef_Alternatives.h \ -RORouteDef_Complete.cpp RORouteDef_Complete.h \ -RORouteDef_OrigDest.cpp RORouteDef_OrigDest.h \ +RORouteHandler.cpp RORouteHandler.h \ ROTypedXMLRoutesLoader.cpp ROTypedXMLRoutesLoader.h \ ROVehicle.cpp ROVehicle.h \ ROVehicleCont.cpp ROVehicleCont.h - - diff -Nru sumo-0.15.0~dfsg/src/router/Makefile.in sumo-0.16.0~dfsg/src/router/Makefile.in --- sumo-0.15.0~dfsg/src/router/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -55,10 +55,8 @@ RORDGenerator_ODAmounts.$(OBJEXT) \ RORDLoader_SUMOBase.$(OBJEXT) RORDLoader_TripDefs.$(OBJEXT) \ RORoute.$(OBJEXT) RORouteDef.$(OBJEXT) \ - RORouteDef_Alternatives.$(OBJEXT) \ - RORouteDef_Complete.$(OBJEXT) RORouteDef_OrigDest.$(OBJEXT) \ - ROTypedXMLRoutesLoader.$(OBJEXT) ROVehicle.$(OBJEXT) \ - ROVehicleCont.$(OBJEXT) + RORouteHandler.$(OBJEXT) ROTypedXMLRoutesLoader.$(OBJEXT) \ + ROVehicle.$(OBJEXT) ROVehicleCont.$(OBJEXT) librouter_a_OBJECTS = $(am_librouter_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -109,6 +107,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -139,6 +138,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -173,6 +173,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -206,7 +207,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -239,9 +239,7 @@ RORDLoader_SUMOBase.cpp RORDLoader_SUMOBase.h \ RORDLoader_TripDefs.cpp RORDLoader_TripDefs.h \ RORoute.cpp RORoute.h RORouteDef.cpp RORouteDef.h \ -RORouteDef_Alternatives.cpp RORouteDef_Alternatives.h \ -RORouteDef_Complete.cpp RORouteDef_Complete.h \ -RORouteDef_OrigDest.cpp RORouteDef_OrigDest.h \ +RORouteHandler.cpp RORouteHandler.h \ ROTypedXMLRoutesLoader.cpp ROTypedXMLRoutesLoader.h \ ROVehicle.cpp ROVehicle.h \ ROVehicleCont.cpp ROVehicleCont.h @@ -307,9 +305,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORDLoader_TripDefs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORoute.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORouteDef.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORouteDef_Alternatives.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORouteDef_Complete.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORouteDef_OrigDest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RORouteHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROTypedXMLRoutesLoader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROVehicle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROVehicleCont.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/router/ROCostCalculator.cpp sumo-0.16.0~dfsg/src/router/ROCostCalculator.cpp --- sumo-0.15.0~dfsg/src/router/ROCostCalculator.cpp 2012-02-29 00:03:02.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROCostCalculator.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROCostCalculator.cpp 11972 2012-02-28 14:25:17Z namdre $ +/// @version $Id: ROCostCalculator.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Calculators for route costs and probabilities /****************************************************************************/ @@ -53,7 +53,12 @@ // =========================================================================== // method definitions // =========================================================================== -ROCostCalculator::ROCostCalculator() {} +ROCostCalculator::ROCostCalculator() { + OptionsCont& oc = OptionsCont::getOptions(); + myMaxRouteNumber = oc.getInt("max-alternatives"); + myKeepRoutes = oc.getBool("keep-all-routes"); + mySkipRouteCalculation = oc.getBool("skip-new-routes"); +} ROCostCalculator::~ROCostCalculator() {} @@ -81,7 +86,7 @@ ROGawronCalculator::ROGawronCalculator(const SUMOReal beta, const SUMOReal a) -: myBeta(beta), myA(a) {} + : myBeta(beta), myA(a) {} ROGawronCalculator::~ROGawronCalculator() {} @@ -90,15 +95,15 @@ void ROGawronCalculator::setCosts(RORoute* route, const SUMOReal costs, const bool isActive) const { if (isActive) { - route->setCosts(costs); - } else { + route->setCosts(costs); + } else { route->setCosts(myBeta * costs + ((SUMOReal) 1.0 - myBeta) * route->getCosts()); } } void -ROGawronCalculator::calculateProbabilities(const ROVehicle* const veh, std::vector alternatives) { +ROGawronCalculator::calculateProbabilities(const ROVehicle* const /* veh */, std::vector alternatives) { for (std::vector::iterator i = alternatives.begin(); i != alternatives.end() - 1; i++) { RORoute* pR = *i; for (std::vector::iterator j = i + 1; j != alternatives.end(); j++) { @@ -148,14 +153,14 @@ ROLogitCalculator::ROLogitCalculator(const SUMOReal beta, const SUMOReal gamma, const SUMOReal theta) - : myBeta(beta), myGamma(gamma), myTheta(theta) {} + : myBeta(beta), myGamma(gamma), myTheta(theta) {} ROLogitCalculator::~ROLogitCalculator() {} void -ROLogitCalculator::setCosts(RORoute* route, const SUMOReal costs, const bool isActive) const { +ROLogitCalculator::setCosts(RORoute* route, const SUMOReal costs, const bool /* isActive */) const { route->setCosts(costs); } @@ -169,7 +174,7 @@ for (std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { const RORoute* pR = *i; SUMOReal lengthR = 0; - const std::vector &edgesR = pR->getEdgeVector(); + const std::vector& edgesR = pR->getEdgeVector(); for (std::vector::const_iterator edge = edgesR.begin(); edge != edgesR.end(); ++edge) { //@todo we should use costs here lengthR += (*edge)->getTravelTime(veh, STEPS2TIME(veh->getDepartureTime())); @@ -179,7 +184,7 @@ const RORoute* pS = *j; SUMOReal overlapLength = 0.; SUMOReal lengthS = 0; - const std::vector &edgesS = pS->getEdgeVector(); + const std::vector& edgesS = pS->getEdgeVector(); for (std::vector::const_iterator edge = edgesS.begin(); edge != edgesS.end(); ++edge) { lengthS += (*edge)->getTravelTime(veh, STEPS2TIME(veh->getDepartureTime())); if (std::find(edgesR.begin(), edgesR.end(), *edge) != edgesR.end()) { @@ -207,7 +212,7 @@ ROLogitCalculator::getBetaForCLogit(const std::vector alternatives) const { SUMOReal min = std::numeric_limits::max(); for (std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { - const SUMOReal cost = (*i)->getCosts()/3600.; + const SUMOReal cost = (*i)->getCosts() / 3600.; if (cost < min) { min = cost; } @@ -223,7 +228,7 @@ SUMOReal diff = 0.; SUMOReal min = std::numeric_limits::max(); for (std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { - const SUMOReal cost = (*i)->getCosts()/3600.; + const SUMOReal cost = (*i)->getCosts() / 3600.; sum += cost; if (cost < min) { min = cost; @@ -231,12 +236,12 @@ } const SUMOReal meanCost = sum / SUMOReal(alternatives.size()); for (std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { - diff += pow((*i)->getCosts()/3600. - meanCost, 2); + diff += pow((*i)->getCosts() / 3600. - meanCost, 2); } const SUMOReal cvCost = sqrt(diff / SUMOReal(alternatives.size())) / meanCost; // @todo re-evaluate function // if (cvCost > 0.04) { // Magic numbers from Lohse book - return PI / (sqrt(6.) * cvCost * (min + 1.1))/3600.; + return PI / (sqrt(6.) * cvCost * (min + 1.1)) / 3600.; // } // return 1./3600.; } diff -Nru sumo-0.15.0~dfsg/src/router/ROCostCalculator.h sumo-0.16.0~dfsg/src/router/ROCostCalculator.h --- sumo-0.15.0~dfsg/src/router/ROCostCalculator.h 2012-02-29 00:03:02.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROCostCalculator.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROCostCalculator.h 11972 2012-02-28 14:25:17Z namdre $ +/// @version $Id: ROCostCalculator.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Calculators for route costs and probabilities /****************************************************************************/ @@ -55,11 +55,23 @@ static void cleanup(); - virtual void setCosts(RORoute* route, const SUMOReal costs, const bool isActive=false) const = 0; + virtual void setCosts(RORoute* route, const SUMOReal costs, const bool isActive = false) const = 0; /** @brief calculate the probabilities in the logit model */ virtual void calculateProbabilities(const ROVehicle* const veh, std::vector alternatives) = 0; + unsigned int getMaxRouteNumber() const { + return myMaxRouteNumber; + } + + bool keepRoutes() const { + return myKeepRoutes; + } + + bool skipRouteCalculation() const { + return mySkipRouteCalculation; + } + protected: /// @brief Constructor ROCostCalculator(); @@ -70,6 +82,15 @@ private: static ROCostCalculator* myInstance; + /// @brief The maximum route alternatives number + unsigned int myMaxRouteNumber; + + /// @brief Information whether all routes should be saved + bool myKeepRoutes; + + /// @brief Information whether new routes should be calculated + bool mySkipRouteCalculation; + }; @@ -85,7 +106,7 @@ /// Destructor virtual ~ROGawronCalculator(); - void setCosts(RORoute* route, const SUMOReal costs, const bool isActive=false) const; + void setCosts(RORoute* route, const SUMOReal costs, const bool isActive = false) const; /** @brief calculate the probabilities */ void calculateProbabilities(const ROVehicle* const veh, std::vector alternatives); @@ -106,6 +127,10 @@ /// @brief gawron a - value const SUMOReal myA; +private: + /** @brief invalidated assignment operator */ + ROGawronCalculator& operator=(const ROGawronCalculator& s); + }; @@ -122,7 +147,7 @@ /// Destructor virtual ~ROLogitCalculator(); - void setCosts(RORoute* route, const SUMOReal costs, const bool isActive=false) const; + void setCosts(RORoute* route, const SUMOReal costs, const bool isActive = false) const; /** @brief calculate the probabilities in the logit model */ void calculateProbabilities(const ROVehicle* const veh, std::vector alternatives); @@ -147,6 +172,10 @@ /// @brief The route commonality factors for c-logit std::map myCommonalities; +private: + /** @brief invalidated assignment operator */ + ROLogitCalculator& operator=(const ROLogitCalculator& s); + }; diff -Nru sumo-0.15.0~dfsg/src/router/ROEdge.cpp sumo-0.16.0~dfsg/src/router/ROEdge.cpp --- sumo-0.15.0~dfsg/src/router/ROEdge.cpp 2012-03-13 00:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROEdge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROEdge.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: ROEdge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A basic edge for routing applications /****************************************************************************/ @@ -65,8 +65,8 @@ ROEdge::ROEdge(const std::string& id, RONode* from, RONode* to, unsigned int index) : myID(id), mySpeed(-1), myIndex(index), myLength(-1), - myUsingTTTimeLine(false), - myUsingETimeLine(false), + myUsingTTTimeLine(false), + myUsingETimeLine(false), myFromNode(from), myToNode(to) { while (myEdges.size() <= index) { myEdges.push_back(0); @@ -100,7 +100,7 @@ ROEdge::addFollower(ROEdge* s, std::string) { if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s) == myFollowingEdges.end()) { myFollowingEdges.push_back(s); -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff s->myApproachingEdges.push_back(this); #endif } @@ -131,14 +131,31 @@ } -SUMOReal +SUMOReal ROEdge::getDistanceTo(const ROEdge* other) const { - return getToNode()->getPosition().distanceTo2D(other->getFromNode()->getPosition()); + if (getToNode() != 0 && other->getFromNode() != 0) { + return getToNode()->getPosition().distanceTo2D(other->getFromNode()->getPosition()); + } else { + return 0; // optimism is just right for astar + } + } SUMOReal ROEdge::getTravelTime(const ROVehicle* const veh, SUMOReal time) const { + return getTravelTime(veh->getType()->maxSpeed, time); +} + + +SUMOReal +ROEdge::getTravelTime(const SUMOReal maxSpeed, SUMOReal time) const { + return MAX2(myLength / maxSpeed, getTravelTime(time)); +} + + +SUMOReal +ROEdge::getTravelTime(SUMOReal time) const { if (myUsingTTTimeLine) { if (!myHaveTTWarned && !myTravelTimes.describesTime(time)) { WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / edge's speed."); @@ -153,8 +170,7 @@ } return myTravelTimes.getValue(time); } - // ok, no absolute value was found, use the normal value (without) as default - return getMinimumTravelTime(veh); + return myLength / mySpeed; } @@ -281,7 +297,7 @@ } -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff unsigned int ROEdge::getNumApproaching() const { if (getType() == ET_SOURCE) { diff -Nru sumo-0.15.0~dfsg/src/router/ROEdge.h sumo-0.16.0~dfsg/src/router/ROEdge.h --- sumo-0.15.0~dfsg/src/router/ROEdge.h 2012-03-10 00:03:06.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROEdge.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROEdge.h 12042 2012-03-09 07:24:06Z namdre $ +/// @version $Id: ROEdge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A basic edge for routing applications /****************************************************************************/ @@ -92,7 +92,7 @@ /// Destructor - virtual ~ROEdge() ; + virtual ~ROEdge(); /// @name Set-up methods @@ -106,7 +106,7 @@ * @param[in] lane The lane to add * @todo What about vehicle-type aware connections? */ - virtual void addLane(ROLane* lane) ; + virtual void addLane(ROLane* lane); /** @brief Adds information about a connected edge @@ -114,15 +114,15 @@ * The edge is added to "myFollowingEdges". * @param[in] s The edge to add * @todo What about vehicle-type aware connections? - * @note: if HAVE_MESOSIM is defined, the backward connections is added as well + * @note: if HAVE_INTERNAL is defined, the backward connections is added as well */ - virtual void addFollower(ROEdge* s, std::string dir=""); + virtual void addFollower(ROEdge* s, std::string dir = ""); /** @brief Sets the type of te edge * @param[in] type The new type for the edge */ - void setType(EdgeType type) ; + void setType(EdgeType type); /** @brief Builds the internal representation of the travel time/effort @@ -134,7 +134,7 @@ * * @param[in] measure The name of the measure to use. */ - void buildTimeLines(const std::string& measure) ; + void buildTimeLines(const std::string& measure); //@} @@ -234,7 +234,7 @@ * @param[in] vehicle The vehicle for which the information has to be returned * @return Whether the vehicle may continue its route on any of the following edges */ - bool allFollowersProhibit(const ROVehicle* const vehicle) const ; + bool allFollowersProhibit(const ROVehicle* const vehicle) const; //@} @@ -248,7 +248,7 @@ * @param[in] timeBegin The begin time of the interval the given value is valid for [s] * @param[in] timeEnd The end time of the interval the given value is valid for [s] */ - void addEffort(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd) ; + void addEffort(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd); /** @brief Adds a travel time value @@ -257,7 +257,7 @@ * @param[in] timeBegin The begin time of the interval the given value is valid for [s] * @param[in] timeEnd The end time of the interval the given value is valid for [s] */ - void addTravelTime(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd) ; + void addTravelTime(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd); /** @brief Returns the number of edges this edge is connected to @@ -267,7 +267,7 @@ * * @return The number of edges following this edge */ - unsigned int getNoFollowing() const ; + unsigned int getNoFollowing() const; /** @brief Returns the edge at the given position from the list of reachable edges @@ -279,7 +279,7 @@ } -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff /** @brief Returns the number of edges this edge is connected to * * If this edge's type is set to "source", 0 is returned, otherwise @@ -287,7 +287,7 @@ * * @return The number of edges following this edge */ - unsigned int getNumApproaching() const ; + unsigned int getNumApproaching() const; /** @brief Returns the edge at the given position from the list of reachable edges @@ -307,17 +307,25 @@ * @return The effort needed by the given vehicle to pass the edge at the given time * @todo Recheck whether the vehicle's maximum speed is considered */ - SUMOReal getEffort(const ROVehicle* const veh, SUMOReal time) const ; + SUMOReal getEffort(const ROVehicle* const veh, SUMOReal time) const; /** @brief Returns the travel time for this edge * * @param[in] veh The vehicle for which the effort on this edge shall be retrieved * @param[in] time The time for which the effort shall be returned [s] - * @return The effort needed by the given vehicle to pass the edge at the given time - * @todo Recheck whether the vehicle's maximum speed is considered + * @return The traveltime needed by the given vehicle to pass the edge at the given time */ - SUMOReal getTravelTime(const ROVehicle* const veh, SUMOReal time) const ; + SUMOReal getTravelTime(const ROVehicle* const veh, SUMOReal time) const; + + + /** @brief Returns the travel time for this edge + * + * @param[in] maxSpeed The maximum speed to assume if no travel times are stored + * @param[in] time The time in seconds(!) for which the traveltime shall be returned + * @return The traveltime needed to pass the edge at the given time + */ + SUMOReal getTravelTime(const SUMOReal maxSpeed, SUMOReal time) const; /** @brief Returns the travel time for this edge without using any stored timeLine @@ -325,16 +333,16 @@ * @param[in] veh The vehicle for which the effort on this edge shall be retrieved * @param[in] time The time for which the effort shall be returned [s] */ - SUMOReal getMinimumTravelTime(const ROVehicle* const veh) const ; + SUMOReal getMinimumTravelTime(const ROVehicle* const veh) const; - SUMOReal getCOEffort(const ROVehicle* const veh, SUMOReal time) const ; - SUMOReal getCO2Effort(const ROVehicle* const veh, SUMOReal time) const ; - SUMOReal getPMxEffort(const ROVehicle* const veh, SUMOReal time) const ; - SUMOReal getHCEffort(const ROVehicle* const veh, SUMOReal time) const ; - SUMOReal getNOxEffort(const ROVehicle* const veh, SUMOReal time) const ; - SUMOReal getFuelEffort(const ROVehicle* const veh, SUMOReal time) const ; - SUMOReal getNoiseEffort(const ROVehicle* const veh, SUMOReal time) const ; + SUMOReal getCOEffort(const ROVehicle* const veh, SUMOReal time) const; + SUMOReal getCO2Effort(const ROVehicle* const veh, SUMOReal time) const; + SUMOReal getPMxEffort(const ROVehicle* const veh, SUMOReal time) const; + SUMOReal getHCEffort(const ROVehicle* const veh, SUMOReal time) const; + SUMOReal getNOxEffort(const ROVehicle* const veh, SUMOReal time) const; + SUMOReal getFuelEffort(const ROVehicle* const veh, SUMOReal time) const; + SUMOReal getNoiseEffort(const ROVehicle* const veh, SUMOReal time) const; //@} @@ -343,7 +351,7 @@ /** @brief Returns the ROEdge at the index */ - static ROEdge* dictionary(size_t index) ; + static ROEdge* dictionary(size_t index); /// @brief Returns the number of edges static size_t dictSize() { @@ -351,9 +359,9 @@ }; static void setTimeLineOptions( - bool useBoundariesOnOverrideTT, - bool useBoundariesOnOverrideE, - bool interpolate) { + bool useBoundariesOnOverrideTT, + bool useBoundariesOnOverrideE, + bool interpolate) { myUseBoundariesOnOverrideTT = useBoundariesOnOverrideTT; myUseBoundariesOnOverrideE = useBoundariesOnOverrideE; myInterpolate = interpolate; @@ -367,7 +375,7 @@ * @param[in] time The tim for which the effort shall be returned * @return Whether the effort is given */ - bool getStoredEffort(SUMOReal time, SUMOReal& ret) const ; + bool getStoredEffort(SUMOReal time, SUMOReal& ret) const; @@ -410,7 +418,7 @@ /// @brief List of edges that may be approached from this edge std::vector myFollowingEdges; -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff /// @brief List of edges that approached this edge std::vector myApproachingEdges; #endif @@ -429,6 +437,16 @@ static std::vector myEdges; + +private: + /** @brief Returns the minimum travel time for this edge + * If there is a timeline-value for the given time it is returned, otherwise + * the maximum speed of the edge is assumed + * @param[in] veh The vehicle for which the traveltime on this edge shall be retrieved + * @return The minimum traveltime needed to pass the edge at the given time + */ + SUMOReal getTravelTime(SUMOReal time) const; + private: /// @brief Invalidated copy constructor ROEdge(const ROEdge& src); diff -Nru sumo-0.15.0~dfsg/src/router/ROFrame.cpp sumo-0.16.0~dfsg/src/router/ROFrame.cpp --- sumo-0.15.0~dfsg/src/router/ROFrame.cpp 2012-03-10 00:03:07.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROFrame.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROFrame.cpp 12043 2012-03-09 07:27:17Z namdre $ +/// @version $Id: ROFrame.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Sets and checks options for routing /****************************************************************************/ @@ -91,7 +91,7 @@ oc.addSynonyme("weight-attribute", "measure", true); oc.addDescription("weight-attribute", "Input", "Name of the xml attribute which gives the edge weight"); } - + // register the time settings oc.doRegister("begin", 'b', new Option_String("0", "TIME")); oc.addDescription("begin", "Time", "Defines the begin time; Previous trips will be discarded"); @@ -129,17 +129,17 @@ if (forDuarouter) { oc.doRegister("routing-algorithm", new Option_String("dijkstra")); - oc.addDescription("routing-algorithm", "Processing", -#ifndef HAVE_MESOSIM // catchall for internal stuff - "Select among routing algorithms ['dijkstra', 'astar']" + oc.addDescription("routing-algorithm", "Processing", +#ifndef HAVE_INTERNAL // catchall for internal stuff + "Select among routing algorithms ['dijkstra', 'astar']" #else - "Select among routing algorithms ['dijkstra', 'astar', 'bulkstar', 'CH', 'CHWrapper']" + "Select among routing algorithms ['dijkstra', 'astar', 'bulkstar', 'CH', 'CHWrapper']" #endif - ); + ); -#ifdef HAVE_MESOSIM // catchall for internal stuff - 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 Hirarchy"); +#ifdef HAVE_INTERNAL // catchall for internal stuff + 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 Hirarchy"); #endif } diff -Nru sumo-0.15.0~dfsg/src/router/ROHelper.cpp sumo-0.16.0~dfsg/src/router/ROHelper.cpp --- sumo-0.15.0~dfsg/src/router/ROHelper.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROHelper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Some helping methods for router /****************************************************************************/ @@ -57,7 +57,7 @@ */ void -recheckForLoops(std::vector &edges) { +recheckForLoops(std::vector& edges) { // remove loops at the route's begin // (vehicle makes a turnaround to get into the right direction at an already passed node) RONode* start = edges[0]->getFromNode(); @@ -109,7 +109,7 @@ } -std::ostream& operator<<(std::ostream& os, const std::vector &ev) { +std::ostream& operator<<(std::ostream& os, const std::vector& ev) { bool hadFirst = false; for (std::vector::const_iterator j = ev.begin(); j != ev.end(); j++) { if ((*j)->getType() != ROEdge::ET_DISTRICT) { diff -Nru sumo-0.15.0~dfsg/src/router/ROHelper.h sumo-0.16.0~dfsg/src/router/ROHelper.h --- sumo-0.15.0~dfsg/src/router/ROHelper.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Some helping methods for router /****************************************************************************/ @@ -91,20 +91,20 @@ /* SUMOReal recomputeCosts(SUMOAbstractRouter &router, const std::vector &edges, - const ROVehicle * const v, SUMOTime time) ; + const ROVehicle * const v, SUMOTime time); */ /** @brief Checks whether the given edge list contains loops and removes them * * @param[in] edges The list of edges to remove loops from */ -void recheckForLoops(std::vector &edges) ; +void recheckForLoops(std::vector& edges); } /// @brief Output operator for edge lists (edges will be written as their ids, divided by spaces) -std::ostream& operator<<(std::ostream& os, const std::vector &ev); +std::ostream& operator<<(std::ostream& os, const std::vector& ev); diff -Nru sumo-0.15.0~dfsg/src/router/ROLane.h sumo-0.16.0~dfsg/src/router/ROLane.h --- sumo-0.15.0~dfsg/src/router/ROLane.h 2012-03-08 00:03:05.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROLane.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ROLane.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: ROLane.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A single lane the router may use /****************************************************************************/ @@ -57,7 +57,7 @@ * @param[in] maxSpeed The maximum speed allowed on the lane * @param[in] permissions Vehicle classes that may pass this lane */ - ROLane(const std::string& id, SUMOReal length, SUMOReal maxSpeed, SVCPermissions permissions) : + ROLane(const std::string& id, SUMOReal length, SUMOReal maxSpeed, SVCPermissions permissions) : Named(id), myLength(length), myMaxSpeed(maxSpeed), myPermissions(permissions) {} diff -Nru sumo-0.15.0~dfsg/src/router/ROLoader.cpp sumo-0.16.0~dfsg/src/router/ROLoader.cpp --- sumo-0.15.0~dfsg/src/router/ROLoader.cpp 2012-02-29 00:03:02.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROLoader.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Christian Roessel /// @date Sept 2002 -/// @version $Id: ROLoader.cpp 11965 2012-02-28 13:28:30Z behrisch $ +/// @version $Id: ROLoader.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Loader for networks and route imports /****************************************************************************/ @@ -56,9 +56,9 @@ #include "RORDGenerator_ODAmounts.h" #include "ROTypedXMLRoutesLoader.h" -#ifdef HAVE_MESOSIM // catchall for internal stuff +#ifdef HAVE_INTERNAL // catchall for internal stuff #include -#endif // have HAVE_MESOSIM +#endif // have HAVE_INTERNAL #ifdef CHECK_MEMORY_LEAKS #include @@ -79,7 +79,11 @@ e->addTravelTime(val, beg, end); } else { if (id[0] != ':') { - WRITE_ERROR("Trying to set a weight for the unknown edge '" + id + "'."); + if (OptionsCont::getOptions().getBool("ignore-errors")) { + WRITE_WARNING("Trying to set a weight for the unknown edge '" + id + "'."); + } else { + WRITE_ERROR("Trying to set a weight for the unknown edge '" + id + "'."); + } } } } @@ -96,7 +100,11 @@ e->addEffort(val, beg, end); } else { if (id[0] != ':') { - WRITE_ERROR("Trying to set a weight for the unknown edge '" + id + "'."); + if (OptionsCont::getOptions().getBool("ignore-errors")) { + WRITE_WARNING("Trying to set a weight for the unknown edge '" + id + "'."); + } else { + WRITE_ERROR("Trying to set a weight for the unknown edge '" + id + "'."); + } } } } @@ -105,8 +113,8 @@ // --------------------------------------------------------------------------- // ROLoader - methods // --------------------------------------------------------------------------- -ROLoader::ROLoader(OptionsCont& oc, bool emptyDestinationsAllowed) : - myOptions(oc), +ROLoader::ROLoader(OptionsCont& oc, bool emptyDestinationsAllowed) : + myOptions(oc), myEmptyDestinationsAllowed(emptyDestinationsAllowed), myLogSteps(!oc.getBool("no-step-log")) {} @@ -186,7 +194,7 @@ void ROLoader::processRoutesStepWise(SUMOTime start, SUMOTime end, - RONet& net, SUMOAbstractRouter &router) { + RONet& net, SUMOAbstractRouter& router) { SUMOTime absNo = end - start; // skip routes that begin before the simulation's begin // loop till the end @@ -215,7 +223,7 @@ bool -ROLoader::makeSingleStep(SUMOTime end, RONet& net, SUMOAbstractRouter &router) { +ROLoader::makeSingleStep(SUMOTime end, RONet& net, SUMOAbstractRouter& router) { RouteLoaderCont::iterator i; // go through all handlers if (myHandler.size() != 0) { @@ -252,7 +260,7 @@ void ROLoader::processAllRoutes(SUMOTime start, SUMOTime end, - RONet& net, SUMOAbstractRouter &router) { + RONet& net, SUMOAbstractRouter& router) { long absNo = end - start; bool ok = true; for (RouteLoaderCont::iterator i = myHandler.begin(); ok && i != myHandler.end(); i++) { @@ -270,20 +278,18 @@ } +#ifdef HAVE_INTERNAL // catchall for internal stuff void ROLoader::processAllRoutesWithBulkRouter(SUMOTime start, SUMOTime end, - RONet& net, SUMOAbstractRouter &router) { -#ifndef HAVE_MESOSIM // catchall for internal stuff - assert(false); -#else + RONet& net, SUMOAbstractRouter& router) { bool ok = true; for (RouteLoaderCont::iterator i = myHandler.begin(); ok && i != myHandler.end(); i++) { ok &= (*i)->readRoutesAtLeastUntil(SUMOTime_MAX); } RouteAggregator::processAllRoutes(net, router); net.saveAndRemoveRoutesUntil(myOptions, router, end); -#endif } +#endif bool @@ -329,9 +335,7 @@ if (optionName == "route-files" || optionName == "alternative-files") { return new RORDLoader_SUMOBase(net, string2time(myOptions.getString("begin")), string2time(myOptions.getString("end")), - myOptions.getInt("max-alternatives"), myOptions.getBool("repair"), - myOptions.getBool("with-taz"), myOptions.getBool("keep-all-routes"), - myOptions.getBool("skip-new-routes"), file); + myOptions.getBool("repair"), myOptions.getBool("with-taz"), file); } if (optionName == "trip-files") { return new RORDLoader_TripDefs(net, @@ -382,7 +386,7 @@ } } // build edge-internal time lines - const std::map &edges = net.getEdgeMap(); + const std::map& edges = net.getEdgeMap(); for (std::map::const_iterator i = edges.begin(); i != edges.end(); ++i) { (*i).second->buildTimeLines(measure); } diff -Nru sumo-0.15.0~dfsg/src/router/ROLoader.h sumo-0.16.0~dfsg/src/router/ROLoader.h --- sumo-0.15.0~dfsg/src/router/ROLoader.h 2012-02-24 00:02:59.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROLoader.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROLoader.h 11944 2012-02-23 13:24:04Z namdre $ +/// @version $Id: ROLoader.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Loader for networks and route imports /****************************************************************************/ @@ -67,10 +67,10 @@ /** @brief Constructor * * @param[in] oc The options to use - * @param[in] emptyDestinationsAllowed Whether tripdefs may be given without destinations + * @param[in] emptyDestinationsAllowed Whether trips may be given without destinations * @todo Recheck usage of emptyDestinationsAllowed */ - ROLoader(OptionsCont& oc, bool emptyDestinationsAllowed) ; + ROLoader(OptionsCont& oc, bool emptyDestinationsAllowed); /// @brief Destructor @@ -90,18 +90,20 @@ /** @brief Loads routes stepwise This is done for all previously build route loaders */ void processRoutesStepWise(SUMOTime start, SUMOTime end, - RONet& net, SUMOAbstractRouter &router); + RONet& net, SUMOAbstractRouter& router); /** @brief Loads all routes at once This is done for all previously build route loaders */ void processAllRoutes(SUMOTime start, SUMOTime end, - RONet& net, SUMOAbstractRouter &router); + RONet& net, SUMOAbstractRouter& router); +#ifdef HAVE_INTERNAL // catchall for internal stuff /** @brief Loads all routes and processes them with BulkStarRouter */ void processAllRoutesWithBulkRouter(SUMOTime start, SUMOTime end, - RONet& net, SUMOAbstractRouter &router); + RONet& net, SUMOAbstractRouter& router); +#endif - bool makeSingleStep(SUMOTime end, RONet& net, SUMOAbstractRouter &router); + bool makeSingleStep(SUMOTime end, RONet& net, SUMOAbstractRouter& router); protected: /** @brief Opens route handler of the given type @@ -125,7 +127,7 @@ * @param[in] net The net to assign to the built handlers * @return Whether the wished handler(s) could be built */ - bool openTypedRoutes(const std::string& optionName, RONet& net) ; + bool openTypedRoutes(const std::string& optionName, RONet& net); /** @brief Returns the first time step known by the built handlers @@ -137,7 +139,7 @@ * @return The first time step of loaded routes * @see ROAbstractRouteDefLoader::getLastReadTimeStep */ - SUMOTime getMinTimeStep() const ; + SUMOTime getMinTimeStep() const; @@ -163,7 +165,7 @@ * @see SAXWeightsHandler::EdgeFloatTimeLineRetriever::addEdgeWeight */ void addEdgeWeight(const std::string& id, - SUMOReal val, SUMOReal beg, SUMOReal end) const ; + SUMOReal val, SUMOReal beg, SUMOReal end) const; private: /// @brief The network edges shall be obtained from @@ -194,7 +196,7 @@ * @see SAXWeightsHandler::EdgeFloatTimeLineRetriever::addEdgeWeight */ void addEdgeWeight(const std::string& id, - SUMOReal val, SUMOReal beg, SUMOReal end) const ; + SUMOReal val, SUMOReal beg, SUMOReal end) const; private: /// @brief The network edges shall be obtained from @@ -206,14 +208,14 @@ protected: ROTypedXMLRoutesLoader* buildNamedHandler(const std::string& optionName, - const std::string& file, RONet& net) ; + const std::string& file, RONet& net); - void writeStats(SUMOTime time, SUMOTime start, int absNo) ; + void writeStats(SUMOTime time, SUMOTime start, int absNo); /** @brief Deletes all handlers and clears their container ("myHandler") */ - void destroyHandlers() ; + void destroyHandlers(); protected: diff -Nru sumo-0.15.0~dfsg/src/router/RONet.cpp sumo-0.16.0~dfsg/src/router/RONet.cpp --- sumo-0.15.0~dfsg/src/router/RONet.cpp 2012-02-01 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RONet.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONet.cpp 11821 2012-01-31 15:02:07Z namdre $ +/// @version $Id: RONet.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The router's network representation /****************************************************************************/ @@ -60,10 +60,10 @@ // method definitions // =========================================================================== RONet::RONet() - : myVehicleTypes(), - myRoutesOutput(0), myRouteAlternativesOutput(0), myTypesOutput(0), + : myVehicleTypes(), myDefaultVTypeMayBeDeleted(true), + myRoutesOutput(0), myRouteAlternativesOutput(0), myTypesOutput(0), myReadRouteNo(0), myDiscardedRouteNo(0), myWrittenRouteNo(0), - myHaveRestrictions(false), myDefaultVTypeMayBeDeleted(true) { + myHaveRestrictions(false) { SUMOVTypeParameter* type = new SUMOVTypeParameter(); type->id = DEFAULT_VTYPE_ID; type->onlyReferenced = true; @@ -109,20 +109,26 @@ void RONet::openOutput(const std::string& filename, bool useAlternatives, const std::string& typefilename) { myRoutesOutput = &OutputDevice::getDevice(filename); - myRoutesOutput->writeXMLHeader("routes", "", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/routes_file.xsd\""); if (useAlternatives) { - size_t len = filename.length(); + const size_t len = filename.length(); if (len > 4 && filename.substr(len - 4) == ".xml") { myRouteAlternativesOutput = &OutputDevice::getDevice(filename.substr(0, len - 4) + ".alt.xml"); } else { - myRouteAlternativesOutput = &OutputDevice::getDevice(filename + ".alt"); + if (len > 4 && filename.substr(len - 4) == ".sbx") { + myRouteAlternativesOutput = &OutputDevice::getDevice(filename.substr(0, len - 4) + ".alt.sbx"); + } else { + myRouteAlternativesOutput = &OutputDevice::getDevice(filename + ".alt"); + } } - myRouteAlternativesOutput->writeXMLHeader("route-alternatives", "", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/routes_file.xsd\""); } - if (typefilename != "") { - myTypesOutput = &OutputDevice::getDevice(typefilename); - myTypesOutput->writeXMLHeader("routes", "", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/routes_file.xsd\""); - } + myRoutesOutput->writeHeader(SUMO_TAG_ROUTES); + if (useAlternatives) { + myRouteAlternativesOutput->writeHeader(SUMO_TAG_ROUTES); + } + if (typefilename != "") { + myTypesOutput = &OutputDevice::getDevice(typefilename); + myTypesOutput->writeXMLHeader("routes", "", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/routes_file.xsd\""); + } } @@ -154,11 +160,15 @@ if (type != 0) { return type; } + VTypeDistDictType::iterator it2 = myVTypeDistDict.find(id); + if (it2 != myVTypeDistDict.end()) { + return it2->second->get(); + } if (id == "") { // ok, no vehicle type was given within the user input // return the default type myDefaultVTypeMayBeDeleted = false; - return myVehicleTypes.get(DEFAULT_VTYPE_ID); + return myVehicleTypes.get(DEFAULT_VTYPE_ID); } // Assume, the user will define the type somewhere else // return a type which contains the id only @@ -171,12 +181,28 @@ bool -RONet::addVehicleType(SUMOVTypeParameter* type) { - if (type->id == DEFAULT_VTYPE_ID && myDefaultVTypeMayBeDeleted) { - myVehicleTypes.remove(DEFAULT_VTYPE_ID); - myDefaultVTypeMayBeDeleted = false; +RONet::checkVType(const std::string& id) { + if (id == DEFAULT_VTYPE_ID) { + if (myDefaultVTypeMayBeDeleted) { + myVehicleTypes.remove(id); + myDefaultVTypeMayBeDeleted = false; + } else { + return false; + } + } else { + if (myVehicleTypes.get(id) != 0 || myVTypeDistDict.find(id) != myVTypeDistDict.end()) { + return false; + } } - if (!myVehicleTypes.add(type->id, type)) { + return true; +} + + +bool +RONet::addVehicleType(SUMOVTypeParameter* type) { + if (checkVType(type->id)) { + myVehicleTypes.add(type->id, type); + } else { WRITE_ERROR("The vehicle type '" + type->id + "' occurs at least twice."); delete type; return false; @@ -186,6 +212,16 @@ bool +RONet::addVTypeDistribution(const std::string& id, RandomDistributor* vehTypeDistribution) { + if (checkVType(id)) { + myVTypeDistDict[id] = vehTypeDistribution; + return true; + } + return false; +} + + +bool RONet::addVehicle(const std::string& id, ROVehicle* veh) { if (myVehIDs.find(id) == myVehIDs.end() && myVehicles.add(id, veh)) { myVehIDs.insert(id); @@ -198,7 +234,7 @@ bool -RONet::computeRoute(OptionsCont& options, SUMOAbstractRouter &router, +RONet::computeRoute(OptionsCont& options, SUMOAbstractRouter& router, const ROVehicle* const veh) { MsgHandler* mh = MsgHandler::getErrorInstance(); std::string noRouteMsg = "The vehicle '" + veh->getID() + "' has no valid route."; @@ -239,7 +275,7 @@ SUMOTime -RONet::saveAndRemoveRoutesUntil(OptionsCont& options, SUMOAbstractRouter &router, +RONet::saveAndRemoveRoutesUntil(OptionsCont& options, SUMOAbstractRouter& router, SUMOTime time) { SUMOTime lastTime = -1; // write all vehicles (and additional structures) @@ -264,18 +300,17 @@ // ok, compute the route (try it) if (computeRoute(options, router, veh)) { // write the route - veh->saveAllAsXML(router, *myRoutesOutput, myRouteAlternativesOutput, myTypesOutput, options.getBool("exit-times")); + veh->saveAllAsXML(*myRoutesOutput, myRouteAlternativesOutput, myTypesOutput, options.getBool("exit-times")); myWrittenRouteNo++; - // remove the route if it is not longer used - /* - if (!myRoutes.erase(route->getID())) { - WRITE_WARNING("Could not remove " + route->getID()); - } - */ } else { myDiscardedRouteNo++; } - // and the vehicle + // delete routes and the vehicle + if (veh->getRouteDefinition()->getID()[0] == '!') { + if (!myRoutes.erase(veh->getRouteDefinition()->getID())) { + delete veh->getRouteDefinition(); + } + } myVehicles.erase(veh->getID()); } return lastTime; @@ -342,7 +377,7 @@ if (myDestinationEdges.size() != 0 || mySourceEdges.size() != 0) { return; } - const std::map &edges = myEdges.getMyMap(); + const std::map& edges = myEdges.getMyMap(); for (std::map::const_iterator i = edges.begin(); i != edges.end(); ++i) { ROEdge* e = (*i).second; ROEdge::EdgeType type = e->getType(); @@ -363,7 +398,7 @@ } -const std::map & +const std::map& RONet::getEdgeMap() const { return myEdges.getMyMap(); } diff -Nru sumo-0.15.0~dfsg/src/router/RONet.h sumo-0.16.0~dfsg/src/router/RONet.h --- sumo-0.15.0~dfsg/src/router/RONet.h 2012-02-01 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RONet.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONet.h 11823 2012-01-31 16:17:38Z namdre $ +/// @version $Id: RONet.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The router's network representation /****************************************************************************/ @@ -43,6 +43,7 @@ #include "RORouteDef.h" #include #include +#include // =========================================================================== @@ -70,11 +71,11 @@ public: /// @brief Constructor - RONet() ; + RONet(); /// @brief Destructor - virtual ~RONet() ; + virtual ~RONet(); /// @name Insertion and retrieval of graph parts @@ -89,7 +90,7 @@ * @param[in] edge The edge to add * @return Whether the edge was added (if not, it was deleted, too) */ - virtual bool addEdge(ROEdge* edge) ; + virtual bool addEdge(ROEdge* edge); /** @brief Retrieves an edge from the network @@ -114,7 +115,7 @@ * * @param[in] node The node to add */ - void addNode(RONode* node) ; + void addNode(RONode* node); /** @brief Retrieves an node from the network @@ -133,7 +134,16 @@ /// @name Insertion and retrieval of vehicle types, vehicles, routes, and route definitions //@{ - /* @brief Adds a read vehicle type definition to the network + /** @brief Checks whether the vehicle type (distribution) may be added + * + * This method checks also whether the default type may still be replaced + * @param[in] id The id of the vehicle type (distribution) to add + * @return Whether the type (distribution) may be added + */ + bool checkVType(const std::string& id); + + + /** @brief Adds a read vehicle type definition to the network * * If the vehicle type definition is already known (another one with * the same id exists), false is returned, and the vehicle type @@ -142,7 +152,23 @@ * @param[in] def The vehicle type to add * @return Whether the vehicle type could be added */ - virtual bool addVehicleType(SUMOVTypeParameter* type) ; + virtual bool addVehicleType(SUMOVTypeParameter* type); + + + /** @brief Adds a vehicle type distribution + * + * If another vehicle type (or distribution) with the same id exists, false is returned. + * Otherwise, the vehicle type distribution is added to the internal vehicle type distribution + * container "myVTypeDistDict". + * + * This control get responsible for deletion of the added vehicle + * type distribution. + * + * @param[in] id The id of the distribution to add + * @param[in] vehTypeDistribution The vehicle type distribution to add + * @return Whether the vehicle type could be added + */ + bool addVTypeDistribution(const std::string& id, RandomDistributor* vehTypeDistribution); /** @brief Retrieves the named vehicle type @@ -157,7 +183,7 @@ * @return The named vehicle type * @todo Check whether a const pointer may be returned */ - SUMOVTypeParameter* getVehicleTypeSecure(const std::string& id) ; + SUMOVTypeParameter* getVehicleTypeSecure(const std::string& id); /* @brief Adds a route definition to the network @@ -170,7 +196,7 @@ * @return Whether the route definition could be added * @todo Rename myRoutes to myRouteDefinitions */ - bool addRouteDef(RORouteDef* def) ; + bool addRouteDef(RORouteDef* def); /** @brief Returns the named route definition @@ -196,7 +222,7 @@ * @param[in] veh The vehicle to add * @return Whether the vehicle could be added */ - virtual bool addVehicle(const std::string& id, ROVehicle* veh) ; + virtual bool addVehicle(const std::string& id, ROVehicle* veh); // @} @@ -216,7 +242,7 @@ * @return The last seen departure time>=time */ SUMOTime saveAndRemoveRoutesUntil(OptionsCont& options, - SUMOAbstractRouter &router, SUMOTime time); + SUMOAbstractRouter& router, SUMOTime time); /// Returns the information whether further vehicles are stored @@ -242,7 +268,7 @@ /** @brief closes the file output for computed routes */ - void closeOutput() ; + void closeOutput(); @@ -253,7 +279,7 @@ * it is tried to be built, first. * @return A random edge from the list of edges with no predecessor */ - ROEdge* getRandomSource() ; + ROEdge* getRandomSource(); /** @brief Returns a random edge which may be used as a starting point @@ -262,7 +288,7 @@ * it is tried to be built, first. * @return A random edge from the list of edges with no predecessor */ - const ROEdge* getRandomSource() const ; + const ROEdge* getRandomSource() const; /** @brief Returns a random edge which may be used as an ending point @@ -271,7 +297,7 @@ * it is tried to be built, first. * @return A random edge from the list of edges with no successor */ - ROEdge* getRandomDestination() ; + ROEdge* getRandomDestination(); /** @brief Returns a random edge which may be used as an ending point @@ -280,13 +306,13 @@ * it is tried to be built, first. * @return A random edge from the list of edges with no successor */ - const ROEdge* getRandomDestination() const ; + const ROEdge* getRandomDestination() const; /// Returns the number of edges thenetwork contains unsigned int getEdgeNo() const; - const std::map &getEdgeMap() const; + const std::map& getEdgeMap() const; bool hasRestrictions() const; @@ -294,7 +320,7 @@ protected: bool computeRoute(OptionsCont& options, - SUMOAbstractRouter &router, const ROVehicle* const veh); + SUMOAbstractRouter& router, const ROVehicle* const veh); /// Initialises the lists of source and destination edges void checkSourceAndDestinations() const; @@ -319,6 +345,11 @@ /// @brief Known vehicle types NamedObjectCont myVehicleTypes; + /// @brief Vehicle type distribution dictionary type + typedef std::map< std::string, RandomDistributor* > VTypeDistDictType; + /// @brief A distribution of vehicle types (probability->vehicle type) + VTypeDistDictType myVTypeDistDict; + /// @brief Whether no vehicle type was loaded bool myDefaultVTypeMayBeDeleted; diff -Nru sumo-0.15.0~dfsg/src/router/RONetHandler.cpp sumo-0.16.0~dfsg/src/router/RONetHandler.cpp --- sumo-0.15.0~dfsg/src/router/RONetHandler.cpp 2012-03-08 00:03:06.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RONetHandler.cpp 2012-09-25 22:01:29.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONetHandler.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: RONetHandler.cpp 12605 2012-08-28 06:50:42Z dkrajzew $ /// // The handler for SUMO-Networks /****************************************************************************/ @@ -58,8 +58,7 @@ ROAbstractEdgeBuilder& eb) : SUMOSAXHandler("sumo-network"), myNet(net), myCurrentName(), - myCurrentEdge(0), myEdgeBuilder(eb), - myHaveWarnedAboutDeprecatedDistrict(false), myHaveWarnedAboutDeprecatedDSource(false), myHaveWarnedAboutDeprecatedDSink(false) {} + myCurrentEdge(0), myEdgeBuilder(eb) {} RONetHandler::~RONetHandler() {} @@ -83,36 +82,15 @@ case SUMO_TAG_JUNCTION: parseJunction(attrs); break; - case SUMO_TAG_SUCC: - parseConnectingEdge(attrs); - break; - case SUMO_TAG_SUCCLANE: - parseConnectedEdge(attrs); - break; case SUMO_TAG_CONNECTION: parseConnection(attrs); break; - case SUMO_TAG_DISTRICT__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDistrict) { - myHaveWarnedAboutDeprecatedDistrict = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DISTRICT__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZ) + "'."); - } case SUMO_TAG_TAZ: parseDistrict(attrs); break; - case SUMO_TAG_DSOURCE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDSource) { - myHaveWarnedAboutDeprecatedDSource = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DSOURCE__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZSOURCE) + "'."); - } case SUMO_TAG_TAZSOURCE: parseDistrictEdge(attrs, true); break; - case SUMO_TAG_DSINK__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedDSink) { - myHaveWarnedAboutDeprecatedDSink = true; - WRITE_WARNING("'" + toString(SUMO_TAG_DSINK__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_TAG_TAZSINK) + "'."); - } case SUMO_TAG_TAZSINK: parseDistrictEdge(attrs, false); break; @@ -189,9 +167,7 @@ return; } // get the speed - SUMOReal maxSpeed = attrs.hasAttribute(SUMO_ATTR_SPEED) - ? attrs.getSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok) - : attrs.getSUMORealReporting(SUMO_ATTR_MAXSPEED__DEPRECATED, id.c_str(), ok); + SUMOReal maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_SPEED, id.c_str(), ok); SUMOReal length = attrs.getSUMORealReporting(SUMO_ATTR_LENGTH, id.c_str(), ok); std::string allow = attrs.getOptStringReporting(SUMO_ATTR_ALLOW, id.c_str(), ok, ""); std::string disallow = attrs.getOptStringReporting(SUMO_ATTR_DISALLOW, id.c_str(), ok, ""); @@ -236,42 +212,6 @@ void -RONetHandler::parseConnectingEdge(const SUMOSAXAttributes& attrs) { - bool ok = true; - std::string id = attrs.getStringReporting(SUMO_ATTR_EDGE, 0, ok); - if (id[0] == ':') { - myCurrentEdge = 0; - return; - } - myCurrentEdge = myNet.getEdge(id); - if (myCurrentEdge == 0) { - throw ProcessError("An unknown edge occured (id='" + id + "')."); - } -} - - -void -RONetHandler::parseConnectedEdge(const SUMOSAXAttributes& attrs) { - if (myCurrentEdge == 0) { - // earlier error or internal link - return; - } - bool ok = true; - std::string id = attrs.getStringReporting(SUMO_ATTR_LANE, myCurrentName.c_str(), ok); - if (id == "SUMO_NO_DESTINATION") { - return; - } - ROEdge* succ = myNet.getEdge(id.substr(0, id.rfind('_'))); - if (succ != 0) { - // connect edge - myCurrentEdge->addFollower(succ); - } else { - WRITE_ERROR("At edge '" + myCurrentName + "': succeeding edge '" + id + "' does not exist."); - } -} - - -void RONetHandler::parseConnection(const SUMOSAXAttributes& attrs) { bool ok = true; std::string fromID = attrs.getStringReporting(SUMO_ATTR_FROM, 0, ok); diff -Nru sumo-0.15.0~dfsg/src/router/RONetHandler.h sumo-0.16.0~dfsg/src/router/RONetHandler.h --- sumo-0.15.0~dfsg/src/router/RONetHandler.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RONetHandler.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONetHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RONetHandler.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The handler that parses a SUMO-network for its usage in a router /****************************************************************************/ @@ -68,7 +68,7 @@ /// @brief Destructor - virtual ~RONetHandler() ; + virtual ~RONetHandler(); protected: @@ -83,7 +83,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); //@} protected: @@ -126,32 +126,6 @@ void parseJunction(const SUMOSAXAttributes& attrs); - /** @begin (deprecated) Begins parsing edges that are approached by an edge - * - * Called on the occurence of a "succ" element, this method - * retrieves the id of the edge described herein and - using it - the - * edge itself. Stores the so retrieved edge in "myCurrentEdge". - * If the given edge is not known, a ProcessError is thrown. - * - * @param[in] attrs The attributes (of the "succ"-element) to parse - * @exception ProcessError If the edge given in cedge@edge is not known - */ - void parseConnectingEdge(const SUMOSAXAttributes& attrs) ; - - - /** @begin (deprecated) Parses an approached edge and lets the approaching know about the connection - * - * Called on the occurence of a "succlane" element, this method - * retrieves the id of the approachable edge. If this edge is known - * and valid, the approaching edge is informed about it (by calling - * "ROEdge::addFollower"). - * - * @param[in] attrs The attributes (of the "succlane"-element) to parse - * @todo No exception? - */ - void parseConnectedEdge(const SUMOSAXAttributes& attrs); - - /** @begin Parses a connection * Called on the occurence of a "connection" element * @param[in] attrs The attributes (of the "connection"-element) to parse @@ -168,7 +142,7 @@ * @param[in] attrs The attributes (of the "district"-element) to parse * @exception ProcessError If an edge given in district@edges is not known */ - void parseDistrict(const SUMOSAXAttributes& attrs) ; + void parseDistrict(const SUMOSAXAttributes& attrs); /** @begin Parses a district edge and connects it to the district @@ -203,7 +177,7 @@ /// @brief The object used to build of edges of the desired type ROAbstractEdgeBuilder& myEdgeBuilder; - bool myHaveWarnedAboutDeprecatedDistrict, myHaveWarnedAboutDeprecatedDSource, myHaveWarnedAboutDeprecatedDSink; + private: diff -Nru sumo-0.15.0~dfsg/src/router/RONode.h sumo-0.16.0~dfsg/src/router/RONode.h --- sumo-0.15.0~dfsg/src/router/RONode.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RONode.h 2012-09-25 22:01:29.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONode.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RONode.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Base class for nodes used by the router /****************************************************************************/ @@ -48,17 +48,17 @@ /** @brief Constructor * @param[in] id The id of the node */ - RONode(const std::string& id) ; + RONode(const std::string& id); /// @brief Destructor - ~RONode() ; + ~RONode(); /** @brief Sets the position of the node * @param[in] p The node's position */ - void setPosition(const Position& p) ; + void setPosition(const Position& p); /** @brief Returns the position of the node diff -Nru sumo-0.15.0~dfsg/src/router/RORDGenerator_ODAmounts.cpp sumo-0.16.0~dfsg/src/router/RORDGenerator_ODAmounts.cpp --- sumo-0.15.0~dfsg/src/router/RORDGenerator_ODAmounts.cpp 2012-02-18 00:03:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORDGenerator_ODAmounts.cpp 2012-11-05 00:02:22.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 21 Jan 2004 -/// @version $Id: RORDGenerator_ODAmounts.cpp 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: RORDGenerator_ODAmounts.cpp 12927 2012-11-04 06:47:13Z behrisch $ /// // Class for loading trip amount definitions and route generation /****************************************************************************/ @@ -40,13 +40,13 @@ #include #include #include -#include "RORouteDef.h" +#include "RORoute.h" #include "RONet.h" -#include "RORouteDef_OrigDest.h" #include "RORDGenerator_ODAmounts.h" #include "ROVehicle.h" -#include "RORouteDef_Complete.h" +#include "RORouteDef.h" #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -119,7 +119,7 @@ void RORDGenerator_ODAmounts::FlowDef::addSingleRoute(RONet& net, SUMOTime t) { std::string id = myVehicle->getID() + "_" + toString(myInserted); - RORouteDef* rd = myRoute->copy(id); + RORouteDef* rd = myRoute->copyOrigDest(id); net.addRouteDef(rd); ROVehicle* veh = myVehicle->copy(id, t, rd); net.addVehicle(id, veh); @@ -143,11 +143,9 @@ bool randomize, const std::string& fileName) : RORDLoader_TripDefs(net, begin, end, emptyDestinationsAllowed, false, fileName), - myRandom(randomize), - myHaveWarnedAboutDeprecatedNumber(false) { + myRandom(randomize) { // read the complete file on initialisation - myParser->parseReset(myToken); - myParser->parse(getFileName().c_str()); + XMLSubSys::runParser(*this, getFileName()); myCurrentDepart = begin; } @@ -231,17 +229,7 @@ bool ok = true; myIntervalBegin = attrs.getOptSUMOTimeReporting(SUMO_ATTR_BEGIN, id.c_str(), ok, myUpperIntervalBegin); myIntervalEnd = attrs.getOptSUMOTimeReporting(SUMO_ATTR_END, id.c_str(), ok, myUpperIntervalEnd); - if (attrs.hasAttribute(SUMO_ATTR_NUMBER)) { - myVehicle2InsertNumber = attrs.getIntReporting(SUMO_ATTR_NUMBER, id.c_str(), ok); - } else if (attrs.hasAttribute(SUMO_ATTR_NO__DEPRECATED)) { - if (!myHaveWarnedAboutDeprecatedNumber) { - myHaveWarnedAboutDeprecatedNumber = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_NO__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_NUMBER) + "' instead."); - } - myVehicle2InsertNumber = attrs.getIntReporting(SUMO_ATTR_NO__DEPRECATED, id.c_str(), ok); - } else { - throw ProcessError("Flow '" + id + "' has no vehicle number."); - } + myVehicle2InsertNumber = attrs.getIntReporting(SUMO_ATTR_NUMBER, id.c_str(), ok); // throw ProcessError("Flow '" + id + "' has no vehicle number."); if (!ok) { throw ProcessError(); } @@ -272,7 +260,11 @@ } // add the vehicle type, the vehicle and the route to the net RGBColor* col = myParameter->wasSet(VEHPARS_COLOR_SET) ? new RGBColor(myParameter->color) : 0; - RORouteDef* route = new RORouteDef_OrigDest(myParameter->id, col, myBeginEdge, myEndEdge);//!!! set double in route def and flowdef? + RORouteDef* route = new RORouteDef(myParameter->id, 0, true);//!!! set double in route def and flowdef? + std::vector edges; + edges.push_back(myBeginEdge); + edges.push_back(myEndEdge); + route->addLoadedAlternative(new RORoute(myParameter->id, 0, 1, edges, col)); SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(myParameter->vtypeid); // check whether any errors occured if (MsgHandler::getErrorInstance()->wasInformed()) { diff -Nru sumo-0.15.0~dfsg/src/router/RORDGenerator_ODAmounts.h sumo-0.16.0~dfsg/src/router/RORDGenerator_ODAmounts.h --- sumo-0.15.0~dfsg/src/router/RORDGenerator_ODAmounts.h 2012-02-18 00:03:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORDGenerator_ODAmounts.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 21 Jan 2004 -/// @version $Id: RORDGenerator_ODAmounts.h 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: RORDGenerator_ODAmounts.h 12622 2012-08-30 10:16:00Z behrisch $ /// // Class for loading trip amount definitions and route generation /****************************************************************************/ @@ -43,6 +43,12 @@ // =========================================================================== +// class declarations +// =========================================================================== +class RORouteDef_OrigDest; + + +// =========================================================================== // class definitions // =========================================================================== /** @@ -56,10 +62,10 @@ /// Constructor RORDGenerator_ODAmounts(RONet& net, SUMOTime begin, SUMOTime end, bool emptyDestinationsAllowed, - bool randomize, const std::string& file = "") ; + bool randomize, const std::string& file = ""); /// Destructor - ~RORDGenerator_ODAmounts() ; + ~RORDGenerator_ODAmounts(); /** @brief Adds routes from the file until the given time is reached @@ -84,7 +90,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -93,11 +99,11 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} /// Parses the trip amount definition - void parseFlowAmountDef(const SUMOSAXAttributes& attrs) ; + void parseFlowAmountDef(const SUMOSAXAttributes& attrs); /// Closes the trip amount parsing void myEndFlowAmountDef(); @@ -130,22 +136,22 @@ private: /// (description of) the vehicle to insert - ROVehicle* myVehicle; + const ROVehicle* const myVehicle; /// (description of) the vehicle type to use - SUMOVTypeParameter* myVehicleType; + const SUMOVTypeParameter* const myVehicleType; /// (description of) the route to use - RORouteDef* myRoute; + const RORouteDef* const myRoute; /// The begin of the described interval - SUMOTime myIntervalBegin; + const SUMOTime myIntervalBegin; /// The end of the described interval - SUMOTime myIntervalEnd; + const SUMOTime myIntervalEnd; /// The number of vehicles to insert within the described interval - unsigned int myVehicle2InsertNumber; + const unsigned int myVehicle2InsertNumber; /// The number of vehicles already inserted unsigned int myInserted; @@ -156,11 +162,15 @@ /// Information whether randomized departures are used bool myRandom; + private: + /** @brief invalidated assignment operator */ + FlowDef& operator=(const FlowDef& s); + }; private: /// Builds the routes for the given time step - void buildForTimeStep(SUMOTime time) ; + void buildForTimeStep(SUMOTime time); private: /// The begin of the interval current read @@ -194,8 +204,6 @@ bool myRandom; - bool myHaveWarnedAboutDeprecatedNumber; - private: /// @brief Invalidated copy constructor RORDGenerator_ODAmounts(const RORDGenerator_ODAmounts& src); diff -Nru sumo-0.15.0~dfsg/src/router/RORDLoader_SUMOBase.cpp sumo-0.16.0~dfsg/src/router/RORDLoader_SUMOBase.cpp --- sumo-0.15.0~dfsg/src/router/RORDLoader_SUMOBase.cpp 2012-02-21 00:03:01.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORDLoader_SUMOBase.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORDLoader_SUMOBase.cpp 11931 2012-02-20 09:22:03Z behrisch $ +/// @version $Id: RORDLoader_SUMOBase.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The base class for SUMO-native route handlers /****************************************************************************/ @@ -30,19 +30,19 @@ #include #endif -#include "RORDLoader_SUMOBase.h" -#include -#include "RORouteDef.h" -#include "RONet.h" -#include +#include #include #include +#include #include +#include +#include +#include +#include "RORouteDef.h" +#include "RONet.h" #include "ROVehicle.h" -#include "RORouteDef_Alternatives.h" -#include "RORouteDef_Complete.h" #include "RORoute.h" -#include +#include "RORDLoader_SUMOBase.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -53,15 +53,12 @@ // method definitions // =========================================================================== RORDLoader_SUMOBase::RORDLoader_SUMOBase(RONet& net, - SUMOTime begin, SUMOTime end, const int maxRouteNumber, const bool tryRepair, - const bool withTaz, const bool keepRoutes, - const bool skipRouteCalculation, const std::string& file) + SUMOTime begin, SUMOTime end, const bool tryRepair, + const bool withTaz, const std::string& file) : ROTypedXMLRoutesLoader(net, begin, end, file), - myVehicleParameter(0), myCurrentIsOk(true), myAltIsValid(true), - myCurrentAlternatives(0), myMaxRouteNumber(maxRouteNumber), - myCurrentRoute(0), myTryRepair(tryRepair), myWithTaz(withTaz), myKeepRoutes(keepRoutes), - mySkipRouteCalculation(skipRouteCalculation), myColor(0), myCurrentVType(0), - myHaveWarnedAboutDeprecatedVType(false), myHaveWarnedAboutDeprecatedRoute(false) { + myVehicleParameter(0), myColor(0), myCurrentIsOk(true), + myAltIsValid(true), myCurrentAlternatives(0), myTryRepair(tryRepair), + myWithTaz(withTaz), myCurrentRoute(0), myCurrentVType(0) { } @@ -91,13 +88,8 @@ } myCurrentIsOk = myVehicleParameter != 0; break; - case SUMO_TAG_VTYPE__DEPRECATED: - if (!myHaveWarnedAboutDeprecatedVType) { - myHaveWarnedAboutDeprecatedVType = true; - WRITE_WARNING("'" + toString(SUMO_TAG_VTYPE__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_VTYPE) + "'."); - } case SUMO_TAG_VTYPE: - myCurrentVType = SUMOVehicleParserHelper::beginVTypeParsing(attrs); + myCurrentVType = SUMOVehicleParserHelper::beginVTypeParsing(attrs, getFileName()); break; case SUMO_TAG_ROUTE_DISTRIBUTION: myAltIsValid = true; @@ -110,7 +102,7 @@ break; } // parse embedded vtype information - if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE && element != SUMO_TAG_VTYPE__DEPRECATED) { + if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE) { SUMOVehicleParserHelper::parseVTypeEmbedded(*myCurrentVType, element, attrs); return; } @@ -155,17 +147,11 @@ } } if (attrs.hasAttribute(SUMO_ATTR_COLOR)) { - myColor = new RGBColor(RGBColor::parseColorReporting( - attrs.getString(SUMO_ATTR_COLOR), - attrs.getObjectType(), myCurrentRouteName.c_str(), true, myCurrentIsOk)); + myColor = new RGBColor(attrs.getColorReporting(myCurrentRouteName.c_str(), myCurrentIsOk)); } - if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { - myCharacters(SUMO_TAG_ROUTE, attrs.getStringReporting(SUMO_ATTR_EDGES, myCurrentRouteName.c_str(), myCurrentIsOk)); - } else { - if (!myHaveWarnedAboutDeprecatedRoute) { - WRITE_WARNING("Defining routes as a nested string is deprecated, use the edges attribute instead."); - myHaveWarnedAboutDeprecatedRoute = true; - } + std::string edges = attrs.getStringReporting(SUMO_ATTR_EDGES, myCurrentRouteName.c_str(), myCurrentIsOk); + if (myCurrentIsOk) { + parseRoute(edges); } } @@ -197,18 +183,12 @@ return; } // build the alternative cont - myCurrentAlternatives = new RORouteDef_Alternatives(id, index, - myMaxRouteNumber, myKeepRoutes, mySkipRouteCalculation); + myCurrentAlternatives = new RORouteDef(id, index, false); } + void -RORDLoader_SUMOBase::myCharacters(int element, - const std::string& chars) { - // process routes only, all other elements do - // not have embedded characters - if (element != SUMO_TAG_ROUTE) { - return; - } +RORDLoader_SUMOBase::parseRoute(const std::string& chars) { if (!myAltIsValid) { return; } @@ -220,7 +200,7 @@ return; } // build the list of edges - std::vector *list = new std::vector(); + std::vector* list = new std::vector(); if (myWithTaz && myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) { ROEdge* edge = myNet.getEdge(myVehicleParameter->fromTaz + "-source"); if (edge != 0) { @@ -230,17 +210,25 @@ myCurrentIsOk = false; } } - StringTokenizer st(chars); - while (myCurrentIsOk && st.hasNext()) { // !!! too slow !!! - const std::string id = st.next(); - ROEdge* edge = myNet.getEdge(id); - if (edge != 0) { - list->push_back(edge); - } else { - if (!myTryRepair) { - std::string rid = myCurrentAlternatives != 0 ? myCurrentAlternatives->getID() : myCurrentRouteName; - WRITE_ERROR("The route '" + rid + "' contains the unknown edge '" + id + "'."); - myCurrentIsOk = false; + if (chars[0] == BinaryFormatter::BF_ROUTE) { + std::istringstream in(chars, std::ios::binary); + char c; + in >> c; + std::string rid = myCurrentAlternatives != 0 ? myCurrentAlternatives->getID() : myCurrentRouteName; + FileHelpers::readEdgeVector(in, *list, rid); + } else { + StringTokenizer st(chars); + while (myCurrentIsOk && st.hasNext()) { // !!! too slow !!! + const std::string id = st.next(); + ROEdge* edge = myNet.getEdge(id); + if (edge != 0) { + list->push_back(edge); + } else { + if (!myTryRepair) { + std::string rid = myCurrentAlternatives != 0 ? myCurrentAlternatives->getID() : myCurrentRouteName; + WRITE_ERROR("The route '" + rid + "' contains the unknown edge '" + id + "'."); + myCurrentIsOk = false; + } } } } @@ -258,7 +246,8 @@ myCurrentAlternatives->addLoadedAlternative( new RORoute(myCurrentAlternatives->getID(), myCost, myProbability, *list, myColor)); } else { - myCurrentRoute = new RORouteDef_Complete(myCurrentRouteName, myColor, *list, myTryRepair); + myCurrentRoute = new RORouteDef(myCurrentRouteName, 0, myTryRepair); + myCurrentRoute->addLoadedAlternative(new RORoute(myCurrentRouteName, 0, 1, *list, myColor)); } myColor = 0; } @@ -301,7 +290,6 @@ myVehicleParameter = 0; myNextRouteRead = true; break; - case SUMO_TAG_VTYPE__DEPRECATED: case SUMO_TAG_VTYPE: { SUMOVehicleParserHelper::closeVTypeParsing(*myCurrentVType); myNet.addVehicleType(myCurrentVType); @@ -329,6 +317,8 @@ RORouteDef* route = myNet.getRouteDef(myVehicleParameter->routeid); if (route == 0) { route = myNet.getRouteDef("!" + myVehicleParameter->id); + } else { + route = route->copy("!" + myVehicleParameter->id); } if (route == 0) { WRITE_ERROR("The route of the vehicle '" + myVehicleParameter->id + "' is not known."); diff -Nru sumo-0.15.0~dfsg/src/router/RORDLoader_SUMOBase.h sumo-0.16.0~dfsg/src/router/RORDLoader_SUMOBase.h --- sumo-0.15.0~dfsg/src/router/RORDLoader_SUMOBase.h 2012-02-21 00:03:01.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORDLoader_SUMOBase.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORDLoader_SUMOBase.h 11931 2012-02-20 09:22:03Z behrisch $ +/// @version $Id: RORDLoader_SUMOBase.h 12607 2012-08-28 09:24:13Z dkrajzew $ /// // The base class for SUMO-native route handlers /****************************************************************************/ @@ -65,14 +65,12 @@ public ROTypedXMLRoutesLoader { public: /// Constructor - RORDLoader_SUMOBase(RONet& net, - SUMOTime begin, SUMOTime end, - const int maxRouteNumber, const bool tryRepair, const bool withTaz, - const bool keepRoutes, const bool skipRouteCalculation, + RORDLoader_SUMOBase(RONet& net, SUMOTime begin, SUMOTime end, + const bool tryRepair, const bool withTaz, const std::string& file = ""); /// Destructor - ~RORDLoader_SUMOBase() ; + ~RORDLoader_SUMOBase(); protected: @@ -87,18 +85,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; - - - /** @brief Called when characters occure - * - * @param[in] element ID of the last opened element - * @param[in] chars The read characters (complete) - * @exception ProcessError If something fails - * @see GenericSAXHandler::myCharacters - */ - void myCharacters(int element, - const std::string& chars) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -107,7 +94,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - virtual void myEndElement(int element) ; + virtual void myEndElement(int element); //@} /// Begins the parsing of the next route alternative in the file @@ -116,7 +103,15 @@ /// Begins the parsing of a route alternative of the opened route void startRoute(const SUMOSAXAttributes& attrs); - bool closeVehicle() ; + bool closeVehicle(); + + /** @brief Parses a route edge list + * + * @param[in] chars The read route + * @exception ProcessError If something fails + */ + void parseRoute(const std::string& chars); + protected: @@ -133,7 +128,7 @@ bool myAltIsValid; /// @brief The currently parsed route alternatives - RORouteDef_Alternatives* myCurrentAlternatives; + RORouteDef* myCurrentAlternatives; /// @brief The costs of the current alternative SUMOReal myCost; @@ -141,23 +136,14 @@ /// @brief The probability of the current alternative's usage SUMOReal myProbability; - /// @brief The maximum route alternatives number - int myMaxRouteNumber; - /// @brief Information whether a read route shall be tried to be repaired bool myTryRepair; /// @brief Information whether zones (districts) are used as origins / destinations const bool myWithTaz; - /// @brief Information whether all routes should be saved - const bool myKeepRoutes; - - /// @brief Information whether new routes should be calculated - const bool mySkipRouteCalculation; - /// @brief The currently parsed route - RORouteDef_Complete* myCurrentRoute; + RORouteDef* myCurrentRoute; /// @brief The name of the currently parsed route std::string myCurrentRouteName; @@ -165,8 +151,6 @@ /// @brief The currently parsed vehicle type SUMOVTypeParameter* myCurrentVType; - bool myHaveWarnedAboutDeprecatedVType; - bool myHaveWarnedAboutDeprecatedRoute; private: /// @brief Invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/router/RORDLoader_TripDefs.cpp sumo-0.16.0~dfsg/src/router/RORDLoader_TripDefs.cpp --- sumo-0.15.0~dfsg/src/router/RORDLoader_TripDefs.cpp 2012-02-18 00:03:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORDLoader_TripDefs.cpp 2012-10-22 23:02:37.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORDLoader_TripDefs.cpp 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: RORDLoader_TripDefs.cpp 12880 2012-10-22 14:15:33Z namdre $ /// // The basic class for loading trip definitions /****************************************************************************/ @@ -35,12 +35,11 @@ #include #include #include -#include "RORouteDef.h" +#include "RORoute.h" #include "RONet.h" -#include "RORouteDef_OrigDest.h" +#include "RORouteDef.h" #include "RORDLoader_TripDefs.h" #include "ROVehicle.h" -#include "RORouteDef_Complete.h" #include #ifdef CHECK_MEMORY_LEAKS @@ -58,7 +57,7 @@ : ROTypedXMLRoutesLoader(net, begin, end, fileName), myEmptyDestinationsAllowed(emptyDestinationsAllowed), myWithTaz(withTaz), myCurrentVehicleType(0), - myParameter(0), myHaveWarnedAboutDeprecatedTripDef(false) {} + myParameter(0) {} RORDLoader_TripDefs::~RORDLoader_TripDefs() {} @@ -67,12 +66,8 @@ void RORDLoader_TripDefs::myStartElement(int element, const SUMOSAXAttributes& attrs) { - if (element == SUMO_TAG_TRIP__DEPRECATED && !myHaveWarnedAboutDeprecatedTripDef) { - myHaveWarnedAboutDeprecatedTripDef = true; - WRITE_WARNING("'" + toString(SUMO_TAG_TRIP__DEPRECATED) + "' is deprecated; please use '" + toString(SUMO_TAG_TRIP) + "'."); - } // check whether a trip definition shall be parsed - if (element == SUMO_TAG_TRIP || element == SUMO_TAG_TRIP__DEPRECATED) { + if (element == SUMO_TAG_TRIP) { bool ok = true; // get the vehicle id, the edges, the speed and position and // the departure time and other information @@ -97,8 +92,8 @@ } } // check whether a vehicle type shall be parsed - if (element == SUMO_TAG_VTYPE || element == SUMO_TAG_VTYPE__DEPRECATED) { - myCurrentVehicleType = SUMOVehicleParserHelper::beginVTypeParsing(attrs); + if (element == SUMO_TAG_VTYPE) { + myCurrentVehicleType = SUMOVehicleParserHelper::beginVTypeParsing(attrs, getFileName()); } else if (myCurrentVehicleType != 0) { SUMOVehicleParserHelper::parseVTypeEmbedded(*myCurrentVehicleType, element, attrs); } @@ -143,15 +138,17 @@ void RORDLoader_TripDefs::myEndElement(int element) { - if ((element == SUMO_TAG_TRIP || element == SUMO_TAG_TRIP__DEPRECATED) && - !MsgHandler::getErrorInstance()->wasInformed()) { - + if (element == SUMO_TAG_TRIP && !MsgHandler::getErrorInstance()->wasInformed()) { if (myCurrentDepart < myBegin || myCurrentDepart >= myEnd) { delete myParameter; return; } RGBColor* col = myParameter->wasSet(VEHPARS_COLOR_SET) ? new RGBColor(myParameter->color) : 0; - RORouteDef* route = new RORouteDef_OrigDest(myParameter->id, col, myBeginEdge, myEndEdge); + RORouteDef* route = new RORouteDef(myParameter->id, 0, true); + std::vector edges; + edges.push_back(myBeginEdge); + edges.push_back(myEndEdge); + route->addLoadedAlternative(new RORoute(myParameter->id, 0, 1, edges, col)); SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(myParameter->vtypeid); // check whether any errors occured if (MsgHandler::getErrorInstance()->wasInformed()) { @@ -169,7 +166,7 @@ delete myParameter; myParameter = 0; } - if (element == SUMO_TAG_VTYPE || element == SUMO_TAG_VTYPE__DEPRECATED) { + if (element == SUMO_TAG_VTYPE) { SUMOVehicleParserHelper::closeVTypeParsing(*myCurrentVehicleType); myNet.addVehicleType(myCurrentVehicleType); myCurrentVehicleType = 0; diff -Nru sumo-0.15.0~dfsg/src/router/RORDLoader_TripDefs.h sumo-0.16.0~dfsg/src/router/RORDLoader_TripDefs.h --- sumo-0.15.0~dfsg/src/router/RORDLoader_TripDefs.h 2012-02-18 00:03:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORDLoader_TripDefs.h 2012-09-25 22:01:29.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORDLoader_TripDefs.h 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: RORDLoader_TripDefs.h 12581 2012-08-22 07:07:45Z dkrajzew $ /// // The basic class for loading trip definitions /****************************************************************************/ @@ -55,10 +55,10 @@ /// Constructor RORDLoader_TripDefs(RONet& net, SUMOTime begin, SUMOTime end, bool emptyDestinationsAllowed, bool withTaz, - const std::string& file = "") ; + const std::string& file = ""); /// Destructor - ~RORDLoader_TripDefs() ; + ~RORDLoader_TripDefs(); protected: @@ -73,7 +73,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -82,7 +82,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element) ; + void myEndElement(int element); //@} @@ -118,7 +118,6 @@ SUMOVehicleParameter* myParameter; - bool myHaveWarnedAboutDeprecatedTripDef; private: /// @brief Invalidated copy constructor diff -Nru sumo-0.15.0~dfsg/src/router/RORoute.cpp sumo-0.16.0~dfsg/src/router/RORoute.cpp --- sumo-0.15.0~dfsg/src/router/RORoute.cpp 2012-02-07 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORoute.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORoute.cpp 11836 2012-02-06 15:48:56Z behrisch $ +/// @version $Id: RORoute.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A complete router's route /****************************************************************************/ @@ -48,7 +48,7 @@ // method definitions // =========================================================================== RORoute::RORoute(const std::string& id, SUMOReal costs, SUMOReal prop, - const std::vector &route, + const std::vector& route, const RGBColor* const color) : Named(StringUtils::convertUmlaute(id)), myCosts(costs), myProbability(prop), myRoute(route), myColor(color) {} @@ -93,16 +93,11 @@ OutputDevice& -RORoute::writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const { - UNUSED_PARAMETER(router); - // (optional) alternatives header - if (asAlternatives) { - dev.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, 0).closeOpener(); - } - // the route +RORoute::writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, + const bool withCosts, + const bool withExitTimes) const { dev.openTag(SUMO_TAG_ROUTE); - if (asAlternatives) { + if (withCosts) { dev.writeAttr(SUMO_ATTR_COST, myCosts); dev.setPrecision(8); dev.writeAttr(SUMO_ATTR_PROB, myProbability); @@ -125,10 +120,6 @@ dev.writeAttr("exitTimes", exitTimes); } dev.closeTag(true); - // (optional) alternatives end - if (asAlternatives) { - dev.closeTag(); - } return dev; } diff -Nru sumo-0.15.0~dfsg/src/router/RORoute.h sumo-0.16.0~dfsg/src/router/RORoute.h --- sumo-0.15.0~dfsg/src/router/RORoute.h 2012-02-21 00:03:01.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORoute.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORoute.h 11931 2012-02-20 09:22:03Z behrisch $ +/// @version $Id: RORoute.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A complete router's route /****************************************************************************/ @@ -68,18 +68,18 @@ * @todo Are costs/prob really mandatory? */ RORoute(const std::string& id, SUMOReal costs, SUMOReal prob, - const std::vector &route, const RGBColor* const color) ; + const std::vector& route, const RGBColor* const color); /** @brief Copy constructor * * @param[in] src The route to copy */ - RORoute(const RORoute& src) ; + RORoute(const RORoute& src); /// @brief Destructor - ~RORoute() ; + ~RORoute(); /** @brief Adds an edge to the end of the route @@ -87,7 +87,7 @@ * @param[in] edge The edge to add * @todo What for? Isn't the route already complete? */ - void add(ROEdge* edge) ; + void add(ROEdge* edge); /** @brief Returns the first edge in the route @@ -132,14 +132,14 @@ * * @todo Recheck why the costs are stored in a route */ - void setCosts(SUMOReal costs) ; + void setCosts(SUMOReal costs); /** @brief Sets the probability of the route * * @todo Recheck why the probability is stored in a route */ - void setProbability(SUMOReal prob) ; + void setProbability(SUMOReal prob); /** @brief Returns the number of edges in this route @@ -155,7 +155,7 @@ * * @return The edges this route consists of */ - const std::vector &getEdgeVector() const { + const std::vector& getEdgeVector() const { return myRoute; } @@ -170,10 +170,11 @@ /** @brief Checks whether this route contains loops and removes such */ - void recheckForLoops() ; + void recheckForLoops(); OutputDevice& - writeXMLDefinition(SUMOAbstractRouter &router, OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const; + writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, + const bool withCosts, const bool withExitTimes) const; private: diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef.cpp sumo-0.16.0~dfsg/src/router/RORouteDef.cpp --- sumo-0.15.0~dfsg/src/router/RORouteDef.cpp 2012-02-03 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORouteDef.cpp 11826 2012-02-02 12:15:08Z namdre $ +/// @version $Id: RORouteDef.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Base class for a vehicle's route definition /****************************************************************************/ @@ -30,11 +30,14 @@ #endif #include +#include #include #include #include #include #include +#include +#include #include #include "ROEdge.h" #include "RORoute.h" @@ -42,6 +45,7 @@ #include "ReferencedItem.h" #include "RORouteDef.h" #include "ROVehicle.h" +#include "ROCostCalculator.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -51,36 +55,253 @@ // =========================================================================== // method definitions // =========================================================================== -RORouteDef::RORouteDef(const std::string& id, const RGBColor* const color) : - ReferencedItem(), - Named(StringUtils::convertUmlaute(id)), - myColor(color), - myPrecomputed(0) +RORouteDef::RORouteDef(const std::string& id, const unsigned int lastUsed, + const bool tryRepair) : + ReferencedItem(), Named(StringUtils::convertUmlaute(id)), + myPrecomputed(0), myLastUsed(lastUsed), myTryRepair(tryRepair) {} RORouteDef::~RORouteDef() { - delete myColor; + for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { + delete *i; + } } -const RGBColor* -RORouteDef::copyColorIfGiven() const { - if (myColor == 0) { - return 0; - } - return new RGBColor(*myColor); +void +RORouteDef::addLoadedAlternative(RORoute* alt) { + myAlternatives.push_back(alt); +} + + +void +RORouteDef::addAlternativeDef(const RORouteDef* alt) { + std::copy(alt->myAlternatives.begin(), alt->myAlternatives.end(), + back_inserter(myAlternatives)); } RORoute* -RORouteDef::buildCurrentRoute(SUMOAbstractRouter &router, - SUMOTime begin, const ROVehicle& veh) const { +RORouteDef::buildCurrentRoute(SUMOAbstractRouter& router, + SUMOTime begin, const ROVehicle& veh) const { if (myPrecomputed == 0) { preComputeCurrentRoute(router, begin, veh); } return myPrecomputed; } -/****************************************************************************/ +void +RORouteDef::preComputeCurrentRoute(SUMOAbstractRouter& router, + SUMOTime begin, const ROVehicle& veh) const { + myNewRoute = false; + if (myTryRepair) { + repairCurrentRoute(router, begin, veh); + return; + } + if (ROCostCalculator::getCalculator().skipRouteCalculation()) { + myPrecomputed = myAlternatives[myLastUsed]; + } else { + // build a new route to test whether it is better + std::vector edges; + router.compute(myAlternatives[0]->getFirst(), myAlternatives[0]->getLast(), &veh, begin, edges); + // check whether the same route was already used + int cheapest = -1; + for (unsigned int i = 0; i < myAlternatives.size(); i++) { + if (edges == myAlternatives[i]->getEdgeVector()) { + cheapest = i; + break; + } + } + if (cheapest >= 0) { + myPrecomputed = myAlternatives[cheapest]; + } else { + RGBColor* col = myAlternatives[0]->getColor() != 0 ? new RGBColor(*myAlternatives[0]->getColor()) : 0; + myPrecomputed = new RORoute(myID, 0, 1, edges, col); + myNewRoute = true; + } + } +} + + +void +RORouteDef::repairCurrentRoute(SUMOAbstractRouter& router, + SUMOTime begin, const ROVehicle& veh) const { + const std::vector& oldEdges = myAlternatives[0]->getEdgeVector(); + if (oldEdges.size() == 0) { + MsgHandler* m = OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance(); + m->inform("Could not repair empty route of vehicle '" + veh.getID() + "'."); + return; + } + std::vector newEdges; + newEdges.push_back(*(oldEdges.begin())); + for (std::vector::const_iterator i = oldEdges.begin() + 1; i != oldEdges.end(); ++i) { + if ((*(i - 1))->isConnectedTo(*i)) { + newEdges.push_back(*i); + } else { + std::vector edges; + router.compute(*(i - 1), *i, &veh, begin, edges); + if (edges.size() == 0) { + return; + } + std::copy(edges.begin() + 1, edges.end(), back_inserter(newEdges)); + } + } + if (myAlternatives[0]->getEdgeVector() != newEdges) { + WRITE_MESSAGE("Repaired route of vehicle '" + veh.getID() + "'."); + myNewRoute = true; + RGBColor* col = myAlternatives[0]->getColor() != 0 ? new RGBColor(*myAlternatives[0]->getColor()) : 0; + myPrecomputed = new RORoute(myID, 0, 1, newEdges, col); + } else { + myPrecomputed = myAlternatives[0]; + } +} + + +void +RORouteDef::addAlternative(SUMOAbstractRouter& router, + const ROVehicle* const veh, RORoute* current, SUMOTime begin) { + if (myTryRepair) { + if (myNewRoute) { + delete myAlternatives[0]; + myAlternatives.pop_back(); + myAlternatives.push_back(current); + } + const SUMOReal costs = router.recomputeCosts(current->getEdgeVector(), veh, begin); + if (costs < 0) { + throw ProcessError("Route '" + getID() + "' (vehicle '" + veh->getID() + "') is not valid."); + } + current->setCosts(costs); + return; + } + // add the route when it's new + if (myNewRoute) { + myAlternatives.push_back(current); + } + // recompute the costs and (when a new route was added) scale the probabilities + const SUMOReal scale = SUMOReal(myAlternatives.size() - 1) / SUMOReal(myAlternatives.size()); + for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { + RORoute* alt = *i; + // recompute the costs for all routes + const SUMOReal newCosts = router.recomputeCosts(alt->getEdgeVector(), veh, begin); + if (newCosts < 0.) { + throw ProcessError("Route '" + current->getID() + "' (vehicle '" + veh->getID() + "') is not valid."); + } + assert(myAlternatives.size() != 0); + if (myNewRoute) { + if (*i == current) { + // set initial probability and costs + alt->setProbability((SUMOReal)(1.0 / (SUMOReal) myAlternatives.size())); + alt->setCosts(newCosts); + } else { + // rescale probs for all others + alt->setProbability(alt->getProbability() * scale); + } + } + ROCostCalculator::getCalculator().setCosts(alt, newCosts, *i == myAlternatives[myLastUsed]); + } + assert(myAlternatives.size() != 0); + ROCostCalculator::getCalculator().calculateProbabilities(veh, myAlternatives); + if (!ROCostCalculator::getCalculator().keepRoutes()) { + // remove with probability of 0 (not mentioned in Gawron) + for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end();) { + if ((*i)->getProbability() == 0) { + delete *i; + i = myAlternatives.erase(i); + } else { + i++; + } + } + } + if (myAlternatives.size() > ROCostCalculator::getCalculator().getMaxRouteNumber()) { + // only keep the routes with highest probability + sort(myAlternatives.begin(), myAlternatives.end(), ComparatorProbability()); + for (std::vector::iterator i = myAlternatives.begin() + ROCostCalculator::getCalculator().getMaxRouteNumber(); i != myAlternatives.end(); i++) { + delete *i; + } + myAlternatives.erase(myAlternatives.begin() + ROCostCalculator::getCalculator().getMaxRouteNumber(), myAlternatives.end()); + // rescale probabilities + SUMOReal newSum = 0; + for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { + newSum += (*i)->getProbability(); + } + assert(newSum > 0); + // @note newSum may be larger than 1 for numerical reasons + for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { + (*i)->setProbability((*i)->getProbability() / newSum); + } + } + + // find the route to use + SUMOReal chosen = RandHelper::rand(); + int pos = 0; + for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end() - 1; i++, pos++) { + chosen -= (*i)->getProbability(); + if (chosen <= 0) { + myLastUsed = pos; + return; + } + } + myLastUsed = pos; +} + + +const ROEdge* +RORouteDef::getDestination() const { + return myAlternatives[0]->getLast(); +} + + +OutputDevice& +RORouteDef::writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, + bool asAlternatives, bool withExitTimes) const { + if (asAlternatives) { + dev.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, myLastUsed).closeOpener(); + for (size_t i = 0; i != myAlternatives.size(); i++) { + myAlternatives[i]->writeXMLDefinition(dev, veh, true, withExitTimes); + } + dev.closeTag(); + return dev; + } else { + return myAlternatives[myLastUsed]->writeXMLDefinition(dev, veh, false, withExitTimes); + } +} + + +RORouteDef* +RORouteDef::copyOrigDest(const std::string& id) const { + RORouteDef* result = new RORouteDef(id, 0, true); + RORoute* route = myAlternatives[0]; + RGBColor* col = route->getColor() != 0 ? new RGBColor(*route->getColor()) : 0; + std::vector edges; + edges.push_back(route->getFirst()); + edges.push_back(route->getLast()); + result->addLoadedAlternative(new RORoute(id, 0, 1, edges, col)); + return result; +} + + +RORouteDef* +RORouteDef::copy(const std::string& id) const { + RORouteDef* result = new RORouteDef(id, 0, myTryRepair); + for (std::vector::const_iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { + RORoute* route = *i; + RGBColor* col = route->getColor() != 0 ? new RGBColor(*route->getColor()) : 0; + result->addLoadedAlternative(new RORoute(id, 0, 1, route->getEdgeVector(), col)); + } + return result; +} + + +SUMOReal +RORouteDef::getOverallProb() const { + SUMOReal sum = 0.; + for (std::vector::const_iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { + sum += (*i)->getProbability(); + } + return sum; +} + + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef.h sumo-0.16.0~dfsg/src/router/RORouteDef.h --- sumo-0.15.0~dfsg/src/router/RORouteDef.h 2012-02-03 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RORouteDef.h 11826 2012-02-02 12:15:08Z namdre $ +/// @version $Id: RORouteDef.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Base class for a vehicle's route definition /****************************************************************************/ @@ -36,14 +36,13 @@ #include #include "ReferencedItem.h" #include -#include +#include "RORoute.h" // =========================================================================== // class declarations // =========================================================================== class ROEdge; -class RORoute; class OptionsCont; class ROVehicle; class OutputDevice; @@ -68,38 +67,43 @@ * @param[in] id The id of the route * @param[in] color The color of the route */ - RORouteDef(const std::string& id, const RGBColor* const color) ; + RORouteDef(const std::string& id, const unsigned int lastUsed, + const bool tryRepair); /// @brief Destructor - virtual ~RORouteDef() ; + virtual ~RORouteDef(); + /** @brief Adds a single alternative loaded from the file + An alternative may also be generated during DUA */ + void addLoadedAlternative(RORoute* alternative); + + /** @brief Adds an alternative loaded from the file */ + void addAlternativeDef(const RORouteDef* alternative); + /** @brief Triggers building of the complete route (via * preComputeCurrentRoute) or returns precomputed route */ - RORoute* buildCurrentRoute(SUMOAbstractRouter &router, SUMOTime begin, - const ROVehicle& veh) const; + RORoute* buildCurrentRoute(SUMOAbstractRouter& router, SUMOTime begin, + const ROVehicle& veh) const; + + /** @brief Builds the complete route + * (or chooses her from the list of alternatives, when existing) */ + void preComputeCurrentRoute(SUMOAbstractRouter& router, SUMOTime begin, + const ROVehicle& veh) const; /** @brief Builds the complete route * (or chooses her from the list of alternatives, when existing) */ - virtual void preComputeCurrentRoute(SUMOAbstractRouter &router, SUMOTime begin, - const ROVehicle& veh) const = 0; + void repairCurrentRoute(SUMOAbstractRouter& router, SUMOTime begin, + const ROVehicle& veh) const; /** @brief Adds an alternative to the list of routes * * (This may be the new route) */ - virtual void addAlternative(SUMOAbstractRouter &router, - const ROVehicle* const, RORoute* current, SUMOTime begin) = 0; - - /** @brief Returns a copy of the route definition */ - virtual RORouteDef* copy(const std::string& id) const = 0; + void addAlternative(SUMOAbstractRouter& router, + const ROVehicle* const, RORoute* current, SUMOTime begin); - /// Returns the color of the route - const RGBColor* getColor() const { - return myColor; - } - - virtual const ROEdge* getDestination() const = 0; + const ROEdge* getDestination() const; /** @brief Saves the built route / route alternatives * @@ -109,20 +113,55 @@ * @param[in] asAlternatives Whether the route shall be saved as route alternatives * @return The same device for further usage */ - virtual OutputDevice& writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, - bool asAlternatives, bool withExitTimes) const = 0; + OutputDevice& writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, + bool asAlternatives, bool withExitTimes) const; -protected: - const RGBColor* copyColorIfGiven() const ; + /** @brief Returns a origin-destination copy of the route definition. + * + * The resulting route definition contains only a single route with + * origin and destination edge copied from this one + * + * @param[in] id The id for the new route definition + * @return the new route definition + */ + RORouteDef* copyOrigDest(const std::string& id) const; -protected: - /// The color the route shall have - const RGBColor* const myColor; + /** @brief Returns a deep copy of the route definition. + * + * The resulting route definition contains copies of all + * routes contained in this one + * + * @param[in] id The id for the new route definition + * @return the new route definition + */ + RORouteDef* copy(const std::string& id) const; + /** @brief Returns the sum of the probablities of the contained routes */ + SUMOReal getOverallProb() const; + +protected: /// @brief precomputed route for out-of-order computation mutable RORoute* myPrecomputed; + /// @brief Index of the route used within the last step + mutable unsigned int myLastUsed; + + /// @brief The alternatives + std::vector myAlternatives; + + /// @brief Information whether a new route was generated + mutable bool myNewRoute; + + const bool myTryRepair; + +private: + /** Function-object for sorting routes from highest to lowest probability. */ + struct ComparatorProbability { + bool operator()(const RORoute* const a, const RORoute* const b) { + return a->getProbability() > b->getProbability(); + } + }; + private: /// @brief Invalidated copy constructor RORouteDef(const RORouteDef& src); diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef_Alternatives.cpp sumo-0.16.0~dfsg/src/router/RORouteDef_Alternatives.cpp --- sumo-0.15.0~dfsg/src/router/RORouteDef_Alternatives.cpp 2012-02-29 00:03:01.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef_Alternatives.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,266 +0,0 @@ -/****************************************************************************/ -/// @file RORouteDef_Alternatives.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: RORouteDef_Alternatives.cpp 11969 2012-02-28 14:07:28Z namdre $ -/// -// A route with alternative routes -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include "ROHelper.h" -#include "ROEdge.h" -#include "RORouteDef.h" -#include "ROVehicle.h" -#include "ROCostCalculator.h" -#include "RORouteDef_Alternatives.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -RORouteDef_Alternatives::RORouteDef_Alternatives(const std::string& id, - unsigned int lastUsed, - const int maxRoutes, const bool keepRoutes, const bool skipRouteCalculation) - : RORouteDef(id, 0), myLastUsed((int) lastUsed), - myMaxRouteNumber(maxRoutes), myKeepRoutes(keepRoutes), - mySkipRouteCalculation(skipRouteCalculation) { -} - - -RORouteDef_Alternatives::~RORouteDef_Alternatives() { - for (AlternativesVector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { - delete *i; - } -} - - -void -RORouteDef_Alternatives::addLoadedAlternative(RORoute* alt) { - myAlternatives.push_back(alt); -} - - -void -RORouteDef_Alternatives::preComputeCurrentRoute(SUMOAbstractRouter &router, - SUMOTime begin, const ROVehicle& veh) const { - if (mySkipRouteCalculation) { - myLastUsed = 0; - myNewRoute = false; - myPrecomputed = myAlternatives[myLastUsed]; - return; - } - // recompute duration of the last route used - // build a new route to test whether it is better - std::vector edges; - router.compute(myAlternatives[0]->getFirst(), myAlternatives[0]->getLast(), &veh, begin, edges); - RORoute* opt = new RORoute(myID, 0, 1, edges, copyColorIfGiven()); - const SUMOReal costs = router.recomputeCosts(edges, &veh, begin); - // check whether the same route was already used - myLastUsed = findRoute(opt); - myNewRoute = true; - // delete the route when it already existed - if (myLastUsed >= 0) { - delete opt; - myNewRoute = false; - myAlternatives[myLastUsed]->setCosts(costs); - myPrecomputed = myAlternatives[myLastUsed]; - return; - } - // return the built route - ROCostCalculator::getCalculator().setCosts(opt, costs, true); - myPrecomputed = opt; -} - - -int -RORouteDef_Alternatives::findRoute(RORoute* opt) const { - for (unsigned int i = 0; i < myAlternatives.size(); i++) { - if (opt->getEdgeVector() == myAlternatives[i]->getEdgeVector()) { - return (int) i; - } - } - return -1; -} - - -void -RORouteDef_Alternatives::addAlternative(SUMOAbstractRouter &router, - const ROVehicle* const veh, RORoute* current, SUMOTime begin) { - // add the route when it's new - if (myLastUsed < 0) { - myAlternatives.push_back(current); - myLastUsed = (int) myAlternatives.size() - 1; - } - // recompute the costs and (when a new route was added) the probabilities - for (AlternativesVector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { - RORoute* alt = *i; - // apply changes for old routes only - // (the costs for the current were computed already) - if ((*i) != current || !myNewRoute) { - // recompute the costs for old routes - const SUMOReal newCosts = router.recomputeCosts(alt->getEdgeVector(), veh, begin); - if (newCosts < 0.) { - throw ProcessError("Route '" + current->getID() + "' (vehicle '" + veh->getID() + "') is not valid."); - } - ROCostCalculator::getCalculator().setCosts(alt, newCosts); - } - assert(myAlternatives.size() != 0); - if (myNewRoute) { - if ((*i) != current) { - alt->setProbability( - alt->getProbability() - * SUMOReal(myAlternatives.size() - 1) - / SUMOReal(myAlternatives.size())); - } else { - alt->setProbability((SUMOReal)(1.0 / (SUMOReal) myAlternatives.size())); - } - } - } - assert(myAlternatives.size() != 0); - ROCostCalculator::getCalculator().calculateProbabilities(veh, myAlternatives); - if (!myKeepRoutes) { - // remove with probability of 0 (not mentioned in Gawron) - for (AlternativesVector::iterator i = myAlternatives.begin(); i != myAlternatives.end();) { - if ((*i)->getProbability() == 0) { - i = myAlternatives.erase(i); - } else { - i++; - } - } - } - if (myAlternatives.size() > (unsigned)myMaxRouteNumber) { - // only keep the routes with highest probability - sort(myAlternatives.begin(), myAlternatives.end(), ComparatorProbability()); - for (AlternativesVector::iterator i = myAlternatives.begin() + myMaxRouteNumber; i != myAlternatives.end(); i++) { - delete *i; - } - myAlternatives.erase(myAlternatives.begin() + myMaxRouteNumber, myAlternatives.end()); - // rescale probabilities - SUMOReal newSum = 0; - for (AlternativesVector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { - newSum += (*i)->getProbability(); - } - assert(newSum > 0); - // @note newSum may be larger than 1 for numerical reasons - for (AlternativesVector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { - (*i)->setProbability((*i)->getProbability() / newSum); - } - } - - // find the route to use - SUMOReal chosen = RandHelper::rand(); - int pos = 0; - for (AlternativesVector::iterator i = myAlternatives.begin(); i != myAlternatives.end() - 1; i++, pos++) { - chosen = chosen - (*i)->getProbability(); - if (chosen <= 0) { - myLastUsed = pos; - return; - } - } - myLastUsed = pos; -} - - -RORouteDef* -RORouteDef_Alternatives::copy(const std::string& id) const { - RORouteDef_Alternatives* ret = new RORouteDef_Alternatives(id, - myLastUsed, myMaxRouteNumber, myKeepRoutes, mySkipRouteCalculation); - for (std::vector::const_iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { - ret->addLoadedAlternative(new RORoute(*(*i))); - } - return ret; -} - - -void -RORouteDef_Alternatives::invalidateLast() { - myLastUsed = -1; -} - - -void -RORouteDef_Alternatives::removeLast() { - assert(myAlternatives.size() >= 2); - myAlternatives.erase(myAlternatives.end() - 1); - myLastUsed = (int) myAlternatives.size() - 1; - // !!! recompute probabilities -} - - -OutputDevice& -RORouteDef_Alternatives::writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, - bool asAlternatives, bool withExitTimes) const { - // (optional) alternatives header - if (asAlternatives) { - dev.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, myLastUsed).closeOpener(); - for (size_t i = 0; i != myAlternatives.size(); i++) { - const RORoute& alt = *(myAlternatives[i]); - dev.openTag(SUMO_TAG_ROUTE).writeAttr(SUMO_ATTR_COST, alt.getCosts()); - dev.setPrecision(8); - dev.writeAttr(SUMO_ATTR_PROB, alt.getProbability()); - dev.setPrecision(); - if (alt.getColor() != 0) { - dev.writeAttr(SUMO_ATTR_COLOR, *alt.getColor()); - } else if (myColor != 0) { - dev.writeAttr(SUMO_ATTR_COLOR, *myColor); - } - dev.writeAttr(SUMO_ATTR_EDGES, alt.getEdgeVector()); - if (withExitTimes) { - std::string exitTimes; - SUMOReal time = STEPS2TIME(veh->getDepartureTime()); - for (std::vector::const_iterator i = alt.getEdgeVector().begin(); i != alt.getEdgeVector().end(); ++i) { - if (i != alt.getEdgeVector().begin()) { - exitTimes += " "; - } - time += (*i)->getTravelTime(veh, time); - exitTimes += toString(time); - } - dev.writeAttr("exitTimes", exitTimes); - } - dev.closeTag(true); - } - dev.closeTag(); - return dev; - } else { - return myAlternatives[myLastUsed]->writeXMLDefinition(router, dev, veh, asAlternatives, withExitTimes); - } -} - - -const ROEdge* -RORouteDef_Alternatives::getDestination() const { - return myAlternatives[0]->getLast(); -} - - - -/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef_Alternatives.h sumo-0.16.0~dfsg/src/router/RORouteDef_Alternatives.h --- sumo-0.15.0~dfsg/src/router/RORouteDef_Alternatives.h 2012-02-21 00:03:01.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef_Alternatives.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/****************************************************************************/ -/// @file RORouteDef_Alternatives.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: RORouteDef_Alternatives.h 11931 2012-02-20 09:22:03Z behrisch $ -/// -// A route with alternative routes -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ -#ifndef RORouteDef_Alternatives_h -#define RORouteDef_Alternatives_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include "RORoute.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class ROEdge; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class RORouteDef_Alternatives - * @brief A route definition which has some alternatives, already. - */ -class RORouteDef_Alternatives : public RORouteDef { -public: - /// Constructor - RORouteDef_Alternatives(const std::string& id, unsigned int lastUsed, const int maxRoutes, - const bool keepRoutes, const bool skipRouteCalculation) ; - - /// Destructor - virtual ~RORouteDef_Alternatives() ; - - /** @brief Adds an alternative loaded from the file - An alternative may also be generated whicle DUA */ - virtual void addLoadedAlternative(RORoute* alternative); - - /// Build the next route - void preComputeCurrentRoute(SUMOAbstractRouter &router, SUMOTime begin, - const ROVehicle& veh) const; - - /// Adds a build alternative - void addAlternative(SUMOAbstractRouter &router, - const ROVehicle* const, RORoute* current, SUMOTime begin); - - /** @brief Returns a copy of the route definition */ - RORouteDef* copy(const std::string& id) const; - - void invalidateLast(); - - void removeLast(); - - virtual OutputDevice& writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, - bool asAlternatives, bool withExitTimes) const; - - /* @brief Returns destination of this route definition */ - const ROEdge* getDestination() const; - -private: - /// Searches for the route within the list of alternatives - int findRoute(RORoute* opt) const; - - /** Function-object for sorting routes from highest to lowest probability. */ - struct ComparatorProbability { - bool operator()(const RORoute* const a, const RORoute* const b) { - return a->getProbability() > b->getProbability(); - } - }; - -private: - /// @brief Information whether a new route was generated - mutable bool myNewRoute; - - /// @brief Index of the route used within the last step - mutable int myLastUsed; - - /// @brief Definition of the storage for alternatives - typedef std::vector AlternativesVector; - - /// @brief The alternatives - AlternativesVector myAlternatives; - - /// @brief The maximum route number - const int myMaxRouteNumber; - - /// @brief Information whether all routes should be saved - const bool myKeepRoutes; - - /// @brief Information whether new routes should be calculated - const bool mySkipRouteCalculation; - - -private: - /// @brief Invalidated copy constructor - RORouteDef_Alternatives(const RORouteDef_Alternatives& src); - - /// @brief Invalidated assignment operator - RORouteDef_Alternatives& operator=(const RORouteDef_Alternatives& src); - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef_Complete.cpp sumo-0.16.0~dfsg/src/router/RORouteDef_Complete.cpp --- sumo-0.15.0~dfsg/src/router/RORouteDef_Complete.cpp 2012-02-07 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef_Complete.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/****************************************************************************/ -/// @file RORouteDef_Complete.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: RORouteDef_Complete.cpp 11836 2012-02-06 15:48:56Z behrisch $ -/// -// A complete route definition (with all passed edges being known) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include "ROEdge.h" -#include "RORouteDef.h" -#include "RORoute.h" -#include -#include -#include -#include "RORouteDef_Complete.h" -#include "ROHelper.h" -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -RORouteDef_Complete::RORouteDef_Complete(const std::string& id, - const RGBColor* const color, - const std::vector &edges, - bool tryRepair) - : RORouteDef(id, color), myEdges(edges), myTryRepair(tryRepair) { -} - - -RORouteDef_Complete::~RORouteDef_Complete() {} - - -void -RORouteDef_Complete::preComputeCurrentRoute(SUMOAbstractRouter &router, - SUMOTime begin, const ROVehicle& veh) const { - if (myTryRepair) { - const std::vector &oldEdges = myEdges; - if (oldEdges.size() == 0) { - MsgHandler* m = OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance(); - m->inform("Could not repair empty route of vehicle '" + veh.getID() + "'."); - myPrecomputed = new RORoute(myID, 0, 1, std::vector(), copyColorIfGiven()); - return; - } - std::vector newEdges; - newEdges.push_back(*(oldEdges.begin())); - for (std::vector::const_iterator i = oldEdges.begin() + 1; i != oldEdges.end(); ++i) { - if ((*(i - 1))->isConnectedTo(*i)) { - newEdges.push_back(*i); - } else { - std::vector edges; - router.compute(*(i - 1), *i, &veh, begin, edges); - if (edges.size() == 0) { - return; - } - std::copy(edges.begin() + 1, edges.end(), back_inserter(newEdges)); - } - } - if (myEdges != newEdges) { - WRITE_WARNING("Repaired route of vehicle '" + veh.getID() + "'."); - } - myEdges = newEdges; - } - SUMOReal costs = router.recomputeCosts(myEdges, &veh, begin); - if (costs < 0) { - throw ProcessError("Route '" + getID() + "' (vehicle '" + veh.getID() + "') is not valid."); - } - myPrecomputed = new RORoute(myID, 0, 1, myEdges, copyColorIfGiven()); -} - - -void -RORouteDef_Complete::addAlternative(SUMOAbstractRouter &, - const ROVehicle* const, RORoute* current, SUMOTime begin) { - myStartTime = begin; - myEdges = current->getEdgeVector(); - delete current; -} - - -RORouteDef* -RORouteDef_Complete::copy(const std::string& id) const { - return new RORouteDef_Complete(id, copyColorIfGiven(), myEdges, myTryRepair); -} - - -OutputDevice& -RORouteDef_Complete::writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, - bool asAlternatives, bool withExitTimes) const { - // (optional) alternatives header - if (asAlternatives) { - dev.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, 0).closeOpener(); - } - // the route - dev.openTag(SUMO_TAG_ROUTE); - if (asAlternatives) { - dev.writeAttr(SUMO_ATTR_COST, router.recomputeCosts(myEdges, veh, veh->getDepartureTime())); - dev.writeAttr(SUMO_ATTR_PROB, 1.); - } - if (myColor != 0) { - dev.writeAttr(SUMO_ATTR_COLOR, *myColor); - } - dev.writeAttr(SUMO_ATTR_EDGES, myEdges); - if (withExitTimes) { - std::string exitTimes; - SUMOReal time = STEPS2TIME(veh->getDepartureTime()); - for (std::vector::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { - if (i != myEdges.begin()) { - exitTimes += " "; - } - time += (*i)->getTravelTime(veh, time); - exitTimes += toString(time); - } - dev.writeAttr("exitTimes", exitTimes); - } - dev.closeTag(true); - // (optional) alternatives end - if (asAlternatives) { - dev.closeTag(); - } - return dev; -} - - -const ROEdge* -RORouteDef_Complete::getDestination() const { - return myEdges.back(); -} - - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef_Complete.h sumo-0.16.0~dfsg/src/router/RORouteDef_Complete.h --- sumo-0.15.0~dfsg/src/router/RORouteDef_Complete.h 2012-02-03 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef_Complete.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/****************************************************************************/ -/// @file RORouteDef_Complete.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: RORouteDef_Complete.h 11826 2012-02-02 12:15:08Z namdre $ -/// -// A complete route definition (with all passed edges being known) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ -#ifndef RORouteDef_Complete_h -#define RORouteDef_Complete_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include "RORouteDef.h" -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class ROEdge; -class RORoute; -class ROVehicle; -class OutputDevice; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class RORouteDef_Complete - * @brief A complete route description containing all edges the driver will pass. - */ -class RORouteDef_Complete : - public RORouteDef { -public: - /// Constructor - RORouteDef_Complete(const std::string& id, const RGBColor* const color, - const std::vector &edges, - bool tryRepair) ; - - /// Destructor - virtual ~RORouteDef_Complete() ; - - /// Builds the route - void preComputeCurrentRoute(SUMOAbstractRouter &router, SUMOTime begin, - const ROVehicle& veh) const; - - /** @brief Adds an route alternative (see further comments) - * - * Here, as in most cases, the alternative is the route that was build - * as last and will stay the only route known */ - void addAlternative(SUMOAbstractRouter &router, - const ROVehicle* const, RORoute* current, SUMOTime begin); - - /** @brief Returns a copy of the route definition */ - RORouteDef* copy(const std::string& id) const; - - virtual OutputDevice& writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const; - - /* @brief Returns destination of this route definition */ - const ROEdge* getDestination() const; - -protected: - /// The list of edges the driver passes - mutable std::vector myEdges; - - /// The begin of the route - SUMOTime myStartTime; - - bool myTryRepair; - - -private: - /// @brief Invalidated copy constructor - RORouteDef_Complete(const RORouteDef_Complete& src); - - /// @brief Invalidated assignment operator - RORouteDef_Complete& operator=(const RORouteDef_Complete& src); - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef_OrigDest.cpp sumo-0.16.0~dfsg/src/router/RORouteDef_OrigDest.cpp --- sumo-0.15.0~dfsg/src/router/RORouteDef_OrigDest.cpp 2012-02-03 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef_OrigDest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -/****************************************************************************/ -/// @file RORouteDef_OrigDest.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: RORouteDef_OrigDest.cpp 11826 2012-02-02 12:15:08Z namdre $ -/// -// A route where only the origin and the destination edges are known -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include "ROEdge.h" -#include "RORouteDef.h" -#include "RORoute.h" -#include "RORouteDef_OrigDest.h" -#include -#include "ROVehicle.h" -#include "ROHelper.h" -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// member method definitions -// =========================================================================== -RORouteDef_OrigDest::RORouteDef_OrigDest(const std::string& id, - const RGBColor* const color, - const ROEdge* from, - const ROEdge* to, - bool removeFirst) - : RORouteDef(id, color), myFrom(from), myTo(to), myCurrent(0), - myRemoveFirst(removeFirst) {} - - -RORouteDef_OrigDest::~RORouteDef_OrigDest() { - delete myCurrent; -} - - -void -RORouteDef_OrigDest::preComputeCurrentRoute(SUMOAbstractRouter &router, - SUMOTime begin, const ROVehicle& veh) const { - std::vector edges; - router.compute(myFrom, myTo, &veh, begin, edges); - if (myRemoveFirst && edges.size() > 2) { - edges.erase(edges.begin()); - edges.erase(edges.end() - 1); - } - myPrecomputed = new RORoute(myID, 0, 1, edges, copyColorIfGiven()); -} - - -void -RORouteDef_OrigDest::addAlternative(SUMOAbstractRouter &router, - const ROVehicle* const veh, RORoute* current, SUMOTime begin) { - myCurrent = current; - myStartTime = begin; - current->setCosts(router.recomputeCosts(current->getEdgeVector(), veh, begin)); -} - - -RORouteDef* -RORouteDef_OrigDest::copy(const std::string& id) const { - return new RORouteDef_OrigDest(id, copyColorIfGiven(), myFrom, myTo, - myRemoveFirst); -} - - -OutputDevice& -RORouteDef_OrigDest::writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const { - return myCurrent->writeXMLDefinition(router, dev, veh, asAlternatives, withExitTimes); -} - - -const ROEdge* -RORouteDef_OrigDest::getDestination() const { - return myTo; -} - - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/router/RORouteDef_OrigDest.h sumo-0.16.0~dfsg/src/router/RORouteDef_OrigDest.h --- sumo-0.15.0~dfsg/src/router/RORouteDef_OrigDest.h 2012-02-03 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteDef_OrigDest.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/****************************************************************************/ -/// @file RORouteDef_OrigDest.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: RORouteDef_OrigDest.h 11826 2012-02-02 12:15:08Z namdre $ -/// -// A route where only the origin and the destination edges are known -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ -#ifndef RORouteDef_OrigDest_h -#define RORouteDef_OrigDest_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include "RORouteDef.h" -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class ROEdge; -class RORoute; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class RORouteDef_OrigDest - * A route definition where only the begin and the end edge are given. - */ -class RORouteDef_OrigDest - : public RORouteDef { -public: - /// Constructor - RORouteDef_OrigDest(const std::string& id, const RGBColor* const color, - const ROEdge* from, const ROEdge* to, bool removeFirst = false) ; - - /// Destructor - virtual ~RORouteDef_OrigDest() ; - - /// Builds the current route from the given information (perform routing, here) - void preComputeCurrentRoute(SUMOAbstractRouter &router, SUMOTime begin, - const ROVehicle& veh) const; - - /** @brief Adds the build route to the container - * - * Here, the currently new route is added */ - void addAlternative(SUMOAbstractRouter &router, - const ROVehicle* const, RORoute* current, SUMOTime begin); - - /** @brief Returns a copy of the route definition */ - RORouteDef* copy(const std::string& id) const; - - virtual OutputDevice& writeXMLDefinition(SUMOAbstractRouter &router, - OutputDevice& dev, const ROVehicle* const veh, bool asAlternatives, bool withExitTimes) const; - - - /* @brief Returns destination of this route definition */ - const ROEdge* getDestination() const; - -protected: - /// The origin and the destination edge of the route - const ROEdge* myFrom, *myTo; - - /// The complete route (after building) - RORoute* myCurrent; - - /// The begin of the trip - SUMOTime myStartTime; - - /** @brief Information whether the first edge shall be removed - */ - bool myRemoveFirst; - - -private: - /// @brief Invalidated copy constructor - RORouteDef_OrigDest(const RORouteDef_OrigDest& src); - - /// @brief Invalidated assignment operator - RORouteDef_OrigDest& operator=(const RORouteDef_OrigDest& src); - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/router/RORouteHandler.cpp sumo-0.16.0~dfsg/src/router/RORouteHandler.cpp --- sumo-0.15.0~dfsg/src/router/RORouteHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,509 @@ +/****************************************************************************/ +/// @file RORouteHandler.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @date Mon, 9 Jul 2001 +/// @version $Id: RORouteHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Parser and container for routes during their loading +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "RONet.h" +#include "RORouteHandler.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +RORouteHandler::RORouteHandler(RONet& net, const std::string& file, + const bool tryRepair) : + SUMORouteHandler(file), + myNet(net), + myActivePlan(0), + myTryRepair(tryRepair), + myCurrentVTypeDistribution(0), + myCurrentAlternatives(0) { + myActiveRoute.reserve(100); +} + + +RORouteHandler::~RORouteHandler() { +} + + +void +RORouteHandler::myStartElement(int element, + const SUMOSAXAttributes& attrs) { + SUMORouteHandler::myStartElement(element, attrs); + switch (element) { + case SUMO_TAG_PERSON: + myActivePlan = new OutputDevice_String(false, 1); + break; + case SUMO_TAG_RIDE: { + myActivePlan->openTag(SUMO_TAG_RIDE); + (*myActivePlan) << attrs; + myActivePlan->closeTag(true); + break; + } + case SUMO_TAG_WALK: { + myActivePlan->openTag(SUMO_TAG_WALK); + (*myActivePlan) << attrs; + myActivePlan->closeTag(true); + break; + } + case SUMO_TAG_FLOW: + if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { + myActiveRouteID = "!" + myVehicleParameter->id; + bool ok = true; + parseEdges(attrs.getStringReporting(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok), + myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); + parseEdges(attrs.getStringReporting(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok), + myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); + closeRoute(); + } + break; + case SUMO_TAG_TRIP: { + bool ok = true; + if (attrs.hasAttribute(SUMO_ATTR_FROM) || !myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) { + parseEdges(attrs.getStringReporting(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok), + myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); + parseEdges(attrs.getStringReporting(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok), + myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); + } else { + const ROEdge* fromTaz = myNet.getEdge(myVehicleParameter->fromTaz + "-source"); + if (fromTaz == 0) { + WRITE_ERROR("Source district '" + myVehicleParameter->fromTaz + "' not known for '" + myVehicleParameter->id + "'!"); + } else if (fromTaz->getNoFollowing() == 0) { + WRITE_ERROR("Source district '" + myVehicleParameter->fromTaz + "' has no outgoing edges for '" + myVehicleParameter->id + "'!"); + } else { + myActiveRoute.push_back(fromTaz->getFollower(0)); + } + } + closeRoute(); + closeVehicle(); + } + break; + default: + break; + } + // parse embedded vtype information + if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE) { + SUMOVehicleParserHelper::parseVTypeEmbedded(*myCurrentVType, element, attrs); + return; + } +} + + +void +RORouteHandler::openVehicleTypeDistribution(const SUMOSAXAttributes& attrs) { + bool ok = true; + myCurrentVTypeDistributionID = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); + if (ok) { + myCurrentVTypeDistribution = new RandomDistributor(); + if (attrs.hasAttribute(SUMO_ATTR_VTYPES)) { + const std::string vTypes = attrs.getStringReporting(SUMO_ATTR_VTYPES, myCurrentVTypeDistributionID.c_str(), ok); + StringTokenizer st(vTypes); + while (st.hasNext()) { + SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(st.next()); + myCurrentVTypeDistribution->add(1., type); + } + } + } +} + + +void +RORouteHandler::closeVehicleTypeDistribution() { + if (myCurrentVTypeDistribution != 0) { + if (myCurrentVTypeDistribution->getOverallProb() == 0) { + delete myCurrentVTypeDistribution; + WRITE_ERROR("Vehicle type distribution '" + myCurrentVTypeDistributionID + "' is empty."); + } else if (!myNet.addVTypeDistribution(myCurrentVTypeDistributionID, myCurrentVTypeDistribution)) { + delete myCurrentVTypeDistribution; + WRITE_ERROR("Another vehicle type (or distribution) with the id '" + myCurrentVTypeDistributionID + "' exists."); + } + myCurrentVTypeDistribution = 0; + } +} + + +void +RORouteHandler::openRoute(const SUMOSAXAttributes& attrs) { + // check whether the id is really necessary + std::string rid; + if (myCurrentAlternatives != 0) { + myActiveRouteID = myCurrentAlternatives->getID(); + rid = "distribution '" + myCurrentAlternatives->getID() + "'"; + } else if (myVehicleParameter != 0) { + // ok, a vehicle is wrapping the route, + // we may use this vehicle's id as default + myActiveRouteID = "!" + myVehicleParameter->id; // !!! document this + if (attrs.hasAttribute(SUMO_ATTR_ID)) { + WRITE_WARNING("Ids of internal routes are ignored (vehicle '" + myVehicleParameter->id + "')."); + } + } else { + bool ok = true; + myActiveRouteID = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok, false); + if (!ok) { + return; + } + rid = "'" + myActiveRouteID + "'"; + } + if (myVehicleParameter != 0) { // have to do this here for nested route distributions + rid = "for vehicle '" + myVehicleParameter->id + "'"; + } + bool ok = true; + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + parseEdges(attrs.getStringReporting(SUMO_ATTR_EDGES, myActiveRouteID.c_str(), ok), myActiveRoute, rid); + } + myActiveRouteRefID = attrs.getOptStringReporting(SUMO_ATTR_REFID, myActiveRouteID.c_str(), ok, ""); + if (myActiveRouteRefID != "" && myNet.getRouteDef(myActiveRouteRefID) == 0) { + WRITE_ERROR("Invalid reference to route '" + myActiveRouteRefID + "' in route " + rid + "."); + } + myActiveRouteProbability = attrs.getOptSUMORealReporting(SUMO_ATTR_PROB, myActiveRouteID.c_str(), ok, DEFAULT_VEH_PROB); + myActiveRouteColor = attrs.hasAttribute(SUMO_ATTR_COLOR) ? new RGBColor(attrs.getColorReporting(myActiveRouteID.c_str(), ok)) : 0; +} + + +void +RORouteHandler::myEndElement(int element) { + SUMORouteHandler::myEndElement(element); + switch (element) { + case SUMO_TAG_VTYPE: { + if (myNet.addVehicleType(myCurrentVType)) { + if (myCurrentVTypeDistribution != 0) { + myCurrentVTypeDistribution->add(myCurrentVType->defaultProbability, myCurrentVType); + } + } + myCurrentVType = 0; + } + break; + default: + break; + } +} + + +void +RORouteHandler::closeRoute() { + if (myActiveRoute.size() == 0) { + if (myActiveRouteRefID != "" && myCurrentAlternatives != 0) { + myCurrentAlternatives->addAlternativeDef(myNet.getRouteDef(myActiveRouteRefID)); + myActiveRouteID = ""; + myActiveRouteRefID = ""; + return; + } + if (myVehicleParameter != 0) { + throw ProcessError("Vehicle's '" + myVehicleParameter->id + "' route has no edges."); + } else { + throw ProcessError("Route '" + myActiveRouteID + "' has no edges."); + } + } + RORoute* route = new RORoute(myActiveRouteID, myCurrentCosts, myActiveRouteProbability, myActiveRoute, + myActiveRouteColor); + myActiveRoute.clear(); + if (myCurrentAlternatives == 0) { + if (myNet.getRouteDef(myActiveRouteID) != 0) { + delete route; + if (myVehicleParameter != 0) { + throw ProcessError("Another route for vehicle '" + myVehicleParameter->id + "' exists."); + } else { + throw ProcessError("Another route (or distribution) with the id '" + myActiveRouteID + "' exists."); + } + } else { + myCurrentAlternatives = new RORouteDef(myActiveRouteID, 0, myTryRepair); + myCurrentAlternatives->addLoadedAlternative(route); + myNet.addRouteDef(myCurrentAlternatives); + myCurrentAlternatives = 0; + } + } else { + myCurrentAlternatives->addLoadedAlternative(route); + } + myActiveRouteID = ""; + myActiveRouteStops.clear(); +} + + +void +RORouteHandler::openRouteDistribution(const SUMOSAXAttributes& attrs) { + // check whether the id is really necessary + bool ok = true; + std::string id; + if (myVehicleParameter != 0) { + // ok, a vehicle is wrapping the route, + // we may use this vehicle's id as default + id = "!" + myVehicleParameter->id; // !!! document this + } else { + id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); + if (!ok) { + return; + } + } + // try to get the index of the last element + int index = attrs.getIntReporting(SUMO_ATTR_LAST, id.c_str(), ok); + if (ok && index < 0) { + WRITE_ERROR("Negative index of a route alternative (id='" + id + "')."); + return; + } + // build the alternative cont + myCurrentAlternatives = new RORouteDef(id, index, false); + if (attrs.hasAttribute(SUMO_ATTR_ROUTES)) { + ok = true; + StringTokenizer st(attrs.getStringReporting(SUMO_ATTR_ROUTES, id.c_str(), ok)); + while (st.hasNext()) { + const std::string routeID = st.next(); + const RORouteDef* route = myNet.getRouteDef(routeID); + if (route == 0) { + throw ProcessError("Unknown route '" + routeID + "' in distribution '" + id + "'."); + } + myCurrentAlternatives->addAlternativeDef(route); + } + } +} + + +void +RORouteHandler::closeRouteDistribution() { + if (myCurrentAlternatives != 0) { + if (myCurrentAlternatives->getOverallProb() == 0) { + WRITE_ERROR("Route distribution '" + myCurrentAlternatives->getID() + "' is empty."); + delete myCurrentAlternatives; + } else if (!myNet.addRouteDef(myCurrentAlternatives)) { + WRITE_ERROR("Another route (or distribution) with the id '" + myCurrentAlternatives->getID() + "' exists."); + delete myCurrentAlternatives; + } + myCurrentAlternatives = 0; + } +} + + +void +RORouteHandler::closeVehicle() { + // get the vehicle id + if (myVehicleParameter->depart < string2time(OptionsCont::getOptions().getString("begin"))) { + return; + } + // get vehicle type + SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(myVehicleParameter->vtypeid); + // get the route + RORouteDef* route = myNet.getRouteDef(myVehicleParameter->routeid); + if (route == 0) { + route = myNet.getRouteDef("!" + myVehicleParameter->id); + } + if (route == 0) { + WRITE_ERROR("The route of the vehicle '" + myVehicleParameter->id + "' is not known."); + return; + } + // build the vehicle + if (!MsgHandler::getErrorInstance()->wasInformed()) { + ROVehicle* veh = new ROVehicle(*myVehicleParameter, route, type); + myNet.addVehicle(myVehicleParameter->id, veh); + } +} + + +void +RORouteHandler::closePerson() { + myPersonBuffer[myVehicleParameter->depart] = myActivePlan->getString(); + delete myVehicleParameter; + myVehicleParameter = 0; + delete myActivePlan; + myActivePlan = 0; +} + + +void +RORouteHandler::closeFlow() { + /* // @todo: consider myScale? + // let's check whether vehicles had to depart before the simulation starts + myVehicleParameter->repetitionsDone = 0; + SUMOTime offsetToBegin = string2time(OptionsCont::getOptions().getString("begin")) - myVehicleParameter->depart; + while (myVehicleParameter->repetitionsDone * myVehicleParameter->repetitionOffset < offsetToBegin) { + myVehicleParameter->repetitionsDone++; + if (myVehicleParameter->repetitionsDone == myVehicleParameter->repetitionNumber) { + return; + } + } + if (MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid) == 0) { + throw ProcessError("The vehicle type '" + myVehicleParameter->vtypeid + "' for vehicle '" + myVehicleParameter->id + "' is not known."); + } + if (MSRoute::dictionary("!" + myVehicleParameter->id) == 0) { + // if not, try via the (hopefully) given route-id + if (MSRoute::dictionary(myVehicleParameter->routeid) == 0) { + if (myVehicleParameter->routeid != "") { + throw ProcessError("The route '" + myVehicleParameter->routeid + "' for vehicle '" + myVehicleParameter->id + "' is not known."); + } else { + throw ProcessError("Vehicle '" + myVehicleParameter->id + "' has no route."); + } + } + } else { + myVehicleParameter->routeid = "!" + myVehicleParameter->id; + } + myActiveRouteID = ""; + + // check whether the vehicle shall be added directly to the network or + // shall stay in the internal buffer + if (myAddVehiclesDirectly || checkLastDepart()) { + MSNet::getInstance()->getInsertionControl().add(myVehicleParameter); + registerLastDepart(); + } + myVehicleParameter = 0;*/ +} + + +void +RORouteHandler::addStop(const SUMOSAXAttributes& attrs) { + /*bool ok = true; + std::string errorSuffix; + if (myActiveRouteID != "") { + errorSuffix = " in route '" + myActiveRouteID + "'."; + } else if (myActivePlan) { + errorSuffix = " in person '" + myVehicleParameter->id + "'."; + } else { + errorSuffix = " in vehicle '" + myVehicleParameter->id + "'."; + } + SUMOVehicleParameter::Stop stop; + // try to parse the assigned bus stop + stop.busstop = attrs.getOptStringReporting(SUMO_ATTR_BUS_STOP, 0, ok, ""); + if (stop.busstop != "") { + // ok, we have obviously a bus stop + MSBusStop* bs = MSNet::getInstance()->getBusStop(stop.busstop); + if (bs != 0) { + const MSLane& l = bs->getLane(); + stop.lane = l.getID(); + stop.endPos = bs->getEndLanePosition(); + stop.startPos = bs->getBeginLanePosition(); + } else { + WRITE_ERROR("The bus stop '" + stop.busstop + "' is not known" + errorSuffix); + return; + } + } else { + // no, the lane and the position should be given + // get the lane + stop.lane = attrs.getOptStringReporting(SUMO_ATTR_LANE, 0, ok, ""); + if (ok && stop.lane != "") { + if (MSLane::dictionary(stop.lane) == 0) { + WRITE_ERROR("The lane '" + stop.lane + "' for a stop is not known" + errorSuffix); + return; + } + } else { + WRITE_ERROR("A stop must be placed on a bus stop or a lane" + errorSuffix); + return; + } + if (myActivePlan && + !myActivePlan->empty() && + &myActivePlan->back()->getDestination() != &MSLane::dictionary(stop.lane)->getEdge()) { + throw ProcessError("Disconnected plan for person '" + myVehicleParameter->id + "' (" + MSLane::dictionary(stop.lane)->getEdge().getID() + "!=" + myActivePlan->back()->getDestination().getID() + ")."); + } + stop.endPos = attrs.getOptSUMORealReporting(SUMO_ATTR_ENDPOS, 0, ok, MSLane::dictionary(stop.lane)->getLength()); + if (attrs.hasAttribute(SUMO_ATTR_POSITION)) { + WRITE_WARNING("eprecated attribute 'pos' in description of stop" + errorSuffix); + stop.endPos = attrs.getOptSUMORealReporting(SUMO_ATTR_POSITION, 0, ok, stop.endPos); + } + stop.startPos = attrs.getOptSUMORealReporting(SUMO_ATTR_STARTPOS, 0, ok, stop.endPos - 2 * POSITION_EPS); + const bool friendlyPos = attrs.getOptBoolReporting(SUMO_ATTR_FRIENDLY_POS, 0, ok, false); + if (!ok || !checkStopPos(stop.startPos, stop.endPos, MSLane::dictionary(stop.lane)->getLength(), POSITION_EPS, friendlyPos)) { + WRITE_ERROR("Invalid start or end position for stop" + errorSuffix); + return; + } + } + + // get the standing duration + if (!attrs.hasAttribute(SUMO_ATTR_DURATION) && !attrs.hasAttribute(SUMO_ATTR_UNTIL)) { + stop.triggered = attrs.getOptBoolReporting(SUMO_ATTR_TRIGGERED, 0, ok, true); + stop.duration = -1; + stop.until = -1; + } else { + stop.duration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_DURATION, 0, ok, -1); + stop.until = attrs.getOptSUMOTimeReporting(SUMO_ATTR_UNTIL, 0, ok, -1); + if (!ok || (stop.duration < 0 && stop.until < 0)) { + WRITE_ERROR("Invalid duration or end time is given for a stop" + errorSuffix); + return; + } + stop.triggered = attrs.getOptBoolReporting(SUMO_ATTR_TRIGGERED, 0, ok, false); + } + stop.parking = attrs.getOptBoolReporting(SUMO_ATTR_PARKING, 0, ok, stop.triggered); + if (!ok) { + WRITE_ERROR("Invalid bool for 'triggered' or 'parking' for stop" + errorSuffix); + return; + } + const std::string idx = attrs.getOptStringReporting(SUMO_ATTR_INDEX, 0, ok, "end"); + if (idx == "end") { + stop.index = STOP_INDEX_END; + } else if (idx == "fit") { + stop.index = STOP_INDEX_FIT; + } else { + stop.index = attrs.getIntReporting(SUMO_ATTR_INDEX, 0, ok); + if (!ok || stop.index < 0) { + WRITE_ERROR("Invalid 'index' for stop" + errorSuffix); + return; + } + } + if (myActiveRouteID != "") { + myActiveRouteStops.push_back(stop); + } else if (myActivePlan) { + myActivePlan->push_back(new MSPerson::MSPersonStage_Waiting(MSLane::dictionary(stop.lane)->getEdge(), stop.duration, stop.until)); + } else { + myVehicleParameter->stops.push_back(stop); + }*/ +} + + +void +RORouteHandler::parseEdges(const std::string& desc, std::vector& into, + const std::string& rid) { + StringTokenizer st(desc); + while (st.hasNext()) { + const std::string id = st.next(); + const ROEdge* edge = myNet.getEdge(id); + // check whether the edge exists + if (edge == 0) { + throw ProcessError("The edge '" + id + "' within the route " + rid + " is not known." + + "\n The route can not be build."); + } + into.push_back(edge); + } +} + + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/router/RORouteHandler.h sumo-0.16.0~dfsg/src/router/RORouteHandler.h --- sumo-0.15.0~dfsg/src/router/RORouteHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/RORouteHandler.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,176 @@ +/****************************************************************************/ +/// @file RORouteHandler.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Mon, 9 Jul 2001 +/// @version $Id: RORouteHandler.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Parser and container for routes during their loading +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef RORouteHandler_h +#define RORouteHandler_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice_String; +class ROEdge; +class RONet; +class RORoute; +class RORouteDef; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class RORouteHandler + * @brief Parser and container for routes during their loading + * + * RORouteHandler is the container for routes while they are build until + * their transfering to the MSNet::RouteDict + * The result of the operations are single MSNet::Route-instances + */ +class RORouteHandler : public SUMORouteHandler { +public: + /// standard constructor + RORouteHandler(RONet& net, const std::string& file, + const bool tryRepair); + + /// standard destructor + virtual ~RORouteHandler(); + +protected: + /// @name inherited from GenericSAXHandler + //@{ + + /** @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 + */ + virtual 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 + */ + virtual void myEndElement(int element); + //@} + + + /** opens a type distribution for reading */ + void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs); + + /** closes (ends) the building of a distribution */ + void closeVehicleTypeDistribution(); + + /** opens a route for reading */ + void openRoute(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(); + + /** opens a route distribution for reading */ + void openRouteDistribution(const SUMOSAXAttributes& attrs); + + /** closes (ends) the building of a distribution */ + void closeRouteDistribution(); + + /// Ends the processing of a vehicle + void closeVehicle(); + + /// Ends the processing of a person + void closePerson(); + + /// Ends the processing of a flow + void closeFlow(); + + /// Processing of a stop + void addStop(const SUMOSAXAttributes& attrs); + + /// Parse edges from strings + void parseEdges(const std::string& desc, std::vector& into, + const std::string& rid); + +protected: + /// @brief The current route + RONet& myNet; + + /// @brief The current route + std::vector myActiveRoute; + + /// @brief The plan of the current person + OutputDevice_String* myActivePlan; + + /// @brief Buffered person descriptions (with plans) + std::map myPersonBuffer; + + /// @brief Information whether routes shall be repaired + const bool myTryRepair; + + /// @brief The currently parsed distribution of vehicle types (probability->vehicle type) + RandomDistributor* myCurrentVTypeDistribution; + + /// @brief The id of the currently parsed vehicle type distribution + std::string myCurrentVTypeDistributionID; + + /// @brief The currently parsed route alternatives + RORouteDef* myCurrentAlternatives; + + /// @brief The currently parsed route costs + SUMOReal myCurrentCosts; + +private: + /// @brief Invalidated copy constructor + RORouteHandler(const RORouteHandler& s); + + /// @brief Invalidated assignment operator + RORouteHandler& operator=(const RORouteHandler& s); + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/router/ROTypedXMLRoutesLoader.cpp sumo-0.16.0~dfsg/src/router/ROTypedXMLRoutesLoader.cpp --- sumo-0.15.0~dfsg/src/router/ROTypedXMLRoutesLoader.cpp 2012-02-18 00:03:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROTypedXMLRoutesLoader.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROTypedXMLRoutesLoader.cpp 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: ROTypedXMLRoutesLoader.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Base class for loading routes from XML-files /****************************************************************************/ @@ -48,14 +48,14 @@ // method definitions // =========================================================================== ROTypedXMLRoutesLoader::ROTypedXMLRoutesLoader(RONet& net, - SUMOTime begin, - SUMOTime end, + SUMOTime begin, SUMOTime end, const std::string& file) - : myNet(net), myBegin(begin), myEnd(end), SUMOSAXHandler(file), - myParser(0), myToken(), myEnded(false), myCurrentDepart(-1), myNextRouteRead(false) { + : SUMOSAXHandler(file), myNet(net), myBegin(begin), myEnd(end), + myParser(0), myCurrentDepart(-1), myNextRouteRead(false), + myEnded(false) { try { myParser = XMLSubSys::getSAXReader(*this); - myParser->parseFirst(getFileName().c_str(), myToken); + myParser->parseFirst(getFileName()); } catch (...) { throw ProcessError(); } @@ -72,7 +72,7 @@ while (getLastReadTimeStep() < time && !ended()) { myNextRouteRead = false; while (!myNextRouteRead && !ended()) { - myParser->parseNext(myToken); + myEnded = !myParser->parseNext(); } } return true; @@ -85,7 +85,4 @@ } - - /****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/router/ROTypedXMLRoutesLoader.h sumo-0.16.0~dfsg/src/router/ROTypedXMLRoutesLoader.h --- sumo-0.15.0~dfsg/src/router/ROTypedXMLRoutesLoader.h 2012-02-18 00:03:28.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROTypedXMLRoutesLoader.h 2012-11-05 00:02:22.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROTypedXMLRoutesLoader.h 11929 2012-02-17 18:46:11Z behrisch $ +/// @version $Id: ROTypedXMLRoutesLoader.h 12927 2012-11-04 06:47:13Z behrisch $ /// // Base class for loading routes from XML-files /****************************************************************************/ @@ -32,9 +32,8 @@ #endif #include -#include -#include #include +#include // =========================================================================== @@ -69,11 +68,11 @@ * @exception ProcessError If an error occured during initialisation of parsing the xml-file */ ROTypedXMLRoutesLoader(RONet& net, - SUMOTime begin, SUMOTime end, const std::string& file = "") ; + SUMOTime begin, SUMOTime end, const std::string& file = ""); /// @brief Destructor - virtual ~ROTypedXMLRoutesLoader() ; + virtual ~ROTypedXMLRoutesLoader(); /** @brief Adds routes from the file until the given time is reached @@ -122,10 +121,7 @@ SUMOTime myEnd; /// @brief The parser used - SAX2XMLReader* myParser; - - /// @brief Information about the current position within the file - XMLPScanToken myToken; + SUMOSAXReader* myParser; /// @brief The currently read vehicle's depart SUMOTime myCurrentDepart; diff -Nru sumo-0.15.0~dfsg/src/router/ROVehicle.cpp sumo-0.16.0~dfsg/src/router/ROVehicle.cpp --- sumo-0.15.0~dfsg/src/router/ROVehicle.cpp 2012-01-28 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROVehicle.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROVehicle.cpp 11803 2012-01-27 14:02:03Z namdre $ +/// @version $Id: ROVehicle.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A vehicle as used by router /****************************************************************************/ @@ -40,7 +40,6 @@ #include #include "RORouteDef.h" #include "ROVehicle.h" -#include "RORouteDef_Alternatives.h" #include "RORoute.h" #include "ROHelper.h" @@ -53,7 +52,7 @@ // method definitions // =========================================================================== ROVehicle::ROVehicle(const SUMOVehicleParameter& pars, - RORouteDef* route, SUMOVTypeParameter* type) + RORouteDef* route, const SUMOVTypeParameter* type) : myParameter(pars), myType(type), myRoute(route) {} @@ -61,19 +60,19 @@ void -ROVehicle::saveAllAsXML(SUMOAbstractRouter &router, OutputDevice& os, - OutputDevice* const altos, OutputDevice* const typeos, bool withExitTimes) const { +ROVehicle::saveAllAsXML(OutputDevice& os, OutputDevice* const altos, + OutputDevice* const typeos, bool withExitTimes) const { // check whether the vehicle's type was saved before if (myType != 0 && !myType->saved) { // ... save if not - if (typeos != 0) { - myType->write(*typeos); - } else { - myType->write(os); - if (altos != 0) { - myType->write(*altos); - } - } + if (typeos != 0) { + myType->write(*typeos); + } else { + myType->write(os); + if (altos != 0) { + myType->write(*altos); + } + } myType->saved = true; } @@ -85,9 +84,9 @@ // check whether the route shall be saved if (!myRoute->isSaved()) { - myRoute->writeXMLDefinition(router, os, this, false, withExitTimes); + myRoute->writeXMLDefinition(os, this, false, withExitTimes); if (altos != 0) { - myRoute->writeXMLDefinition(router, *altos, this, true, withExitTimes); + myRoute->writeXMLDefinition(*altos, this, true, withExitTimes); } } os.closeTag(); @@ -97,7 +96,7 @@ } -SUMOReal +SUMOReal ROVehicle::getMaxSpeed() const { return myType->maxSpeed; } @@ -105,7 +104,7 @@ ROVehicle* ROVehicle::copy(const std::string& id, unsigned int depTime, - RORouteDef* newRoute) { + RORouteDef* newRoute) const { SUMOVehicleParameter pars(myParameter); pars.id = id; pars.depart = depTime; diff -Nru sumo-0.15.0~dfsg/src/router/ROVehicle.h sumo-0.16.0~dfsg/src/router/ROVehicle.h --- sumo-0.15.0~dfsg/src/router/ROVehicle.h 2012-03-09 00:03:06.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROVehicle.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROVehicle.h 12041 2012-03-08 08:55:44Z namdre $ +/// @version $Id: ROVehicle.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A vehicle as used by router /****************************************************************************/ @@ -68,11 +68,11 @@ * @todo Why is the vehicle builder given? */ ROVehicle(const SUMOVehicleParameter& pars, - RORouteDef* route, SUMOVTypeParameter* type) ; + RORouteDef* route, const SUMOVTypeParameter* type); /// @brief Destructor - virtual ~ROVehicle() ; + virtual ~ROVehicle(); /** @brief Returns the definition of the route the vehicle takes @@ -130,16 +130,14 @@ * Saves the vehicle route if it was not saved before. * Saves the vehicle itself. * - * @param[in] router the router for cost recomputation * @param[in] os The routes - output device to store the vehicle's description into * @param[in] altos The route alternatives - output device to store the vehicle's description into * @param[in] typeos The types - output device to store the vehicle types into * @param[in] withExitTimes whether exit times for the edges shall be written * @exception IOError If something fails (not yet implemented) */ - void saveAllAsXML(SUMOAbstractRouter &router, - OutputDevice& os, OutputDevice* const altos, - OutputDevice* const typeos, bool withExitTimes) const; + void saveAllAsXML(OutputDevice& os, OutputDevice* const altos, + OutputDevice* const typeos, bool withExitTimes) const; /** @brief Returns a copy of the vehicle using a new id, departure time and route @@ -151,7 +149,7 @@ * * @todo Is this used? What for if everything is replaced? */ - virtual ROVehicle* copy(const std::string& id, unsigned int depTime, RORouteDef* newRoute) ; + virtual ROVehicle* copy(const std::string& id, unsigned int depTime, RORouteDef* newRoute) const; protected: @@ -159,10 +157,10 @@ SUMOVehicleParameter myParameter; /// @brief The type of the vehicle - SUMOVTypeParameter* myType; + const SUMOVTypeParameter* const myType; /// @brief The route the vehicle takes - RORouteDef* myRoute; + RORouteDef* const myRoute; private: diff -Nru sumo-0.15.0~dfsg/src/router/ROVehicleCont.cpp sumo-0.16.0~dfsg/src/router/ROVehicleCont.cpp --- sumo-0.15.0~dfsg/src/router/ROVehicleCont.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROVehicleCont.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROVehicleCont.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROVehicleCont.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A container for vehicles sorted by their departure time /****************************************************************************/ @@ -97,7 +97,7 @@ ROVehicleCont::rebuildSorted() { mySorted = std::priority_queue, ROVehicleByDepartureComperator>(); std::map::const_iterator i; - const std::map &mmap = getMyMap(); + const std::map& mmap = getMyMap(); for (i = mmap.begin(); i != mmap.end(); ++i) { mySorted.push((*i).second); } diff -Nru sumo-0.15.0~dfsg/src/router/ROVehicleCont.h sumo-0.16.0~dfsg/src/router/ROVehicleCont.h --- sumo-0.15.0~dfsg/src/router/ROVehicleCont.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/router/ROVehicleCont.h 2012-09-25 22:01:29.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROVehicleCont.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ROVehicleCont.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A container for vehicles sorted by their departure time /****************************************************************************/ @@ -54,11 +54,11 @@ class ROVehicleCont : public NamedObjectCont { public: /// @brief Constructor - ROVehicleCont() ; + ROVehicleCont(); /// @brief Destructor - ~ROVehicleCont() ; + ~ROVehicleCont(); /** @brief Returns the vehicle that departs most early @@ -68,7 +68,7 @@ * * @return The vehicle that departs most early */ - const ROVehicle* getTopVehicle() const ; + const ROVehicle* getTopVehicle() const; /** @brief Adds a vehicle to the container @@ -84,7 +84,7 @@ * @return Whether the vehicle could be added * @see NamedObjectCont::add */ - virtual bool add(const std::string& id, ROVehicle* item) ; + virtual bool add(const std::string& id, ROVehicle* item); /** @brief Deletes all vehicles stored; clears the lists @@ -94,7 +94,7 @@ * * @see NamedObjectCont::clear */ - void clear() ; + void clear(); /** @brief Tries to remove (and delete) the named vehicle @@ -108,7 +108,7 @@ * @return Whether the vehicle could be removed * @see NamedObjectCont::erase */ - bool erase(const std::string& id) ; + bool erase(const std::string& id); private: @@ -119,7 +119,7 @@ * * @see NamedObjectCont::clear */ - void rebuildSorted() ; + void rebuildSorted(); private: diff -Nru sumo-0.15.0~dfsg/src/sumo_main.cpp sumo-0.16.0~dfsg/src/sumo_main.cpp --- sumo-0.15.0~dfsg/src/sumo_main.cpp 2012-02-23 00:03:32.000000000 +0000 +++ sumo-0.16.0~dfsg/src/sumo_main.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Thimor Bohn /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: sumo_main.cpp 11940 2012-02-22 13:11:30Z behrisch $ +/// @version $Id: sumo_main.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Main for SUMO /****************************************************************************/ @@ -61,7 +61,7 @@ #include #include -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL #include #endif @@ -82,13 +82,13 @@ load(OptionsCont& oc) { MSFrame::setMSGlobals(oc); MSVehicleControl* vc = 0; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { vc = new MEVehicleControl(); } else { #endif vc = new MSVehicleControl(); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif MSNet* net = new MSNet(vc, new MSEventControl(), @@ -121,38 +121,44 @@ MSNet* net = 0; try { // initialise subsystems - XMLSubSys::init(false); + XMLSubSys::init(); MSFrame::fillOptions(); OptionsIO::getOptions(true, argc, argv); if (oc.processMetaOptions(argc < 2)) { - OutputDevice::closeAll(); SystemFrame::close(); return 0; } + XMLSubSys::setValidation(oc.getBool("xml-validation")); MsgHandler::initOutputOptions(); if (!MSFrame::checkOptions()) { throw ProcessError(); } RandHelper::initRandGlobal(); + RandHelper::initRandGlobal(&MSVehicleControl::myVehicleParamsRNG); // load the net net = load(oc); if (net != 0) { ret = net->simulate(string2time(oc.getString("begin")), string2time(oc.getString("end"))); } - } catch (ProcessError& e) { + } catch (const ProcessError& e) { if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; #ifndef _DEBUG + } catch (const std::exception& e) { + if (std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } + MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); + ret = 1; } catch (...) { MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif } delete net; - OutputDevice::closeAll(); SystemFrame::close(); return ret; } diff -Nru sumo-0.15.0~dfsg/src/traci-server/Makefile.am sumo-0.16.0~dfsg/src/traci-server/Makefile.am --- sumo-0.15.0~dfsg/src/traci-server/Makefile.am 2011-03-31 23:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/Makefile.am 2012-09-25 22:01:57.000000000 +0000 @@ -1,7 +1,7 @@ noinst_LIBRARIES = libtraciserver.a -libtraciserver_a_SOURCES = TraCIConstants.h TraCIDijkstraRouter.h \ -TraCIException.h \ +libtraciserver_a_SOURCES = TraCIConstants.h \ +TraCIException.h TraCIRTree.h \ TraCIServer.h TraCIServer.cpp \ TraCIServerAPI_Edge.h TraCIServerAPI_Edge.cpp \ TraCIServerAPI_InductionLoop.h TraCIServerAPI_InductionLoop.cpp \ diff -Nru sumo-0.15.0~dfsg/src/traci-server/Makefile.in sumo-0.16.0~dfsg/src/traci-server/Makefile.in --- sumo-0.15.0~dfsg/src/traci-server/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -110,6 +110,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -140,6 +141,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -174,6 +176,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -207,7 +210,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -228,8 +230,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libtraciserver.a -libtraciserver_a_SOURCES = TraCIConstants.h TraCIDijkstraRouter.h \ -TraCIException.h \ +libtraciserver_a_SOURCES = TraCIConstants.h \ +TraCIException.h TraCIRTree.h \ TraCIServer.h TraCIServer.cpp \ TraCIServerAPI_Edge.h TraCIServerAPI_Edge.cpp \ TraCIServerAPI_InductionLoop.h TraCIServerAPI_InductionLoop.cpp \ diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIConstants.h sumo-0.16.0~dfsg/src/traci-server/TraCIConstants.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIConstants.h 2012-02-09 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIConstants.h 2012-12-04 00:02:28.000000000 +0000 @@ -9,7 +9,7 @@ /// @author Michael Behrisch /// @author Christoph Sommer /// @date 2007/10/24 -/// @version $Id: TraCIConstants.h 11852 2012-02-08 09:24:17Z behrisch $ +/// @version $Id: TraCIConstants.h 13120 2012-12-03 11:38:20Z behrisch $ /// /// holds codes used for TraCI /****************************************************************************/ @@ -31,7 +31,8 @@ // **************************************** // VERSION // **************************************** -#define TRACI_VERSION 3 +#define TRACI_VERSION 5 + // **************************************** // COMMANDS @@ -39,7 +40,7 @@ // command: get version #define CMD_GETVERSION 0x00 -// command: simulation step (new version) +// command: simulation step #define CMD_SIMSTEP2 0x02 // command: stop node @@ -54,23 +55,17 @@ // command: change target #define CMD_CHANGETARGET 0x31 -// command: Position Conversion -#define CMD_POSITIONCONVERSION 0x71 - -// command: Distance Request -#define CMD_DISTANCEREQUEST 0x72 - // command: add vehicle #define CMD_ADDVEHICLE 0x74 -// command: move node -#define CMD_MOVENODE 0x80 - // command: close sumo #define CMD_CLOSE 0x7F - +// command: subscribe induction loop (e1) context +#define CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT 0x80 +// response: subscribe induction loop (e1) context +#define RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT 0x90 // command: get induction loop (e1) variable #define CMD_GET_INDUCTIONLOOP_VARIABLE 0xa0 // response: get induction loop (e1) variable @@ -80,6 +75,10 @@ // response: subscribe induction loop (e1) variable #define RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE 0xe0 +// command: subscribe areal detector (e3) context +#define CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT 0x81 +// response: subscribe areal detector (e3) context +#define RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT 0x91 // command: get multi-entry/multi-exit detector (e3) variable #define CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE 0xa1 // response: get areal detector (e3) variable @@ -89,6 +88,10 @@ // response: subscribe areal detector (e3) variable #define RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE 0xe1 +// command: subscribe traffic lights context +#define CMD_SUBSCRIBE_TL_CONTEXT 0x82 +// response: subscribe traffic lights context +#define RESPONSE_SUBSCRIBE_TL_CONTEXT 0x92 // command: get traffic lights variable #define CMD_GET_TL_VARIABLE 0xa2 // response: get traffic lights variable @@ -100,6 +103,10 @@ // response: subscribe traffic lights variable #define RESPONSE_SUBSCRIBE_TL_VARIABLE 0xe2 +// command: subscribe lane context +#define CMD_SUBSCRIBE_LANE_CONTEXT 0x83 +// response: subscribe lane context +#define RESPONSE_SUBSCRIBE_LANE_CONTEXT 0x93 // command: get lane variable #define CMD_GET_LANE_VARIABLE 0xa3 // response: get lane variable @@ -111,6 +118,10 @@ // response: subscribe lane variable #define RESPONSE_SUBSCRIBE_LANE_VARIABLE 0xe3 +// command: subscribe vehicle context +#define CMD_SUBSCRIBE_VEHICLE_CONTEXT 0x84 +// response: subscribe vehicle context +#define RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT 0x94 // command: get vehicle variable #define CMD_GET_VEHICLE_VARIABLE 0xa4 // response: get vehicle variable @@ -122,6 +133,10 @@ // response: subscribe vehicle variable #define RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE 0xe4 +// command: subscribe vehicle type context +#define CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT 0x85 +// response: subscribe vehicle type context +#define RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT 0x95 // command: get vehicle type variable #define CMD_GET_VEHICLETYPE_VARIABLE 0xa5 // response: get vehicle type variable @@ -133,6 +148,10 @@ // response: subscribe vehicle type variable #define RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE 0xe5 +// command: subscribe route context +#define CMD_SUBSCRIBE_ROUTE_CONTEXT 0x86 +// response: subscribe route context +#define RESPONSE_SUBSCRIBE_ROUTE_CONTEXT 0x96 // command: get route variable #define CMD_GET_ROUTE_VARIABLE 0xa6 // response: get route variable @@ -144,6 +163,10 @@ // response: subscribe route variable #define RESPONSE_SUBSCRIBE_ROUTE_VARIABLE 0xe6 +// command: subscribe poi context +#define CMD_SUBSCRIBE_POI_CONTEXT 0x87 +// response: subscribe poi context +#define RESPONSE_SUBSCRIBE_POI_CONTEXT 0x97 // command: get poi variable #define CMD_GET_POI_VARIABLE 0xa7 // response: get poi variable @@ -155,6 +178,10 @@ // response: subscribe poi variable #define RESPONSE_SUBSCRIBE_POI_VARIABLE 0xe7 +// command: subscribe polygon context +#define CMD_SUBSCRIBE_POLYGON_CONTEXT 0x88 +// response: subscribe polygon context +#define RESPONSE_SUBSCRIBE_POLYGON_CONTEXT 0x98 // command: get polygon variable #define CMD_GET_POLYGON_VARIABLE 0xa8 // response: get polygon variable @@ -166,6 +193,10 @@ // response: subscribe polygon variable #define RESPONSE_SUBSCRIBE_POLYGON_VARIABLE 0xe8 +// command: subscribe junction context +#define CMD_SUBSCRIBE_JUNCTION_CONTEXT 0x89 +// response: subscribe junction context +#define RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT 0x99 // command: get junction variable #define CMD_GET_JUNCTION_VARIABLE 0xa9 // response: get junction variable @@ -177,6 +208,10 @@ // response: subscribe junction variable #define RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE 0xe9 +// command: subscribe edge context +#define CMD_SUBSCRIBE_EDGE_CONTEXT 0x8a +// response: subscribe edge context +#define RESPONSE_SUBSCRIBE_EDGE_CONTEXT 0x9a // command: get edge variable #define CMD_GET_EDGE_VARIABLE 0xaa // response: get edge variable @@ -188,6 +223,10 @@ // response: subscribe edge variable #define RESPONSE_SUBSCRIBE_EDGE_VARIABLE 0xea +// command: subscribe simulation context +#define CMD_SUBSCRIBE_SIM_CONTEXT 0x8b +// response: subscribe simulation context +#define RESPONSE_SUBSCRIBE_SIM_CONTEXT 0x9b // command: get simulation variable #define CMD_GET_SIM_VARIABLE 0xab // response: get simulation variable @@ -199,6 +238,10 @@ // response: subscribe simulation variable #define RESPONSE_SUBSCRIBE_SIM_VARIABLE 0xeb +// command: subscribe GUI context +#define CMD_SUBSCRIBE_GUI_CONTEXT 0x8c +// response: subscribe GUI context +#define RESPONSE_SUBSCRIBE_GUI_CONTEXT 0x9c // command: get GUI variable #define CMD_GET_GUI_VARIABLE 0xac // response: get GUI variable @@ -211,7 +254,6 @@ #define RESPONSE_SUBSCRIBE_GUI_VARIABLE 0xec - // **************************************** // POSITION REPRESENTATIONS // **************************************** @@ -227,7 +269,6 @@ #define POSITION_ROADMAP 0x04 - // **************************************** // DATA TYPES // **************************************** @@ -257,7 +298,6 @@ #define TYPE_COLOR 0x11 - // **************************************** // RESULT TYPES // **************************************** @@ -274,7 +314,6 @@ #define INVALID_INT_VALUE -1 - // **************************************** // TRAFFIC LIGHT PHASES // **************************************** @@ -290,7 +329,6 @@ #define TLPHASE_NOSIGNAL 0x05 - // **************************************** // DIFFERENT DISTANCE REQUESTS // **************************************** @@ -300,6 +338,20 @@ #define REQUEST_DRIVINGDIST 0x01 +// **************************************** +// VEHICLE REMOVAL REASONS +// **************************************** +// vehicle started teleport +#define REMOVE_TELEPORT 0x00 +// vehicle removed while parking +#define REMOVE_PARKING 0x01 +// vehicle arrived +#define REMOVE_ARRIVED 0x02 +// vehicle was vaporized +#define REMOVE_VAPORIZED 0x03 +// vehicle finished route during teleport +#define REMOVE_TELEPORT_ARRIVED 0x04 + // **************************************** // VARIABLE TYPES (for CMD_GET_*_VARIABLE) @@ -310,6 +362,12 @@ // count of instances (get: all) #define ID_COUNT 0x01 +// subscribe object variables (get: all) +#define OBJECT_VARIABLES_SUBSCRIPTION 0x02 + +// subscribe context variables (get: all) +#define SURROUNDING_VARIABLES_SUBSCRIPTION 0x03 + // last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges) #define LAST_STEP_VEHICLE_NUMBER 0x10 @@ -494,6 +552,8 @@ // how speed is set (set: vehicle) #define VAR_SPEEDSETMODE 0xb3 +// move vehicle, VTD version (set: vehicle) +#define VAR_MOVE_TO_VTD 0xb4 @@ -518,6 +578,10 @@ // current noise emission of a node (get: vehicle, lane, edge) #define VAR_NOISEEMISSION 0x66 +// current person number (get: vehicle) +#define VAR_PERSON_NUMBER 0x67 +#define VAR_BUS_STOP_WAITING 0x67 + // current time step (get: simulation) @@ -587,7 +651,6 @@ #define VAR_ROUTE_VALID 0x92 - // zoom #define VAR_VIEW_ZOOM 0xa0 @@ -607,5 +670,4 @@ #define VAR_TRACK_VEHICLE 0xa6 - #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIDijkstraRouter.h sumo-0.16.0~dfsg/src/traci-server/TraCIDijkstraRouter.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIDijkstraRouter.h 2012-02-25 00:03:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIDijkstraRouter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,313 +0,0 @@ -/****************************************************************************/ -/// @file TraCIDijkstraRouter.h -/// @author Friedemann Wesner -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date 2008/03/29 -/// @version $Id: TraCIDijkstraRouter.h 11951 2012-02-24 09:43:35Z namdre $ -/// -/// Dijkstra Router for use by TraCI -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ -#ifndef TRACIDIJKSTRAROUTER_H -#define TRACIDIJKSTRAROUTER_H - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#ifndef NO_TRACI - -#include "utils/common/DijkstraRouterTT.h" -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class TraCIDijkstraRouter - * @brief Computes the shortest path through a network using the dijkstra algorithm. - * - * The template parameters are: - * @param E The edge class to use (MSEdge/ROEdge) - * - * This router is basically the same as the SUMODijkstraRouter, except for the following: - * If start and destination edge are the same, the computed route does not consist of just the - * starting edge. Instead, if there is a path from the starting edge through the network back - * to itself, the route will consist of this path, containing the same edge both at the - * beginning and at the end. - * Furthermore, no vehicle is regarded to determine the efforts of the edges, - * therefore no prohibition function is used. - * - */ -template -class TraCIDijkstraRouter : public SUMOAbstractRouter { -public: - /// Constructor - TraCIDijkstraRouter(size_t noE/*, bool unbuildIsWarningOnly*/) : - SUMOAbstractRouter("TraciDijkstraRouter"), - myNoE(noE), myReusableEdgeLists(true), myReusableEdgeInfoLists(true) { } - - /// Destructor - virtual ~TraCIDijkstraRouter() { } - - /** - * @struct EdgeInfo - * A definition about a route's edge with the effort needed to reach it and - * the information about the previous edge. - */ - class EdgeInfo { - public: - /// Constructor - EdgeInfo() - : edge(0), effort(0), prev(0) {} - - - /// Constructor - EdgeInfo(const E* edgeArg, SUMOReal effortArg, EdgeInfo* prevArg) - : edge(edgeArg), effort(effortArg), prev(prevArg) {} - - /// Constructor - EdgeInfo(const E* edgeArg, SUMOReal effortArg, EdgeInfo* prevArg, SUMOReal distArg) - : edge(edgeArg), effort(effortArg), prev(prevArg), dist(distArg) {} - - /// The current edge - const E* edge; - - /// Effort to reach the edge - SUMOReal effort; - - /// The previous edge - EdgeInfo* prev; - - /// Distance from the begin - SUMOReal dist; - - }; - - /** - * @class EdgeInfoByEffortComperator - * Class to compare (and so sort) nodes by their effort - */ - class EdgeInfoByEffortComperator { - public: - /// Constructor - explicit EdgeInfoByEffortComperator() { } - - /// Destructor - ~EdgeInfoByEffortComperator() { } - - /// Comparing method - bool operator()(EdgeInfo* nod1, EdgeInfo* nod2) const { - return nod1->effort > nod2->effort; - } - }; - - virtual SUMOReal getEffort(const E* const e, SUMOReal t) const { - SUMOReal value; - if (MSNet::getInstance()->getWeightsStorage().retrieveExistingEffort(e, 0, t, value)) { - return value; - } - const MSLane* const l = e->getLanes()[0]; - return l->getLength() / l->getMaxSpeed(); - } - - - /** @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 void compute(const E* from, const E* to, const MSVehicle* const vehicle, - SUMOTime msTime, std::vector &into) { - UNUSED_PARAMETER(vehicle); - const SUMOReal time = STEPS2TIME(msTime); - // get structures to reuse - std::vector *visited = myReusableEdgeLists.getFreeInstance(); - if (visited == 0) { - visited = new std::vector(myNoE, false); - } else { - for (size_t i = 0; i < myNoE; i++) { - (*visited)[i] = false; // too slow? !!! - } - } - EdgeInfoCont* storage = myReusableEdgeInfoLists.getFreeInstance(); - if (storage == 0) { - storage = new EdgeInfoCont(myNoE); - } - storage->reset(); - - // check the nodes - if (from == 0 || to == 0) { - throw std::exception(); - } - - // begin computation - std::priority_queue < EdgeInfo*, - std::vector, - EdgeInfoByEffortComperator > frontierList; - // add begin node - const E* actualKnot = from; - if (from != 0) { - EdgeInfo* ei = storage->add(actualKnot, 0, 0); - frontierList.push(ei); - } - bool isFirstIteration = true; - - // loop - while (!frontierList.empty()) { - // use the node with the minimal length - EdgeInfo* minimumKnot = frontierList.top(); - const E* minEdge = minimumKnot->edge; - frontierList.pop(); - // check whether the destination node was already reached - if ((minEdge == to) && (!isFirstIteration)) { - buildPathFrom(minimumKnot, into); - clearTemporaryStorages(visited, storage); - return; - } - (*visited)[minEdge->getNumericalID()] = true; - const SUMOReal effort = (SUMOReal)(minimumKnot->effort + getEffort(minEdge, time + minimumKnot->effort)); - // check all ways from the node with the minimal length - unsigned int i = 0; - const unsigned int length_size = minEdge->getNoFollowing(); - for (i = 0; i < length_size; i++) { - const E* help = minEdge->getFollower(i); - - if ((!(*visited)[help->getNumericalID()] && effort < storage->getEffort(help)) - || (help == to)) { -// if (help!=from) { - frontierList.push(storage->add(help, effort, minimumKnot)); -// } - } - } - - isFirstIteration = false; - } - clearTemporaryStorages(visited, storage); - } - - - SUMOReal recomputeCosts(const std::vector &edges, const MSVehicle* const v, SUMOTime msTime) const { - UNUSED_PARAMETER(v); - const SUMOReal time = STEPS2TIME(msTime); - SUMOReal costs = 0; - for (typename std::vector::const_iterator i = edges.begin(); i != edges.end(); i++) { - costs += getEffort(*i, time + costs); - } - return costs; - } - -public: - /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector &edges) { - std::deque tmp; - EdgeInfo* last = rbegin; - while (rbegin != 0) { - tmp.push_front((E*) rbegin->edge); // !!! - rbegin = rbegin->prev; - if (rbegin == last) { - tmp.push_front((E*) rbegin->edge); - break; - } - } - std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); - } - -public: - /** - * @class EdgeInfoCont - * A class holding the instances of effort-to-reach and predeccessor - * information for every edge within the network. - * This class is used instead of the former saving of these values within - * the edges to allow parallel route computation in multithreading mode. - */ - class EdgeInfoCont { - public: - /// Constructor - EdgeInfoCont(size_t toAlloc) - : myEdgeInfos(toAlloc + 1, EdgeInfo()) { } - - /// Destructor - ~EdgeInfoCont() { } - - /// Adds the information about the effort to get to an edge and its predeccessing edge - EdgeInfo* add(const E* edgeArg, SUMOReal effortArg, EdgeInfo* prevArg) { - EdgeInfo* ret = &(myEdgeInfos[edgeArg->getNumericalID()]); - ret->edge = edgeArg; // !!! may be set within the constructor - ret->effort = effortArg; - ret->prev = prevArg; - ret->dist = 0; - return ret; - } - - /// Adds the information about the effort to get to an edge and its predeccessing edge - EdgeInfo* add(const E* edgeArg, SUMOReal effortArg, EdgeInfo* prevArg, - SUMOReal distArg) { - EdgeInfo* ret = &(myEdgeInfos[edgeArg->getNumericalID()]); - ret->edge = edgeArg; // !!! may be set within the constructor - ret->effort = effortArg; - ret->prev = prevArg; - ret->dist = distArg; - return ret; - } - - /// Resets all effort-information - void reset() { - for (typename std::vector::iterator i = myEdgeInfos.begin(); i != myEdgeInfos.end(); i++) { - (*i).effort = std::numeric_limits::max(); - } - } - - - /** @brief Returns the effort to get to the specify edge - The value is valid if the edge was already visited */ - SUMOReal getEffort(const E* to) const { - return myEdgeInfos[to->getNumericalID()].effort; - } - - private: - /// The container of edge information - std::vector myEdgeInfos; - - }; - -protected: - /// Saves the temporary storages for further usage - void clearTemporaryStorages(std::vector *edgeList, - EdgeInfoCont* consecutionList) { - myReusableEdgeLists.addFreeInstance(edgeList); - myReusableEdgeInfoLists.addFreeInstance(consecutionList); - } - - -protected: - /// The network to use - size_t myNoE; - - /// A container for reusage of examined edges lists - InstancePool > myReusableEdgeLists; - - /// A container for reusage of edge consecution lists - InstancePool myReusableEdgeInfoLists; -}; - -#endif - -#endif - diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIRTree.h sumo-0.16.0~dfsg/src/traci-server/TraCIRTree.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIRTree.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIRTree.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,153 @@ +/****************************************************************************/ +/// @file TraCIRTree.h +/// @author Daniel Krajzewicz +/// @date 27.10.2008 +/// @version $Id: TraCIRTree.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// A RT-tree for efficient storing of SUMO's GL-objects +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef TraCIRTree_h +#define TraCIRTree_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include + +//#include "RTree.h" + + +// specialized implementation for speedup and avoiding warnings +template<> +inline float RTree::RectSphericalVolume(Rect* a_rect) { + ASSERT(a_rect); + const float extent0 = a_rect->m_max[0] - a_rect->m_min[0]; + const float extent1 = a_rect->m_max[1] - a_rect->m_min[1]; + return .78539816f * (extent0 * extent0 + extent1 * extent1); +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class TraCIRTree + * @brief A RT-tree for efficient storing of SUMO's GL-objects + * + * This class specialises the used RT-tree implementation from "rttree.h" and + * extends it by a mutex for avoiding parallel change and traversal of the tree. + */ +class TraCIRTree : private RTree, public Boundary { +public: + /// @brief Constructor + TraCIRTree() + : RTree(&Named::addTo) { + } + + + /// @brief Destructor + ~TraCIRTree() { + } + + + /** @brief Insert entry + * @param a_min Min of bounding rect + * @param a_max Max of bounding rect + * @param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. + * @see RTree::Insert + */ + void Insert(const float a_min[2], const float a_max[2], Named* a_dataId) { + //AbstractMutex::ScopedLocker locker(myLock); + RTree::Insert(a_min, a_max, a_dataId); + } + + + /** @brief Remove entry + * @param a_min Min of bounding rect + * @param a_max Max of bounding rect + * @param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed. + * @see RTree::Remove + */ + void Remove(const float a_min[2], const float a_max[2], Named* a_dataId) { + //AbstractMutex::ScopedLocker locker(myLock); + RTree::Remove(a_min, a_max, a_dataId); + } + + + /** @brief Find all within search rectangle + * @param a_min Min of search bounding rect + * @param a_max Max of search bounding rect + * @param a_searchResult Search result array. Caller should set grow size. Function will reset, not append to array. + * @param a_resultCallback Callback function to return result. Callback should return 'true' to continue searching + * @param a_context User context to pass as parameter to a_resultCallback + * @return Returns the number of entries found + * @see RTree::Search + */ + int Search(const float a_min[2], const float a_max[2], const Named::StoringVisitor& c) { + //AbstractMutex::ScopedLocker locker(myLock); + return RTree::Search(a_min, a_max, c); + } + + + /** @brief Adds an additional object (detector/shape/trigger) for visualisation + * @param[in] o The object to add + * @param[in] b The object's boundary + */ + void addObject(Named* o, Boundary& b) { + const float cmin[2] = {(float) b.xmin(), (float) b.ymin()}; + const float cmax[2] = {(float) b.xmax(), (float) b.ymax()}; + Insert(cmin, cmax, o); + } + + + /** @brief Adds an additional object (detector/shape/trigger) for visualisation + * @param[in] o The object to add + * @param[in] p The object's position + */ + void addObject(Named* o, Position& p) { + Boundary b; + b.add(p); + addObject(o, b); + } + + + /** @brief Removes an additional object (detector/shape/trigger) from being visualised + * @param[in] o The object to remove + */ + void removeAdditionalGLObject(Named* o, Boundary& b) { + const float cmin[2] = {(float) b.xmin(), (float) b.ymin()}; + const float cmax[2] = {(float) b.xmax(), (float) b.ymax()}; + Remove(cmin, cmax, o); + } + + +protected: + /// @brief A mutex avoiding parallel change and traversal of the tree + //MFXMutex myLock; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServer.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServer.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServer.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServer.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -10,7 +10,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 2007/10/24 -/// @version $Id: TraCIServer.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TraCIServer.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// /// TraCI server used to control sumo by a remote TraCI client (e.g., ns2) /****************************************************************************/ @@ -107,23 +107,9 @@ // =========================================================================== // method definitions // =========================================================================== - -void -TraCIServer::openSocket(const std::map &execs) { - if (myInstance == 0) { - if (!myDoCloseConnection && OptionsCont::getOptions().getInt("remote-port") != 0) { - myInstance = new traci::TraCIServer(OptionsCont::getOptions().getInt("remote-port")); - for (std::map::const_iterator i = execs.begin(); i != execs.end(); ++i) { - myInstance->myExecutors[i->first] = i->second; - } - } - } -} - -/*****************************************************************************/ - TraCIServer::TraCIServer(int port) : mySocket(0), myTargetTime(0), myDoingSimStep(false), myHaveWarnedDeprecation(false), myAmEmbedded(port == 0) { + myVehicleStateChanges[MSNet::VEHICLE_STATE_BUILT] = std::vector(); myVehicleStateChanges[MSNet::VEHICLE_STATE_DEPARTED] = std::vector(); myVehicleStateChanges[MSNet::VEHICLE_STATE_STARTING_TELEPORT] = std::vector(); @@ -174,7 +160,6 @@ } } -/*****************************************************************************/ TraCIServer::~TraCIServer() { MSNet::getInstance()->removeVehicleStateListener(this); @@ -182,9 +167,44 @@ mySocket->close(); delete mySocket; } + for (std::map::const_iterator i = myObjects.begin(); i != myObjects.end(); ++i) { + delete(*i).second; + } } -/*****************************************************************************/ + +// ---------- Initialisation and Shutdown +void +TraCIServer::openSocket(const std::map& execs) { + if (myInstance == 0) { + if (!myDoCloseConnection && OptionsCont::getOptions().getInt("remote-port") != 0) { + myInstance = new traci::TraCIServer(OptionsCont::getOptions().getInt("remote-port")); + for (std::map::const_iterator i = execs.begin(); i != execs.end(); ++i) { + myInstance->myExecutors[i->first] = i->second; + } + } + } +} + + +void +TraCIServer::close() { + if (myInstance != 0) { + delete myInstance; + myInstance = 0; + myDoCloseConnection = true; + } +} + + +bool +TraCIServer::wasClosed() { + return myDoCloseConnection; +} + + +// ---------- Initialisation and Shutdown + void TraCIServer::vehicleStateChanged(const SUMOVehicle* const vehicle, MSNet::VehicleState to) { @@ -194,7 +214,7 @@ myVehicleStateChanges[to].push_back(vehicle->getID()); } -/*****************************************************************************/ + void TraCIServer::processCommandsUntilSimStep(SUMOTime step) { try { @@ -260,31 +280,15 @@ } } -/*****************************************************************************/ -bool -TraCIServer::wasClosed() { - return myDoCloseConnection; -} - - -void -TraCIServer::close() { - if (myInstance != 0) { - delete myInstance; - myInstance = 0; - myDoCloseConnection = true; - } -} -/*****************************************************************************/ #ifdef HAVE_PYTHON // =========================================================================== // python functions (traciemb module) // =========================================================================== static PyObject* -traciemb_execute(PyObject* self, PyObject* args) { +traciemb_execute(PyObject* /* self */, PyObject* args) { const char* msg; int size; if (!PyArg_ParseTuple(args, "s#", &msg, &size)) { @@ -353,7 +357,6 @@ } #endif -/*****************************************************************************/ int TraCIServer::dispatchCommand() { @@ -390,19 +393,6 @@ case CMD_CLOSE: success = commandCloseConnection(); break; - case CMD_POSITIONCONVERSION: { - if (!myHaveWarnedDeprecation) { - WRITE_WARNING("Using old TraCI API, please update your client!"); - myHaveWarnedDeprecation = true; - } - tcpip::Storage tempMsg; - success = TraCIServerAPI_Simulation::commandPositionConversion(*this, myInputStorage, tempMsg, CMD_POSITIONCONVERSION); - if (success) { - writeStatusCmd(CMD_POSITIONCONVERSION, RTYPE_OK, ""); - myOutputStorage.writeStorage(tempMsg); - } - } - break; case CMD_ADDVEHICLE: if (!myHaveWarnedDeprecation) { WRITE_WARNING("Using old TraCI API, please update your client!"); @@ -410,19 +400,6 @@ } success = commandAddVehicle(); break; - case CMD_DISTANCEREQUEST: { - if (!myHaveWarnedDeprecation) { - WRITE_WARNING("Using old TraCI API, please update your client!"); - myHaveWarnedDeprecation = true; - } - tcpip::Storage tempMsg; - success = TraCIServerAPI_Simulation::commandDistanceRequest(*this, myInputStorage, tempMsg, CMD_DISTANCEREQUEST); - if (success) { - writeStatusCmd(CMD_DISTANCEREQUEST, RTYPE_OK, ""); - myOutputStorage.writeStorage(tempMsg); - } - } - break; case CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE: case CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE: case CMD_SUBSCRIBE_TL_VARIABLE: @@ -436,7 +413,22 @@ case CMD_SUBSCRIBE_EDGE_VARIABLE: case CMD_SUBSCRIBE_SIM_VARIABLE: case CMD_SUBSCRIBE_GUI_VARIABLE: - success = addSubscription(commandId); + success = addObjectVariableSubscription(commandId); + break; + case CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT: + case CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT: + case CMD_SUBSCRIBE_TL_CONTEXT: + case CMD_SUBSCRIBE_LANE_CONTEXT: + case CMD_SUBSCRIBE_VEHICLE_CONTEXT: + case CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT: + case CMD_SUBSCRIBE_ROUTE_CONTEXT: + case CMD_SUBSCRIBE_POI_CONTEXT: + case CMD_SUBSCRIBE_POLYGON_CONTEXT: + case CMD_SUBSCRIBE_JUNCTION_CONTEXT: + case CMD_SUBSCRIBE_EDGE_CONTEXT: + case CMD_SUBSCRIBE_SIM_CONTEXT: + case CMD_SUBSCRIBE_GUI_CONTEXT: + success = addObjectContextSubscription(commandId); break; default: writeStatusCmd(commandId, RTYPE_NOTIMPLEMENTED, "Command not implemented in sumo"); @@ -458,7 +450,35 @@ return commandId; } -/*****************************************************************************/ + +// ---------- Server-internal command handling +bool +TraCIServer::commandGetVersion() { + std::string sumoVersion = VERSION_STRING; + // Prepare response + tcpip::Storage answerTmp; + answerTmp.writeInt(TRACI_VERSION); + answerTmp.writeString(std::string("SUMO ") + sumoVersion); + // When we get here, the response is stored in answerTmp -> put into myOutputStorage + writeStatusCmd(CMD_GETVERSION, RTYPE_OK, ""); + // command length + myOutputStorage.writeUnsignedByte(1 + 1 + static_cast(answerTmp.size())); + // command type + myOutputStorage.writeUnsignedByte(CMD_GETVERSION); + // and the parameter dependant part + myOutputStorage.writeStorage(answerTmp); + return true; +} + + +bool +TraCIServer::commandCloseConnection() { + myDoCloseConnection = true; + // write answer + writeStatusCmd(CMD_CLOSE, RTYPE_OK, "Goodbye"); + return true; +} + void TraCIServer::postProcessSimulationStep2() { @@ -491,42 +511,6 @@ } } -/*****************************************************************************/ - -bool -TraCIServer::commandGetVersion() { - - std::string sumoVersion = VERSION_STRING; - - // Prepare response - tcpip::Storage answerTmp; - - answerTmp.writeInt(TRACI_VERSION); - answerTmp.writeString(std::string("SUMO ") + sumoVersion); - - // When we get here, the response is stored in answerTmp -> put into myOutputStorage - writeStatusCmd(CMD_GETVERSION, RTYPE_OK, ""); - - // command length - myOutputStorage.writeUnsignedByte(1 + 1 + static_cast(answerTmp.size())); - // command type - myOutputStorage.writeUnsignedByte(CMD_GETVERSION); - // and the parameter dependant part - myOutputStorage.writeStorage(answerTmp); - return true; -} - -/*****************************************************************************/ - -bool -TraCIServer::commandCloseConnection() { - myDoCloseConnection = true; - // write answer - writeStatusCmd(CMD_CLOSE, RTYPE_OK, "Goodbye"); - return true; -} - -/*****************************************************************************/ bool TraCIServer::commandAddVehicle() { @@ -587,9 +571,9 @@ // calculate speed float clippedInsertionSpeed; if (insertionSpeed < 0) { - clippedInsertionSpeed = (float) MIN2(lane->getMaxSpeed(), vehicle->getMaxSpeed()); + clippedInsertionSpeed = (float) MIN2(lane->getVehicleMaxSpeed(vehicle), vehicle->getMaxSpeed()); } else { - clippedInsertionSpeed = (float) MIN3(lane->getMaxSpeed(), vehicle->getMaxSpeed(), insertionSpeed); + clippedInsertionSpeed = (float) MIN3(lane->getVehicleMaxSpeed(vehicle), vehicle->getMaxSpeed(), insertionSpeed); } // insert vehicle into the dictionary @@ -615,8 +599,6 @@ } -/*****************************************************************************/ - void TraCIServer::writeStatusCmd(int commandId, int status, const std::string& description) { writeStatusCmd(commandId, status, description, myOutputStorage); @@ -636,55 +618,227 @@ outputStorage.writeString(description); // description } -/*****************************************************************************/ -bool -TraCIServer::addSubscription(int commandId) { - SUMOTime beginTime = myInputStorage.readInt(); - SUMOTime endTime = myInputStorage.readInt(); - std::string id = myInputStorage.readString(); - int no = myInputStorage.readUnsignedByte(); - std::vector variables; - for (int i = 0; i < no; ++i) { - variables.push_back(myInputStorage.readUnsignedByte()); +void +TraCIServer::initialiseSubscription(const TraCIServer::Subscription& s) { + tcpip::Storage writeInto; + std::string errors; + if (processSingleSubscription(s, writeInto, errors)) { + if (s.endTime < MSNet::getInstance()->getCurrentTimeStep()) { + writeStatusCmd(s.commandId, RTYPE_ERR, "Subscription has ended."); + } else { + mySubscriptions.push_back(s); + writeStatusCmd(s.commandId, RTYPE_OK, ""); + } + } else { + writeStatusCmd(s.commandId, RTYPE_ERR, "Could not add subscription (" + errors + ")."); } - // check subscribe/unsubscribe - bool ok = true; - if (variables.size() == 0) { - // try unsubscribe - bool found = false; - for (std::vector::iterator j = mySubscriptions.begin(); j != mySubscriptions.end();) { - if ((*j).id == id && (*j).commandId == commandId) { - j = mySubscriptions.erase(j); - found = true; - continue; + myOutputStorage.writeStorage(writeInto); +} + + +void +TraCIServer::removeSubscription(int commandId, const std::string& id, int domain) { + bool found = false; + for (std::vector::iterator j = mySubscriptions.begin(); j != mySubscriptions.end();) { + if ((*j).id == id && (*j).commandId == commandId && (domain < 0 || (*j).contextDomain == domain)) { + j = mySubscriptions.erase(j); + found = true; + continue; + } + ++j; + } + // try unsubscribe + if (found) { + writeStatusCmd(commandId, RTYPE_OK, ""); + } else { + writeStatusCmd(commandId, RTYPE_OK, "The subscription to remove was not found."); + } +} + + +bool +TraCIServer::findObjectShape(int domain, const std::string& id, PositionVector& shape) { + Position p; + switch (domain) { + case CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT: + if (TraCIServerAPI_InductionLoop::getPosition(id, p)) { + shape.push_back(p); + break; + } + return false; + case CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT: + return false; + case CMD_SUBSCRIBE_TL_CONTEXT: + return false; + case CMD_SUBSCRIBE_LANE_CONTEXT: + if (TraCIServerAPI_Lane::getShape(id, shape)) { + break; + } + return false; + case CMD_SUBSCRIBE_VEHICLE_CONTEXT: + if (TraCIServerAPI_Vehicle::getPosition(id, p)) { + shape.push_back(p); + break; } - ++j; + return false; + case CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT: + return false; + case CMD_SUBSCRIBE_ROUTE_CONTEXT: + return false; + case CMD_SUBSCRIBE_POI_CONTEXT: + if (TraCIServerAPI_POI::getPosition(id, p)) { + shape.push_back(p); + break; + } + return false; + case CMD_SUBSCRIBE_POLYGON_CONTEXT: + if (TraCIServerAPI_Polygon::getShape(id, shape)) { + break; + } + return false; + case CMD_SUBSCRIBE_JUNCTION_CONTEXT: + if (TraCIServerAPI_Junction::getPosition(id, p)) { + shape.push_back(p); + break; + } + return false; + case CMD_SUBSCRIBE_EDGE_CONTEXT: + if (TraCIServerAPI_Edge::getShape(id, shape)) { + break; + } + return false; + case CMD_SUBSCRIBE_SIM_CONTEXT: + return false; + case CMD_SUBSCRIBE_GUI_CONTEXT: + return false; + default: + return false; + } + return true; +} + +void +TraCIServer::collectObjectsInRange(int domain, const PositionVector& shape, SUMOReal range, std::set& into) { + // build the look-up tree if not yet existing + if (myObjects.find(domain) == myObjects.end()) { + switch (domain) { + case CMD_GET_INDUCTIONLOOP_VARIABLE: + myObjects[CMD_GET_INDUCTIONLOOP_VARIABLE] = TraCIServerAPI_InductionLoop::getTree(); + break; + case CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE: + break; + case CMD_GET_TL_VARIABLE: + break; + case CMD_GET_LANE_VARIABLE: + myObjects[CMD_GET_LANE_VARIABLE] = TraCIServerAPI_Lane::getTree(); + break; + case CMD_GET_VEHICLE_VARIABLE: + if (myObjects.find(CMD_GET_LANE_VARIABLE) == myObjects.end()) { + myObjects[CMD_GET_LANE_VARIABLE] = TraCIServerAPI_Lane::getTree(); + } + break; + case CMD_GET_VEHICLETYPE_VARIABLE: + break; + case CMD_GET_ROUTE_VARIABLE: + break; + case CMD_GET_POI_VARIABLE: + myObjects[CMD_GET_POI_VARIABLE] = TraCIServerAPI_POI::getTree(); + break; + case CMD_GET_POLYGON_VARIABLE: + myObjects[CMD_GET_POLYGON_VARIABLE] = TraCIServerAPI_Polygon::getTree(); + break; + case CMD_GET_JUNCTION_VARIABLE: + myObjects[CMD_GET_JUNCTION_VARIABLE] = TraCIServerAPI_Junction::getTree(); + break; + case CMD_GET_EDGE_VARIABLE: + myObjects[CMD_GET_EDGE_VARIABLE] = TraCIServerAPI_Edge::getTree(); + break; + case CMD_GET_SIM_VARIABLE: + break; + case CMD_GET_GUI_VARIABLE: + break; + default: + break; } - if (found) { - writeStatusCmd(commandId, RTYPE_OK, ""); - } else { - writeStatusCmd(commandId, RTYPE_OK, "The subscription to remove was not found."); + } + const Boundary b = shape.getBoxBoundary().grow(range); + const float cmin[2] = {(float) b.xmin(), (float) b.ymin()}; + const float cmax[2] = {(float) b.xmax(), (float) b.ymax()}; + switch (domain) { + case CMD_GET_INDUCTIONLOOP_VARIABLE: { + Named::StoringVisitor sv(into); + myObjects[CMD_GET_INDUCTIONLOOP_VARIABLE]->Search(cmin, cmax, sv); } - } else { - // process subscription - Subscription s(commandId, id, variables, beginTime, endTime); - tcpip::Storage writeInto; - std::string errors; - if (s.endTime < MSNet::getInstance()->getCurrentTimeStep()) { - processSingleSubscription(s, writeInto, errors); - writeStatusCmd(s.commandId, RTYPE_ERR, "Subscription has ended."); - } else { - if (processSingleSubscription(s, writeInto, errors)) { - mySubscriptions.push_back(s); - writeStatusCmd(s.commandId, RTYPE_OK, ""); - } else { - writeStatusCmd(s.commandId, RTYPE_ERR, "Could not add subscription (" + errors + ")."); + break; + case CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE: + break; + case CMD_GET_TL_VARIABLE: + break; + case CMD_GET_LANE_VARIABLE: { + Named::StoringVisitor sv(into); + myObjects[CMD_GET_LANE_VARIABLE]->Search(cmin, cmax, sv); + if (shape.size() == 1) { + for (std::set::iterator i = into.begin(); i != into.end();) { + const MSLane* const l = MSLane::dictionary(*i); + if (l->getShape().distance(shape[0]) > range) { + into.erase(i++); + } else { + ++i; + } + } + } + } + break; + case CMD_GET_VEHICLE_VARIABLE: { + std::set tmp; + Named::StoringVisitor sv(tmp); + myObjects[CMD_GET_LANE_VARIABLE]->Search(cmin, cmax, sv); + for (std::set::const_iterator i = tmp.begin(); i != tmp.end(); ++i) { + MSLane* l = MSLane::dictionary(*i); + if (l != 0) { + const std::deque& vehs = l->getVehiclesSecure(); + for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { + if (shape.distance((*j)->getPosition()) <= range) { + into.insert((*j)->getID()); + } + } + l->releaseVehicles(); + } } } - myOutputStorage.writeStorage(writeInto); + break; + case CMD_GET_VEHICLETYPE_VARIABLE: + break; + case CMD_GET_ROUTE_VARIABLE: + break; + case CMD_GET_POI_VARIABLE: { + Named::StoringVisitor sv(into); + myObjects[CMD_GET_POI_VARIABLE]->Search(cmin, cmax, sv); + } + break; + case CMD_GET_POLYGON_VARIABLE: { + Named::StoringVisitor sv(into); + myObjects[CMD_GET_POLYGON_VARIABLE]->Search(cmin, cmax, sv); + } + break; + case CMD_GET_JUNCTION_VARIABLE: { + Named::StoringVisitor sv(into); + myObjects[CMD_GET_JUNCTION_VARIABLE]->Search(cmin, cmax, sv); + } + break; + case CMD_GET_EDGE_VARIABLE: { + Named::StoringVisitor sv(into); + myObjects[CMD_GET_EDGE_VARIABLE]->Search(cmin, cmax, sv); + } + break; + case CMD_GET_SIM_VARIABLE: + break; + case CMD_GET_GUI_VARIABLE: + break; + default: + break; } - return ok; } @@ -693,64 +847,140 @@ std::string& errors) { bool ok = true; tcpip::Storage outputStorage; - for (std::vector::const_iterator i = s.variables.begin(); i != s.variables.end(); ++i) { - tcpip::Storage message; - message.writeUnsignedByte(*i); - message.writeString(s.id); - tcpip::Storage tmpOutput; - int getId = s.commandId - 0x30; - if (myExecutors.find(getId) != myExecutors.end()) { - ok &= myExecutors[getId](*this, message, tmpOutput); - } else { - writeStatusCmd(s.commandId, RTYPE_NOTIMPLEMENTED, "Unsupported command specified", tmpOutput); - ok = false; + int getCommandId = s.contextVars ? s.contextDomain : s.commandId - 0x30; + std::set objIDs; + if (s.contextVars) { + getCommandId = s.contextDomain; + PositionVector shape; + if (!findObjectShape(s.commandId, s.id, shape)) { + return false; } - // copy response part - if (ok) { - int length = tmpOutput.readUnsignedByte(); - while (--length > 0) { - tmpOutput.readUnsignedByte(); + collectObjectsInRange(s.contextDomain, shape, s.range, objIDs); + } else { + getCommandId = s.commandId - 0x30; + objIDs.insert(s.id); + } + + for (std::set::iterator j = objIDs.begin(); j != objIDs.end(); ++j) { + if (s.contextVars) { + outputStorage.writeString(*j); + } + for (std::vector::const_iterator i = s.variables.begin(); i != s.variables.end(); ++i) { + tcpip::Storage message; + message.writeUnsignedByte(*i); + message.writeString(*j); + tcpip::Storage tmpOutput; + if (myExecutors.find(getCommandId) != myExecutors.end()) { + ok &= myExecutors[getCommandId](*this, message, tmpOutput); + } else { + writeStatusCmd(s.commandId, RTYPE_NOTIMPLEMENTED, "Unsupported command specified", tmpOutput); + ok = false; } - int lengthLength = 1; - length = tmpOutput.readUnsignedByte(); - if (length == 0) { - lengthLength = 5; - length = tmpOutput.readInt(); - } - //read responseType - tmpOutput.readUnsignedByte(); - int variable = tmpOutput.readUnsignedByte(); - std::string id = tmpOutput.readString(); - outputStorage.writeUnsignedByte(variable); - outputStorage.writeUnsignedByte(RTYPE_OK); - length -= (lengthLength + 1 + 4 + (int)id.length()); - while (--length > 0) { - outputStorage.writeUnsignedByte(tmpOutput.readUnsignedByte()); + // copy response part + if (ok) { + int length = tmpOutput.readUnsignedByte(); + while (--length > 0) { + tmpOutput.readUnsignedByte(); + } + int lengthLength = 1; + length = tmpOutput.readUnsignedByte(); + if (length == 0) { + lengthLength = 5; + length = tmpOutput.readInt(); + } + //read responseType + tmpOutput.readUnsignedByte(); + int variable = tmpOutput.readUnsignedByte(); + std::string id = tmpOutput.readString(); + outputStorage.writeUnsignedByte(variable); + outputStorage.writeUnsignedByte(RTYPE_OK); + length -= (lengthLength + 1 + 4 + (int)id.length()); + while (--length > 0) { + outputStorage.writeUnsignedByte(tmpOutput.readUnsignedByte()); + } + } else { + //read length + tmpOutput.readUnsignedByte(); + //read cmd + tmpOutput.readUnsignedByte(); + //read status + tmpOutput.readUnsignedByte(); + std::string msg = tmpOutput.readString(); + outputStorage.writeUnsignedByte(*i); + outputStorage.writeUnsignedByte(RTYPE_ERR); + outputStorage.writeUnsignedByte(TYPE_STRING); + outputStorage.writeString(msg); + errors = errors + msg; } - } else { - //read length - tmpOutput.readUnsignedByte(); - //read cmd - tmpOutput.readUnsignedByte(); - //read status - tmpOutput.readUnsignedByte(); - std::string msg = tmpOutput.readString(); - outputStorage.writeUnsignedByte(*i); - outputStorage.writeUnsignedByte(RTYPE_ERR); - outputStorage.writeUnsignedByte(TYPE_STRING); - outputStorage.writeString(msg); - errors = errors + msg; } } + unsigned int length = (1 + 4) + 1 + (4 + (int)(s.id.length())) + 1 + (int)outputStorage.size(); + if (s.contextVars) { + length += 4; + } writeInto.writeUnsignedByte(0); // command length -> extended - writeInto.writeInt((1 + 4) + 1 + (4 + (int)(s.id.length())) + 1 + (int)outputStorage.size()); + writeInto.writeInt(length); writeInto.writeUnsignedByte(s.commandId + 0x10); writeInto.writeString(s.id); + if (s.contextVars) { + writeInto.writeUnsignedByte(s.contextDomain); + } writeInto.writeUnsignedByte((int)(s.variables.size())); - writeInto.writeStorage(outputStorage); + if (s.contextVars) { + writeInto.writeInt((int)objIDs.size()); + } + if (!s.contextVars || objIDs.size() != 0) { + writeInto.writeStorage(outputStorage); + } return ok; } + +bool +TraCIServer::addObjectVariableSubscription(int commandId) { + SUMOTime beginTime = myInputStorage.readInt(); + SUMOTime endTime = myInputStorage.readInt(); + std::string id = myInputStorage.readString(); + int no = myInputStorage.readUnsignedByte(); + std::vector variables; + for (int i = 0; i < no; ++i) { + variables.push_back(myInputStorage.readUnsignedByte()); + } + // check subscribe/unsubscribe + if (variables.size() == 0) { + removeSubscription(commandId, id, -1); + return true; + } + // process subscription + Subscription s(commandId, id, variables, beginTime, endTime, false, 0, 0); + initialiseSubscription(s); + return true; +} + + +bool +TraCIServer::addObjectContextSubscription(int commandId) { + SUMOTime beginTime = myInputStorage.readInt(); + SUMOTime endTime = myInputStorage.readInt(); + std::string id = myInputStorage.readString(); + int domain = myInputStorage.readUnsignedByte(); + SUMOReal range = myInputStorage.readDouble(); + int no = myInputStorage.readUnsignedByte(); + std::vector variables; + for (int i = 0; i < no; ++i) { + variables.push_back(myInputStorage.readUnsignedByte()); + } + // check subscribe/unsubscribe + if (variables.size() == 0) { + removeSubscription(commandId, id, -1); + return true; + } + Subscription s(commandId, id, variables, beginTime, endTime, true, domain, range); + initialiseSubscription(s); + return true; +} + + void TraCIServer::writeResponseWithLength(tcpip::Storage& outputStorage, tcpip::Storage& tempMsg) { if (tempMsg.size() < 254) { diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServer.h sumo-0.16.0~dfsg/src/traci-server/TraCIServer.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServer.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServer.h 2012-12-02 13:57:49.000000000 +0000 @@ -9,9 +9,9 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2007/10/24 -/// @version $Id: TraCIServer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TraCIServer.h 13107 2012-12-02 13:57:34Z behrisch $ /// -/// TraCI server used to control sumo by a remote TraCI client (e.g., ns2) +/// TraCI server used to control sumo by a remote TraCI client /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -57,41 +57,55 @@ #include #include #include "TraCIException.h" +#include "TraCIRTree.h" #include #include #include + // =========================================================================== // class definitions // =========================================================================== -/** -* @class TraCIServer -*/ namespace traci { -// TraCIServer -// Allows communication of sumo with external program. The external -// program will control sumo. + +/** @class TraCIServer + * @brief TraCI server used to control sumo by a remote TraCI client + */ class TraCIServer : public MSNet::VehicleStateListener { public: /// @brief Definition of a method to be called for serving an associated commandID typedef bool(*CmdExecutor)(traci::TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage); + /// @name Initialisation and Shutdown + /// @{ + /** @brief Initialises the server * @param[in] execs The (additional) command executors to use */ - static void openSocket(const std::map &execs); + static void openSocket(const std::map& execs); + + + /// @brief request termination of connection + static void close(); + + + /** @brief check whether close was requested + * @return Whether the connection was closed + */ + static bool wasClosed(); + /// @} + + + /// @brief process all commands until a simulation step is wanted static void processCommandsUntilSimStep(SUMOTime step); - /// @brief check whether close was requested - static bool wasClosed(); - /// @brief request termination of connection - static void close(); + #ifdef HAVE_PYTHON /// @brief process the command @@ -106,85 +120,157 @@ void writeStatusCmd(int commandId, int status, const std::string& description); void writeStatusCmd(int commandId, int status, const std::string& description, tcpip::Storage& outputStorage); - const std::map > &getVehicleStateChanges() const { + const std::map >& getVehicleStateChanges() const { return myVehicleStateChanges; } - /** @brief Returns the list of (unified) command executors - * - * Not all command executor methods apply to the wanted footprint; other - * comments may be served internally (aka there are more commandIds recognized - * than within this container - * @return Mapped command executors - */ - std::map &getExecutors() { - return myExecutors; - } - void writeResponseWithLength(tcpip::Storage& outputStorage, tcpip::Storage& tempMsg); + void collectObjectsInRange(int domain, const PositionVector& shape, SUMOReal range, std::set& into); -private: - // Constructor +private: + /** @brief Constructor + * @param[in] port The port to listen to (to open) + */ TraCIServer(int port = 0); - // Destructor - // final cleanup + + /// @brief Destructor virtual ~TraCIServer(); - int dispatchCommand(); - void postProcessSimulationStep2(); + /// @name Server-internal command handling + /// @{ + + /** @brief Returns the TraCI-version + * @return Always true + */ bool commandGetVersion(); + + /** @brief Indicates the connection as being closed + * @return Always true + */ bool commandCloseConnection(); + + /** @brief Handles subscriptions to send after a simstep2 command + */ + void postProcessSimulationStep2(); + + + /** @brief Adds a vehicle + * @deprecated Vehicles shall be inserted using the vehicle-API + */ bool commandAddVehicle(); + /// @} + + + - bool addSubscription(int commandId); - /// singleton instance of the server + int dispatchCommand(); + + +private: + /// @brief Singleton instance of the server static TraCIServer* myInstance; + + /// @brief Whether the connection was set to be to close static bool myDoCloseConnection; - /// socket on which server is listening on + /// @brief The socket on which server is listening on tcpip::Socket* mySocket; - // simulation begin and end time + /// @brief The time step to reach until processing the next commands SUMOTime myTargetTime; - + /// @brief The storage to read from tcpip::Storage myInputStorage; + + /// @brief The storage to writeto tcpip::Storage myOutputStorage; + + /// @brief Whether a step is currently done + /// @todo: What is this for? bool myDoingSimStep; + + /// @brief Whether the usage of deprecated methods was already reported bool myHaveWarnedDeprecation; + + /// @brief Whether the server runs in embedded mode const bool myAmEmbedded; /// @brief Map of commandIds -> their executors; applicable if the executor applies to the method footprint std::map myExecutors; + /** @class Subscription + * @brief Representation of a subscription + */ class Subscription { public: - Subscription(int commandIdArg, const std::string& idArg, const std::vector &variablesArg, - SUMOTime beginTimeArg, SUMOTime endTimeArg) - : commandId(commandIdArg), id(idArg), variables(variablesArg), beginTime(beginTimeArg), endTime(endTimeArg) {} + /** @brief Constructor + * @param[in] commandIdArg The command id of the subscription + * @param[in] idArg The id of the object that is subscribed + * @param[in] variablesArg The subscribed variables + * @param[in] beginTimeArg The begin time of the subscription + * @param[in] endTimeArg The end time of the subscription + * @param[in] contextVarsArg Whether the subscription is a context subscription (variable subscription otherwise) + * @param[in] contextDomainArg The domain ID of the context + * @param[in] rangeArg The range of the context + */ + Subscription(int commandIdArg, const std::string& idArg, const std::vector& variablesArg, + SUMOTime beginTimeArg, SUMOTime endTimeArg, bool contextVarsArg, int contextDomainArg, SUMOReal rangeArg) + : commandId(commandIdArg), id(idArg), variables(variablesArg), beginTime(beginTimeArg), endTime(endTimeArg), + contextVars(contextVarsArg), contextDomain(contextDomainArg), range(rangeArg) {} + + /// @brief commandIdArg The command id of the subscription int commandId; + /// @brief The id of the object that is subscribed std::string id; + /// @brief The subscribed variables std::vector variables; + /// @brief The begin time of the subscription SUMOTime beginTime; + /// @brief The end time of the subscription SUMOTime endTime; + /// @brief Whether the subscription is a context subscription (variable subscription otherwise) + bool contextVars; + /// @brief The domain ID of the context + int contextDomain; + /// @brief The range of the context + SUMOReal range; }; + /// @brief The list of known, still valid subscriptions std::vector mySubscriptions; + /// @brief Changes in the states of simulated vehicles + std::map > myVehicleStateChanges; + + /// @brief A storage of objects + std::map myObjects; + + +private: + bool addObjectVariableSubscription(int commandId); + bool addObjectContextSubscription(int commandId); + void initialiseSubscription(const Subscription& s); + void removeSubscription(int commandId, const std::string& identity, int domain); bool processSingleSubscription(const TraCIServer::Subscription& s, tcpip::Storage& writeInto, std::string& errors); - std::map > myVehicleStateChanges; + + bool findObjectShape(int domain, const std::string& id, PositionVector& shape); + + +private: + /// @brief Invalidated assignment operator + TraCIServer& operator=(const TraCIServer& s); }; diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Edge.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Edge.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Edge.cpp 2012-03-08 00:03:24.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Edge.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: TraCIServerAPI_Edge.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: TraCIServerAPI_Edge.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -61,7 +62,6 @@ bool TraCIServerAPI_Edge::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -137,9 +137,9 @@ break; case LAST_STEP_VEHICLE_ID_LIST: { std::vector vehIDs; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { - const std::deque &vehs = (*i)->getVehiclesSecure(); + const std::deque& vehs = (*i)->getVehiclesSecure(); for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { vehIDs.push_back((*j)->getID()); } @@ -151,7 +151,7 @@ break; case VAR_CO2EMISSION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getHBEFA_CO2Emissions(); } @@ -161,7 +161,7 @@ break; case VAR_COEMISSION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getHBEFA_COEmissions(); } @@ -171,7 +171,7 @@ break; case VAR_HCEMISSION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getHBEFA_HCEmissions(); } @@ -181,7 +181,7 @@ break; case VAR_PMXEMISSION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getHBEFA_PMxEmissions(); } @@ -191,7 +191,7 @@ break; case VAR_NOXEMISSION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getHBEFA_NOxEmissions(); } @@ -201,7 +201,7 @@ break; case VAR_FUELCONSUMPTION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getHBEFA_FuelConsumption(); } @@ -211,7 +211,7 @@ break; case VAR_NOISEEMISSION: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (SUMOReal) pow(10., ((*i)->getHarmonoise_NoiseEmissions() / 10.)); } @@ -225,7 +225,7 @@ break; case LAST_STEP_VEHICLE_NUMBER: { int sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getVehicleNumber(); } @@ -235,7 +235,7 @@ break; case LAST_STEP_MEAN_SPEED: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getMeanSpeed(); } @@ -245,7 +245,7 @@ break; case LAST_STEP_OCCUPANCY: { SUMOReal sum = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { sum += (*i)->getOccupancy(); } @@ -255,9 +255,9 @@ break; case LAST_STEP_VEHICLE_HALTING_NUMBER: { int halting = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { - const std::deque &vehs = (*i)->getVehiclesSecure(); + const std::deque& vehs = (*i)->getVehiclesSecure(); for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { if ((*j)->getSpeed() < 0.1) { ++halting; @@ -272,9 +272,9 @@ case LAST_STEP_LENGTH: { SUMOReal lengthSum = 0; int noVehicles = 0; - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { - const std::deque &vehs = (*i)->getVehiclesSecure(); + const std::deque& vehs = (*i)->getVehiclesSecure(); for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { lengthSum += (*j)->getVehicleType().getLength(); } @@ -293,7 +293,7 @@ break; } } - server.writeStatusCmd(CMD_GET_EDGE_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_EDGE_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -325,7 +325,7 @@ return false; } SVCPermissions permissions = parseVehicleClasses(inputStorage.readStringList()); - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { (*i)->setPermissions(permissions); } @@ -339,7 +339,7 @@ return false; } SVCPermissions permissions = ~parseVehicleClasses(inputStorage.readStringList()); // negation yields allowed - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { (*i)->setPermissions(permissions); } @@ -437,7 +437,7 @@ return false; } SUMOReal val = inputStorage.readDouble(); - const std::vector &lanes = e->getLanes(); + const std::vector& lanes = e->getLanes(); for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { (*i)->setMaxSpeed(val); } @@ -451,6 +451,36 @@ } +bool +TraCIServerAPI_Edge::getShape(const std::string& id, PositionVector& shape) { + MSEdge* e = MSEdge::dictionary(id); + if (e == 0) { + return false; + } + const std::vector& lanes = e->getLanes(); + shape.push_back(lanes.front()->getShape()); + if (lanes.size() > 1) { + shape.push_back(lanes.back()->getShape().reverse()); + } + return true; +} + + +TraCIRTree* +TraCIServerAPI_Edge::getTree() { + TraCIRTree* t = new TraCIRTree(); + const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + const std::vector& lanes = (*i)->getLanes(); + Boundary b; + for (std::vector::const_iterator j = lanes.begin(); j != lanes.end(); ++j) { + b.add((*j)->getShape().getBoxBoundary()); + } + t->addObject(*i, b); + } + return t; +} + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Edge.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Edge.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Edge.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Edge.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Edge.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Edge.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ @@ -66,6 +66,20 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named edge's shape + * @param[in] id The id of the searched edge + * @param[out] shape The shape, if the edge is known + * @return Whether the edge is known + */ + static bool getShape(const std::string& id, PositionVector& shape); + + + /** @brief Returns a tree filled with edge instances + * @return The rtree of edges + */ + static TraCIRTree* getTree(); + + private: /// @brief invalidated copy constructor TraCIServerAPI_Edge(const TraCIServerAPI_Edge& s); diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_InductionLoop.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_InductionLoop.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting induction loop values via TraCI /****************************************************************************/ @@ -33,6 +33,7 @@ #ifndef NO_TRACI #include "TraCIConstants.h" +#include #include #include #include "TraCIServerAPI_InductionLoop.h" @@ -54,7 +55,6 @@ bool TraCIServerAPI_InductionLoop::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -162,11 +162,35 @@ break; } } - server.writeStatusCmd(CMD_GET_INDUCTIONLOOP_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_INDUCTIONLOOP_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } + +bool +TraCIServerAPI_InductionLoop::getPosition(const std::string& id, Position& p) { + MSInductLoop* il = static_cast(MSNet::getInstance()->getDetectorControl().getTypedDetectors(SUMO_TAG_INDUCTION_LOOP).get(id)); + if (il == 0) { + return false; + } + p = il->getLane()->getShape().positionAtLengthPosition(il->getPosition()); + return true; +} + + +TraCIRTree* +TraCIServerAPI_InductionLoop::getTree() { + TraCIRTree* t = new TraCIRTree(); + const std::map& dets = MSNet::getInstance()->getDetectorControl().getTypedDetectors(SUMO_TAG_INDUCTION_LOOP).getMyMap(); + for (std::map::const_iterator i = dets.begin(); i != dets.end(); ++i) { + MSInductLoop* il = static_cast((*i).second); + Position p = il->getLane()->getShape().positionAtLengthPosition(il->getPosition()); + t->addObject(il, p); + } + return t; +} + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_InductionLoop.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_InductionLoop.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_InductionLoop.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting induction loop values via TraCI /****************************************************************************/ @@ -57,6 +57,20 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named inductive loop's position + * @param[in] id The id of the searched inductive loop + * @param[out] p The position, if the inductive loop is known + * @return Whether the inductive loop is known (and on road) + */ + static bool getPosition(const std::string& id, Position& p); + + + /** @brief Returns a tree filled with inductive loop instances + * @return The rtree of inductive loop + */ + static TraCIRTree* getTree(); + + private: /// @brief invalidated copy constructor TraCIServerAPI_InductionLoop(const TraCIServerAPI_InductionLoop& s); diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Junction.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Junction.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Junction.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Junction.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Junction.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Junction.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting junction values via TraCI /****************************************************************************/ @@ -33,6 +33,7 @@ #ifndef NO_TRACI #include "TraCIConstants.h" +#include #include #include #include @@ -55,7 +56,6 @@ bool TraCIServerAPI_Junction::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -98,11 +98,34 @@ break; } } - server.writeStatusCmd(CMD_GET_JUNCTION_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_JUNCTION_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } + +bool +TraCIServerAPI_Junction::getPosition(const std::string& id, Position& p) { + MSJunction* j = MSNet::getInstance()->getJunctionControl().get(id); + if (j == 0) { + return false; + } + p = j->getPosition(); + return true; +} + + +TraCIRTree* +TraCIServerAPI_Junction::getTree() { + TraCIRTree* t = new TraCIRTree(); + const std::map& junctions = MSNet::getInstance()->getJunctionControl().getMyMap(); + for (std::map::const_iterator i = junctions.begin(); i != junctions.end(); ++i) { + Boundary b = (*i).second->getShape().getBoxBoundary(); + t->addObject((*i).second, b); + } + return t; +} + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Junction.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Junction.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Junction.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Junction.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Junction.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Junction.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting junction values via TraCI /****************************************************************************/ @@ -57,6 +57,20 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named junction's position + * @param[in] id The id of the searched junction + * @param[out] p The position, if the junction is known + * @return Whether the junction is known (and on road) + */ + static bool getPosition(const std::string& id, Position& p); + + + /** @brief Returns a tree filled with inductive loop instances + * @return The rtree of inductive loop + */ + static TraCIRTree* getTree(); + + private: /// @brief invalidated copy constructor TraCIServerAPI_Junction(const TraCIServerAPI_Junction& s); diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Lane.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Lane.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Lane.cpp 2012-03-09 00:03:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Lane.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Lane.cpp 12040 2012-03-08 07:36:10Z namdre $ +/// @version $Id: TraCIServerAPI_Lane.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting lane values via TraCI /****************************************************************************/ @@ -34,7 +34,9 @@ #ifndef NO_TRACI #include +#include #include +#include #include "TraCIConstants.h" #include "TraCIServerAPI_Lane.h" @@ -55,7 +57,6 @@ bool TraCIServerAPI_Lane::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -108,7 +109,7 @@ break; case VAR_MAXSPEED: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(lane->getMaxSpeed()); + tempMsg.writeDouble(lane->getSpeedLimit()); break; case LANE_LINKS: { tempMsg.writeUnsignedByte(TYPE_COMPOUND); @@ -138,11 +139,11 @@ ++cnt; // opened tempContent.writeUnsignedByte(TYPE_UBYTE); - tempContent.writeUnsignedByte(link->opened(MSNet::getInstance()->getCurrentTimeStep(), MSNet::getInstance()->getCurrentTimeStep(), 0.) ? 1 : 0); + tempContent.writeUnsignedByte(link->opened(MSNet::getInstance()->getCurrentTimeStep(), 0, 0, 0.) ? 1 : 0); ++cnt; // approaching foe tempContent.writeUnsignedByte(TYPE_UBYTE); - tempContent.writeUnsignedByte(link->hasApproachingFoe(MSNet::getInstance()->getCurrentTimeStep(), MSNet::getInstance()->getCurrentTimeStep()) ? 1 : 0); + tempContent.writeUnsignedByte(link->hasApproachingFoe(MSNet::getInstance()->getCurrentTimeStep(), MSNet::getInstance()->getCurrentTimeStep(), 0) ? 1 : 0); ++cnt; // state (not implemented, yet) tempContent.writeUnsignedByte(TYPE_STRING); @@ -220,7 +221,7 @@ break; case LAST_STEP_VEHICLE_ID_LIST: { std::vector vehIDs; - const std::deque &vehs = lane->getVehiclesSecure(); + const std::deque& vehs = lane->getVehiclesSecure(); for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { vehIDs.push_back((*j)->getID()); } @@ -235,7 +236,7 @@ break; case LAST_STEP_VEHICLE_HALTING_NUMBER: { int halting = 0; - const std::deque &vehs = lane->getVehiclesSecure(); + const std::deque& vehs = lane->getVehiclesSecure(); for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { if ((*j)->getSpeed() < 0.1) { ++halting; @@ -248,7 +249,7 @@ break; case LAST_STEP_LENGTH: { SUMOReal lengthSum = 0; - const std::deque &vehs = lane->getVehiclesSecure(); + const std::deque& vehs = lane->getVehiclesSecure(); for (std::deque::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { lengthSum += (*j)->getVehicleType().getLength(); } @@ -279,7 +280,7 @@ break; } } - server.writeStatusCmd(CMD_GET_LANE_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_LANE_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -350,6 +351,32 @@ return true; } + +bool +TraCIServerAPI_Lane::getShape(const std::string& id, PositionVector& shape) { + const MSLane* const l = MSLane::dictionary(id); + if (l == 0) { + return false; + } + shape.push_back(l->getShape()); + return true; +} + + +TraCIRTree* +TraCIServerAPI_Lane::getTree() { + TraCIRTree* t = new TraCIRTree(); + const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + const std::vector& lanes = (*i)->getLanes(); + for (std::vector::const_iterator j = lanes.begin(); j != lanes.end(); ++j) { + Boundary b = (*j)->getShape().getBoxBoundary(); + t->addObject(*j, b); + } + } + return t; +} + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Lane.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Lane.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Lane.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Lane.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Lane.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Lane.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting lane values via TraCI /****************************************************************************/ @@ -67,6 +67,21 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named lane's shape + * + * @param[in] id The id of the searched lane + * @param[out] shape The shape, if the lane is known + * @return Whether the lane is known + */ + static bool getShape(const std::string& id, PositionVector& shape); + + + /** @brief Returns a tree filled with inductive loop instances + * @return The rtree of inductive loop + */ + static TraCIRTree* getTree(); + + private: /// @brief invalidated copy constructor TraCIServerAPI_Lane(const TraCIServerAPI_Lane& s); diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.cpp 2012-09-25 22:01:57.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_MeMeDetector.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_MeMeDetector.cpp 12700 2012-09-10 10:18:34Z dkrajzew $ /// // APIs for getting/setting multi-entry/multi-exit detector values via TraCI /****************************************************************************/ @@ -53,7 +53,6 @@ bool TraCIServerAPI_MeMeDetector::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -111,7 +110,7 @@ break; } } - server.writeStatusCmd(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_POI.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_POI.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_POI.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_POI.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_POI.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_POI.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting POI values via TraCI /****************************************************************************/ @@ -55,7 +55,6 @@ bool TraCIServerAPI_POI::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -74,9 +73,7 @@ if (variable == ID_LIST || variable == ID_COUNT) { std::vector ids; ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer(); ++i) { - shapeCont.getPOICont(i).insertIDs(ids); - } + shapeCont.getPOIs().insertIDs(ids); if (variable == ID_LIST) { tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); @@ -85,11 +82,8 @@ tempMsg.writeInt((int) ids.size()); } } else { - PointOfInterest* p = 0; - ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer() && p == 0; ++i) { - p = shapeCont.getPOICont(i).get(id); - } + int layer; + PointOfInterest* p = getPoI(id, layer); if (p == 0) { server.writeStatusCmd(CMD_GET_POI_VARIABLE, RTYPE_ERR, "POI '" + id + "' is not known", outputStorage); return false; @@ -101,9 +95,9 @@ break; case VAR_COLOR: tempMsg.writeUnsignedByte(TYPE_COLOR); - tempMsg.writeUnsignedByte(static_cast(p->red() * 255. + .5)); - tempMsg.writeUnsignedByte(static_cast(p->green() * 255. + .5)); - tempMsg.writeUnsignedByte(static_cast(p->blue() * 255. + .5)); + tempMsg.writeUnsignedByte(static_cast(p->getColor().red() * 255. + .5)); + tempMsg.writeUnsignedByte(static_cast(p->getColor().green() * 255. + .5)); + tempMsg.writeUnsignedByte(static_cast(p->getColor().blue() * 255. + .5)); tempMsg.writeUnsignedByte(255); break; case VAR_POSITION: @@ -115,7 +109,7 @@ break; } } - server.writeStatusCmd(CMD_GET_POI_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_POI_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -138,10 +132,7 @@ int layer = 0; ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); if (variable != ADD && variable != REMOVE) { - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer() && p == 0; ++i) { - p = shapeCont.getPOICont(i).get(id); - layer = i; - } + p = getPoI(id, layer); if (p == 0) { server.writeStatusCmd(CMD_SET_POI_VARIABLE, RTYPE_ERR, "POI '" + id + "' is not known", outputStorage); return false; @@ -169,7 +160,7 @@ SUMOReal b = (SUMOReal) inputStorage.readUnsignedByte() / 255.; //read SUMOReal a inputStorage.readUnsignedByte(); - dynamic_cast(p)->set(r, g, b); + p->setColor(RGBColor(r, g, b)); } break; case VAR_POSITION: { @@ -179,7 +170,7 @@ } SUMOReal x = inputStorage.readDouble(); SUMOReal y = inputStorage.readDouble(); - shapeCont.movePoI(layer, id, Position(x, y)); + shapeCont.movePOI(id, Position(x, y)); } break; case ADD: { @@ -219,7 +210,10 @@ SUMOReal x = inputStorage.readDouble(); SUMOReal y = inputStorage.readDouble(); // - if (!shapeCont.addPoI(id, layer, type, RGBColor(r, g, b), Position(x, y))) { + if (!shapeCont.addPOI(id, type, RGBColor(r, g, b), (SUMOReal)layer, + Shape::DEFAULT_ANGLE, Shape::DEFAULT_IMG_FILE, + Position(x, y), + Shape::DEFAULT_IMG_WIDTH, Shape::DEFAULT_IMG_HEIGHT)) { delete p; server.writeStatusCmd(CMD_SET_POI_VARIABLE, RTYPE_ERR, "Could not add PoI.", outputStorage); return false; @@ -232,15 +226,8 @@ return false; } layer = inputStorage.readInt(); - if (!shapeCont.removePoI(layer, id)) { - bool removed = false; - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer(); ++i) { - removed |= shapeCont.removePoI(i, id); - } - if (!removed) { - server.writeStatusCmd(CMD_SET_POI_VARIABLE, RTYPE_ERR, "Could not remove PoI '" + id + "'", outputStorage); - return false; - } + if (!shapeCont.removePOI(id)) { + server.writeStatusCmd(CMD_SET_POI_VARIABLE, RTYPE_ERR, "Could not remove PoI '" + id + "'", outputStorage); } } break; @@ -251,6 +238,38 @@ return true; } + +bool +TraCIServerAPI_POI::getPosition(const std::string& id, Position& p) { + int layer; + PointOfInterest* poi = getPoI(id, layer); + if (poi == 0) { + return false; + } + p = *poi; + return true; +} + + +PointOfInterest* +TraCIServerAPI_POI::getPoI(const std::string& id, int& layer) { + ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); + return shapeCont.getPOIs().get(id); +} + + +TraCIRTree* +TraCIServerAPI_POI::getTree() { + TraCIRTree* t = new TraCIRTree(); + ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); + const std::map& pois = shapeCont.getPOIs().getMyMap(); + for (std::map::const_iterator i = pois.begin(); i != pois.end(); ++i) { + t->addObject((*i).second, *(*i).second); + } + return t; +} + + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_POI.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_POI.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_POI.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_POI.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_POI.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_POI.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting POI values via TraCI /****************************************************************************/ @@ -67,6 +67,29 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named PoI's position + * @param[in] id The id of the searched PoI + * @param[out] p The position, if the PoI is known + * @return Whether the PoI is known (and on road) + */ + static bool getPosition(const std::string& id, Position& p); + + + /** @brief Returns a tree filled with inductive loop instances + * @return The rtree of inductive loop + */ + static TraCIRTree* getTree(); + + +private: + /** @brief Returns the named PoI + * @param[in] id The id of the searched PoI + * @param[out] layer The layer the PoI is located in + * @return The named PoI, or 0 if it is not known + */ + static PointOfInterest* getPoI(const std::string& id, int& layer); + + private: /// @brief invalidated copy constructor TraCIServerAPI_POI(const TraCIServerAPI_POI& s); diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: TraCIServerAPI_Polygon.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Polygon.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting polygon values via TraCI /****************************************************************************/ @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include "TraCIConstants.h" #include "TraCIServerAPI_Polygon.h" @@ -56,7 +56,6 @@ bool TraCIServerAPI_Polygon::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -76,9 +75,7 @@ if (variable == ID_LIST || variable == ID_COUNT) { std::vector ids; ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer(); ++i) { - shapeCont.getPolygonCont(i).insertIDs(ids); - } + shapeCont.getPolygons().insertIDs(ids); if (variable == ID_LIST) { tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); @@ -87,11 +84,8 @@ tempMsg.writeInt((int) ids.size()); } } else { - Polygon* p = 0; - ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer() && p == 0; ++i) { - p = shapeCont.getPolygonCont(i).get(id); - } + int layer; + Polygon* p = getPolygon(id, layer); if (p == 0) { server.writeStatusCmd(CMD_GET_POLYGON_VARIABLE, RTYPE_ERR, "Polygon '" + id + "' is not known", outputStorage); return false; @@ -118,13 +112,13 @@ break; case VAR_FILL: tempMsg.writeUnsignedByte(TYPE_UBYTE); - tempMsg.writeUnsignedByte(p->fill() ? 1 : 0); + tempMsg.writeUnsignedByte(p->getFill() ? 1 : 0); break; default: break; } } - server.writeStatusCmd(CMD_GET_POLYGON_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_POLYGON_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -147,10 +141,7 @@ int layer = 0; ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); if (variable != ADD && variable != REMOVE) { - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer() && p == 0; ++i) { - p = shapeCont.getPolygonCont(i).get(id); - layer = i; - } + p = getPolygon(id, layer); if (p == 0) { server.writeStatusCmd(CMD_SET_POLYGON_VARIABLE, RTYPE_ERR, "Polygon '" + id + "' is not known", outputStorage); return false; @@ -193,7 +184,7 @@ SUMOReal y = inputStorage.readDouble(); shape.push_back(Position(x, y)); } - shapeCont.reshapePolygon(layer, id, shape); + shapeCont.reshapePolygon(id, shape); } break; case VAR_FILL: { @@ -253,7 +244,8 @@ shape.push_back(Position(x, y)); } // - if (!shapeCont.addPolygon(id, layer, type, RGBColor(r, g, b), fill, shape)) { + if (!shapeCont.addPolygon(id, type, RGBColor(r, g, b), (SUMOReal)layer, + Shape::DEFAULT_ANGLE, Shape::DEFAULT_IMG_FILE, shape, fill)) { delete p; server.writeStatusCmd(CMD_SET_POLYGON_VARIABLE, RTYPE_ERR, "Could not add polygon.", outputStorage); return false; @@ -262,19 +254,13 @@ break; case REMOVE: { if (valueDataType != TYPE_INTEGER) { - server.writeStatusCmd(CMD_SET_POI_VARIABLE, RTYPE_ERR, "The layer must be given using an int.", outputStorage); + server.writeStatusCmd(CMD_SET_POLYGON_VARIABLE, RTYPE_ERR, "The layer must be given using an int.", outputStorage); return false; } layer = inputStorage.readInt(); - if (!shapeCont.removePolygon(layer, id)) { - bool removed = false; - for (int i = shapeCont.getMinLayer(); i <= shapeCont.getMaxLayer(); ++i) { - removed |= shapeCont.removePolygon(i, id); - } - if (!removed) { - server.writeStatusCmd(CMD_SET_POI_VARIABLE, RTYPE_ERR, "Could not remove PoI '" + id + "'", outputStorage); - return false; - } + if (!shapeCont.removePolygon(id)) { + server.writeStatusCmd(CMD_SET_POLYGON_VARIABLE, RTYPE_ERR, "Could not remove polygon '" + id + "'", outputStorage); + return false; } } break; @@ -285,6 +271,39 @@ return true; } + +bool +TraCIServerAPI_Polygon::getShape(const std::string& id, PositionVector& shape) { + int layer; + Polygon* poly = getPolygon(id, layer); + if (poly == 0) { + return false; + } + shape.push_back(poly->getShape()); + return true; +} + + +Polygon* +TraCIServerAPI_Polygon::getPolygon(const std::string& id, int& layer) { + ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); + return shapeCont.getPolygons().get(id); +} + + +TraCIRTree* +TraCIServerAPI_Polygon::getTree() { + TraCIRTree* t = new TraCIRTree(); + ShapeContainer& shapeCont = MSNet::getInstance()->getShapeContainer(); + const std::map& polygons = shapeCont.getPolygons().getMyMap(); + for (std::map::const_iterator i = polygons.begin(); i != polygons.end(); ++i) { + Boundary b = (*i).second->getShape().getBoxBoundary(); + t->addObject((*i).second, b); + } + return t; +} + + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Polygon.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Polygon.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Polygon.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting polygon values via TraCI /****************************************************************************/ @@ -67,6 +67,30 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named polygons's shape + * + * @param[in] id The id of the searched polygon + * @param[out] shape The shape, if the polygon is known + * @return Whether the polygon is known + */ + static bool getShape(const std::string& id, PositionVector& shape); + + + /** @brief Returns a tree filled with inductive loop instances + * @return The rtree of inductive loop + */ + static TraCIRTree* getTree(); + + +private: + /** @brief Returns the named polygon + * @param[in] id The id of the searched polygon + * @param[out] layer The layer the polygon is located in + * @return The named polygon, or 0 if it is not known + */ + static Polygon* getPolygon(const std::string& id, int& layer); + + private: /// @brief invalidated copy constructor TraCIServerAPI_Polygon(const TraCIServerAPI_Polygon& s); diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Route.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Route.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Route.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Route.cpp 2012-10-25 23:02:23.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Route.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Route.cpp 12887 2012-10-25 11:58:17Z behrisch $ /// // APIs for getting/setting route values via TraCI /****************************************************************************/ @@ -55,7 +55,6 @@ bool TraCIServerAPI_Route::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -99,7 +98,7 @@ break; } } - server.writeStatusCmd(CMD_GET_ROUTE_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_ROUTE_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -129,15 +128,16 @@ int numEdges = inputStorage.readInt(); MSEdgeVector edges; while (numEdges--) { - MSEdge* edge = MSEdge::dictionary(inputStorage.readString()); + std::string edgeID = inputStorage.readString(); + MSEdge* edge = MSEdge::dictionary(edgeID); if (edge == 0) { - server.writeStatusCmd(CMD_SET_ROUTE_VARIABLE, RTYPE_ERR, "Unknown edge in route.", outputStorage); + server.writeStatusCmd(CMD_SET_ROUTE_VARIABLE, RTYPE_ERR, "Unknown edge '" + edgeID + "' in route.", outputStorage); return false; } edges.push_back(edge); } const std::vector stops; - if (!MSRoute::dictionary(id, new MSRoute(id, edges, 1, RGBColor::DEFAULT_COLOR, stops))) { + if (!MSRoute::dictionary(id, new MSRoute(id, edges, 1, 0, stops))) { server.writeStatusCmd(CMD_SET_ROUTE_VARIABLE, RTYPE_ERR, "Could not add route.", outputStorage); return false; } diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Simulation.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Simulation.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Simulation.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Simulation.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: TraCIServerAPI_Simulation.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: TraCIServerAPI_Simulation.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ @@ -42,7 +42,6 @@ #include #include #include "TraCIConstants.h" -#include "TraCIDijkstraRouter.h" #include "TraCIServerAPI_Simulation.h" #ifdef CHECK_MEMORY_LEAKS @@ -62,7 +61,6 @@ bool TraCIServerAPI_Simulation::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -76,6 +74,7 @@ && variable != VAR_DELTA_T && variable != VAR_NET_BOUNDING_BOX && variable != VAR_MIN_EXPECTED_VEHICLES && variable != POSITION_CONVERSION && variable != DISTANCE_REQUEST + && variable != VAR_BUS_STOP_WAITING ) { server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_ERR, "Get Simulation Variable: unsupported variable specified", outputStorage); return false; @@ -93,61 +92,61 @@ tempMsg.writeInt(MSNet::getInstance()->getCurrentTimeStep()); break; case VAR_LOADED_VEHICLES_NUMBER: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_BUILT)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_BUILT)->second; tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt((int) ids.size()); } break; case VAR_LOADED_VEHICLES_IDS: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_BUILT)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_BUILT)->second; tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); } break; case VAR_DEPARTED_VEHICLES_NUMBER: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_DEPARTED)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_DEPARTED)->second; tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt((int) ids.size()); } break; case VAR_DEPARTED_VEHICLES_IDS: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_DEPARTED)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_DEPARTED)->second; tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); } break; case VAR_TELEPORT_STARTING_VEHICLES_NUMBER: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_STARTING_TELEPORT)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_STARTING_TELEPORT)->second; tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt((int) ids.size()); } break; case VAR_TELEPORT_STARTING_VEHICLES_IDS: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_STARTING_TELEPORT)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_STARTING_TELEPORT)->second; tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); } break; case VAR_TELEPORT_ENDING_VEHICLES_NUMBER: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ENDING_TELEPORT)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ENDING_TELEPORT)->second; tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt((int) ids.size()); } break; case VAR_TELEPORT_ENDING_VEHICLES_IDS: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ENDING_TELEPORT)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ENDING_TELEPORT)->second; tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); } break; case VAR_ARRIVED_VEHICLES_NUMBER: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ARRIVED)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ARRIVED)->second; tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt((int) ids.size()); } break; case VAR_ARRIVED_VEHICLES_IDS: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ARRIVED)->second; + const std::vector& ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ARRIVED)->second; tempMsg.writeUnsignedByte(TYPE_STRINGLIST); tempMsg.writeStringList(ids); } @@ -166,12 +165,10 @@ break; } break; - case VAR_MIN_EXPECTED_VEHICLES: { - const std::vector &ids = server.getVehicleStateChanges().find(MSNet::VEHICLE_STATE_ARRIVED)->second; + case VAR_MIN_EXPECTED_VEHICLES: tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt(MSNet::getInstance()->getVehicleControl().getActiveVehicleCount() + MSNet::getInstance()->getInsertionControl().getPendingFlowCount()); - } - break; + break; case POSITION_CONVERSION: if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_ERR, "Position conversion requires a compound object.", outputStorage); @@ -198,10 +195,25 @@ return false; } break; + case VAR_BUS_STOP_WAITING: { + if (inputStorage.readUnsignedByte() != TYPE_STRING) { + server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_ERR, "Retrieval of persons at busstop requires a string.", outputStorage); + return false; + } + std::string id = inputStorage.readString(); + MSBusStop* s = MSNet::getInstance()->getBusStop(id); + if (s == 0) { + server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_ERR, "Unknown bus stop '" + id + "'.", outputStorage); + return false; + } + tempMsg.writeUnsignedByte(TYPE_INTEGER); + tempMsg.writeInt(s->getPersonNumber()); + break; + } default: break; } - server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_SIM_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -215,7 +227,7 @@ allEdgeIds = MSNet::getInstance()->getEdgeControl().getEdgeNames(); for (std::vector::iterator itId = allEdgeIds.begin(); itId != allEdgeIds.end(); itId++) { - const std::vector &allLanes = MSEdge::dictionary((*itId))->getLanes(); + const std::vector& allLanes = MSEdge::dictionary((*itId))->getLanes(); for (std::vector::const_iterator itLane = allLanes.begin(); itLane != allLanes.end(); itLane++) { const SUMOReal newDistance = (*itLane)->getShape().distance(pos); if (newDistance < minDistance) { @@ -250,7 +262,6 @@ bool TraCIServerAPI_Simulation::commandPositionConversion(traci::TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage, int commandId) { - tcpip::Storage tmpResult; std::pair roadPos; Position cartesianPos; Position geoPos; @@ -292,70 +303,49 @@ } break; default: - server.writeStatusCmd(commandId, RTYPE_ERR, - "Source position type not supported"); + server.writeStatusCmd(commandId, RTYPE_ERR, "Source position type not supported"); return false; } + int type = inputStorage.readUnsignedByte(); + if (type != TYPE_UBYTE) { + server.writeStatusCmd(commandId, RTYPE_ERR, "Destination position type must be of type ubyte."); + return false; + } int destPosType = inputStorage.readUnsignedByte(); switch (destPosType) { case POSITION_ROADMAP: { - if (commandId != CMD_POSITIONCONVERSION) { - // skip empty values - inputStorage.readString(); - inputStorage.readDouble(); - inputStorage.readUnsignedByte(); - } // convert road map to 3D position roadPos = convertCartesianToRoadMap(cartesianPos); - // write result that is added to response msg - tmpResult.writeUnsignedByte(POSITION_ROADMAP); - tmpResult.writeString(roadPos.first->getEdge().getID()); - tmpResult.writeDouble(roadPos.second); + outputStorage.writeUnsignedByte(POSITION_ROADMAP); + outputStorage.writeString(roadPos.first->getEdge().getID()); + outputStorage.writeDouble(roadPos.second); const std::vector lanes = roadPos.first->getEdge().getLanes(); - tmpResult.writeUnsignedByte((int)distance(lanes.begin(), find(lanes.begin(), lanes.end(), roadPos.first))); + outputStorage.writeUnsignedByte((int)distance(lanes.begin(), find(lanes.begin(), lanes.end(), roadPos.first))); } break; case POSITION_2D: case POSITION_3D: case POSITION_LAT_LON: case POSITION_LAT_LON_ALT: - if (commandId != CMD_POSITIONCONVERSION) { - // skip empty values - inputStorage.readDouble(); - inputStorage.readDouble(); - if (destPosType != POSITION_2D && destPosType != POSITION_LAT_LON) { - inputStorage.readDouble(); - } - } - tmpResult.writeUnsignedByte(destPosType); - if (srcPosType == POSITION_LAT_LON || srcPosType == POSITION_LAT_LON_ALT) { - tmpResult.writeDouble(geoPos.x()); - tmpResult.writeDouble(geoPos.y()); + outputStorage.writeUnsignedByte(destPosType); + if (destPosType == POSITION_LAT_LON || destPosType == POSITION_LAT_LON_ALT) { + outputStorage.writeDouble(geoPos.x()); + outputStorage.writeDouble(geoPos.y()); } else { - tmpResult.writeDouble(cartesianPos.x()); - tmpResult.writeDouble(cartesianPos.y()); + outputStorage.writeDouble(cartesianPos.x()); + outputStorage.writeDouble(cartesianPos.y()); } if (destPosType != POSITION_2D && destPosType != POSITION_LAT_LON) { - tmpResult.writeDouble(z); + outputStorage.writeDouble(z); } break; default: - server.writeStatusCmd(commandId, RTYPE_ERR, - "Destination position type not supported"); + server.writeStatusCmd(commandId, RTYPE_ERR, "Destination position type not supported"); return false; } - if (commandId == CMD_POSITIONCONVERSION) { - // add converted Position to response - outputStorage.writeUnsignedByte(1 + 1 + (int)tmpResult.size() + 1); // length - outputStorage.writeUnsignedByte(commandId); // command id - outputStorage.writeStorage(tmpResult); // position dependant part - outputStorage.writeUnsignedByte(destPosType); // destination type - } else { - outputStorage.writeStorage(tmpResult); // position dependant part - } return true; } @@ -435,33 +425,22 @@ SUMOReal distance = 0.0; if (distType == REQUEST_DRIVINGDIST) { // compute driving distance - std::vector edges; - TraCIDijkstraRouter router(MSEdge::dictSize()); - - if ((roadPos1.first == roadPos2.first) - && (roadPos1.second <= roadPos2.second)) { + if ((roadPos1.first == roadPos2.first) && (roadPos1.second <= roadPos2.second)) { + // same edge distance = roadPos2.second - roadPos1.second; } else { - router.compute(&roadPos1.first->getEdge(), &roadPos2.first->getEdge(), NULL, - MSNet::getInstance()->getCurrentTimeStep(), edges); - MSRoute route("", edges, false, RGBColor::DEFAULT_COLOR, std::vector()); - distance = route.getDistanceBetween(roadPos1.second, roadPos2.second, - &roadPos1.first->getEdge(), &roadPos2.first->getEdge()); + MSEdgeVector newRoute; + MSNet::getInstance()->getRouterTT().compute( + &roadPos1.first->getEdge(), &roadPos2.first->getEdge(), 0, MSNet::getInstance()->getCurrentTimeStep(), newRoute); + MSRoute route("", newRoute, false, 0, std::vector()); + distance = route.getDistanceBetween(roadPos1.second, roadPos2.second, &roadPos1.first->getEdge(), &roadPos2.first->getEdge()); } } else { // compute air distance (default) - // correct the distance type in case it was not valid - distType = REQUEST_AIRDIST; distance = pos1.distanceTo(pos2); } // write response command - if (commandId == CMD_DISTANCEREQUEST) { - outputStorage.writeUnsignedByte(1 + 1 + 1 + 8); // length - outputStorage.writeUnsignedByte(commandId); - outputStorage.writeUnsignedByte(distType); - } else { - outputStorage.writeUnsignedByte(TYPE_DOUBLE); - } + outputStorage.writeUnsignedByte(TYPE_DOUBLE); outputStorage.writeDouble(distance); return true; } diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_TLS.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_TLS.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_TLS.cpp 2012-03-13 12:52:22.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_TLS.cpp 2012-09-25 22:01:57.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_TLS.cpp 12076 2012-03-13 09:06:31Z namdre $ +/// @version $Id: TraCIServerAPI_TLS.cpp 12700 2012-09-10 10:18:34Z dkrajzew $ /// // APIs for getting/setting traffic light values via TraCI /****************************************************************************/ @@ -54,7 +54,6 @@ bool TraCIServerAPI_TLS::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -223,7 +222,7 @@ break; } } - server.writeStatusCmd(CMD_GET_TL_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_TL_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.cpp 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Bjoern Hendriks /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Vehicle.cpp 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Vehicle.cpp 13120 2012-12-03 11:38:20Z behrisch $ /// // APIs for getting/setting vehicle values via TraCI /****************************************************************************/ @@ -69,7 +69,6 @@ bool TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -80,6 +79,7 @@ && variable != VAR_LANEPOSITION && variable != VAR_CO2EMISSION && variable != VAR_COEMISSION && variable != VAR_HCEMISSION && variable != VAR_PMXEMISSION && variable != VAR_NOXEMISSION && variable != VAR_FUELCONSUMPTION && variable != VAR_NOISEEMISSION + && variable != VAR_PERSON_NUMBER && variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_ROUTE_VALID && variable != VAR_EDGES && variable != VAR_SIGNALS @@ -116,11 +116,17 @@ tempMsg.writeInt((int) ids.size()); } } else { - MSVehicle* v = static_cast(MSNet::getInstance()->getVehicleControl().getVehicle(id)); - if (v == 0) { + SUMOVehicle* sumoVehicle = MSNet::getInstance()->getVehicleControl().getVehicle(id); + if (sumoVehicle == 0) { server.writeStatusCmd(CMD_GET_VEHICLE_VARIABLE, RTYPE_ERR, "Vehicle '" + id + "' is not known", outputStorage); return false; } + MSVehicle* v = dynamic_cast(sumoVehicle); + if (v == 0) { + server.writeStatusCmd(CMD_GET_VEHICLE_VARIABLE, + RTYPE_ERR, "Vehicle '" + id + "' is not a micro-simulation vehicle", outputStorage); + return false; + } const bool onRoad = v->isOnRoad(); switch (variable) { case VAR_SPEED: @@ -151,7 +157,7 @@ case VAR_LANE_INDEX: tempMsg.writeUnsignedByte(TYPE_INTEGER); if (onRoad) { - const std::vector &lanes = v->getLane()->getEdge().getLanes(); + const std::vector& lanes = v->getLane()->getEdge().getLanes(); tempMsg.writeInt((int)std::distance(lanes.begin(), std::find(lanes.begin(), lanes.end(), v->getLane()))); } else { tempMsg.writeInt(INVALID_INT_VALUE); @@ -178,31 +184,35 @@ break; case VAR_CO2EMISSION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeCO2(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeCO2(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); break; case VAR_COEMISSION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeCO(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeCO(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); break; case VAR_HCEMISSION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeHC(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeHC(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); break; case VAR_PMXEMISSION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHBEFA::computePMx(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHBEFA::computePMx(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); break; case VAR_NOXEMISSION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeNOx(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeNOx(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); break; case VAR_FUELCONSUMPTION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeFuel(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHBEFA::computeFuel(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); break; case VAR_NOISEEMISSION: tempMsg.writeUnsignedByte(TYPE_DOUBLE); - tempMsg.writeDouble(onRoad ? HelpersHarmonoise::computeNoise(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getPreDawdleAcceleration()) : INVALID_DOUBLE_VALUE); + tempMsg.writeDouble(onRoad ? HelpersHarmonoise::computeNoise(v->getVehicleType().getEmissionClass(), v->getSpeed(), v->getAcceleration()) : INVALID_DOUBLE_VALUE); + break; + case VAR_PERSON_NUMBER: + tempMsg.writeUnsignedByte(TYPE_INTEGER); + tempMsg.writeInt(v->getPersonNumber()); break; case VAR_EDGE_TRAVELTIME: { if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { @@ -302,7 +312,7 @@ tcpip::Storage tempContent; unsigned int cnt = 0; tempContent.writeUnsignedByte(TYPE_INTEGER); - const std::vector &bestLanes = onRoad ? v->getBestLanes() : std::vector(); + const std::vector& bestLanes = onRoad ? v->getBestLanes() : std::vector(); tempContent.writeInt((int) bestLanes.size()); ++cnt; for (std::vector::const_iterator i = bestLanes.begin(); i != bestLanes.end(); ++i) { @@ -344,7 +354,7 @@ break; } } - server.writeStatusCmd(CMD_GET_VEHICLE_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_VEHICLE_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } @@ -369,18 +379,27 @@ && variable != VAR_TAU && variable != VAR_SPEED && variable != VAR_SPEEDSETMODE && variable != VAR_COLOR && variable != ADD && variable != REMOVE + && variable != VAR_MOVE_TO_VTD ) { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Change Vehicle State: unsupported variable specified", outputStorage); return false; } // id std::string id = inputStorage.readString(); - SUMOVehicle* v = MSNet::getInstance()->getVehicleControl().getVehicle(id); - if (v == 0 && variable != ADD) { - server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Vehicle '" + id + "' is not known", outputStorage); + const bool shouldExist = variable != ADD; + SUMOVehicle* sumoVehicle = MSNet::getInstance()->getVehicleControl().getVehicle(id); + if (sumoVehicle == 0) { + if (shouldExist) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Vehicle '" + id + "' is not known", outputStorage); + return false; + } + } + MSVehicle* v = dynamic_cast(sumoVehicle); + if (v == 0 && shouldExist) { + server.writeStatusCmd(CMD_GET_VEHICLE_VARIABLE, + RTYPE_ERR, "Vehicle '" + id + "' is not a micro-simulation vehicle", outputStorage); return false; } - // process int valueDataType = inputStorage.readUnsignedByte(); switch (variable) { case CMD_STOP: { @@ -429,13 +448,13 @@ server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Unable to retrieve road with given id", outputStorage); return false; } - const std::vector &allLanes = road->getLanes(); + const std::vector& allLanes = road->getLanes(); if ((laneIndex < 0) || laneIndex >= (int)(allLanes.size())) { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "No lane existing with such id on the given road", outputStorage); return false; } // Forward command to vehicle - if (!static_cast(v)->addTraciStop(allLanes[laneIndex], pos, 0, waitTime)) { + if (!v->addTraciStop(allLanes[laneIndex], pos, 0, waitTime)) { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Vehicle is too close or behind the stop on " + allLanes[laneIndex]->getID(), outputStorage); return false; } @@ -472,10 +491,10 @@ std::vector > laneTimeLine; laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), laneIndex)); laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep() + stickyTime, laneIndex)); - static_cast(v)->getInfluencer().setLaneTimeLine(laneTimeLine); - MSVehicle::ChangeRequest req = static_cast(v)->getInfluencer().checkForLaneChanges(MSNet::getInstance()->getCurrentTimeStep(), - *static_cast(v)->getEdge(), static_cast(v)->getLaneIndex()); - static_cast(v)->getLaneChangeModel().requestLaneChange(req); + v->getInfluencer().setLaneTimeLine(laneTimeLine); + MSVehicle::ChangeRequest req = v->getInfluencer().checkForLaneChanges(MSNet::getInstance()->getCurrentTimeStep(), + *v->getEdge(), v->getLaneIndex()); + v->getLaneChangeModel().requestLaneChange(req); } break; case CMD_SLOWDOWN: { @@ -508,7 +527,7 @@ std::vector > speedTimeLine; speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), v->getSpeed())); speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep() + duration, newSpeed)); - static_cast(v)->getInfluencer().setSpeedTimeLine(speedTimeLine); + v->getInfluencer().setSpeedTimeLine(speedTimeLine); } break; case CMD_CHANGETARGET: { @@ -525,10 +544,8 @@ // build a new route between the vehicle's current edge and destination edge MSEdgeVector newRoute; const MSEdge* currentEdge = v->getEdge(); - MSEdgeWeightsStorage empty; - MSNet::EdgeWeightsProxi proxi(empty, MSNet::getInstance()->getWeightsStorage()); - DijkstraRouterTT_ByProxi, MSNet::EdgeWeightsProxi> router(MSEdge::dictSize(), true, &proxi, &MSNet::EdgeWeightsProxi::getTravelTime); - router.compute(currentEdge, destEdge, (const MSVehicle * const) v, MSNet::getInstance()->getCurrentTimeStep(), newRoute); + MSNet::getInstance()->getRouterTT().compute( + currentEdge, destEdge, (const MSVehicle * const) v, MSNet::getInstance()->getCurrentTimeStep(), newRoute); // replace the vehicle's route by the new one if (!v->replaceRouteEdges(newRoute)) { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Route replacement failed for " + v->getID(), outputStorage); @@ -604,7 +621,7 @@ } SUMOReal value = inputStorage.readDouble(); // retrieve - static_cast(v)->getWeightsStorage().addTravelTime(edge, begTime, endTime, value); + v->getWeightsStorage().addTravelTime(edge, begTime, endTime, value); } else if (parameterCount == 2) { // edge if (inputStorage.readUnsignedByte() != TYPE_STRING) { @@ -624,10 +641,10 @@ } SUMOReal value = inputStorage.readDouble(); // retrieve - while (static_cast(v)->getWeightsStorage().knowsTravelTime(edge)) { - static_cast(v)->getWeightsStorage().removeTravelTime(edge); + while (v->getWeightsStorage().knowsTravelTime(edge)) { + v->getWeightsStorage().removeTravelTime(edge); } - static_cast(v)->getWeightsStorage().addTravelTime(edge, 0, SUMOTime_MAX, value); + v->getWeightsStorage().addTravelTime(edge, 0, SUMOTime_MAX, value); } else if (parameterCount == 1) { // edge if (inputStorage.readUnsignedByte() != TYPE_STRING) { @@ -641,8 +658,8 @@ return false; } // retrieve - while (static_cast(v)->getWeightsStorage().knowsTravelTime(edge)) { - static_cast(v)->getWeightsStorage().removeTravelTime(edge); + while (v->getWeightsStorage().knowsTravelTime(edge)) { + v->getWeightsStorage().removeTravelTime(edge); } } else { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Setting travel time requires 1, 2, or 4 parameters.", outputStorage); @@ -687,7 +704,7 @@ } SUMOReal value = inputStorage.readDouble(); // retrieve - static_cast(v)->getWeightsStorage().addEffort(edge, begTime, endTime, value); + v->getWeightsStorage().addEffort(edge, begTime, endTime, value); } else if (parameterCount == 2) { // edge if (inputStorage.readUnsignedByte() != TYPE_STRING) { @@ -707,10 +724,10 @@ } SUMOReal value = inputStorage.readDouble(); // retrieve - while (static_cast(v)->getWeightsStorage().knowsEffort(edge)) { - static_cast(v)->getWeightsStorage().removeEffort(edge); + while (v->getWeightsStorage().knowsEffort(edge)) { + v->getWeightsStorage().removeEffort(edge); } - static_cast(v)->getWeightsStorage().addEffort(edge, 0, SUMOTime_MAX, value); + v->getWeightsStorage().addEffort(edge, 0, SUMOTime_MAX, value); } else if (parameterCount == 1) { // edge if (inputStorage.readUnsignedByte() != TYPE_STRING) { @@ -724,8 +741,8 @@ return false; } // retrieve - while (static_cast(v)->getWeightsStorage().knowsEffort(edge)) { - static_cast(v)->getWeightsStorage().removeEffort(edge); + while (v->getWeightsStorage().knowsEffort(edge)) { + v->getWeightsStorage().removeEffort(edge); } } else { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Setting effort requires 1, 2, or 4 parameters.", outputStorage); @@ -742,9 +759,7 @@ server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Rerouting should obtain an empty compound object.", outputStorage); return false; } - MSNet::EdgeWeightsProxi proxi(static_cast(v)->getWeightsStorage(), MSNet::getInstance()->getWeightsStorage()); - DijkstraRouterTT_ByProxi, MSNet::EdgeWeightsProxi> router(MSEdge::dictSize(), true, &proxi, &MSNet::EdgeWeightsProxi::getTravelTime); - v->reroute(MSNet::getInstance()->getCurrentTimeStep(), router); + v->reroute(MSNet::getInstance()->getCurrentTimeStep(), MSNet::getInstance()->getRouterTT()); } break; case CMD_REROUTE_EFFORT: { @@ -756,9 +771,7 @@ server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Rerouting should obtain an empty compound object.", outputStorage); return false; } - MSNet::EdgeWeightsProxi proxi(static_cast(v)->getWeightsStorage(), MSNet::getInstance()->getWeightsStorage()); - DijkstraRouterEffort_ByProxi, MSNet::EdgeWeightsProxi> router(MSEdge::dictSize(), true, &proxi, &MSNet::EdgeWeightsProxi::getEffort, &MSNet::EdgeWeightsProxi::getTravelTime); - v->reroute(MSNet::getInstance()->getCurrentTimeStep(), router); + v->reroute(MSNet::getInstance()->getCurrentTimeStep(), MSNet::getInstance()->getRouterEffort()); } break; case VAR_SIGNALS: @@ -766,8 +779,8 @@ server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Setting signals requires an integer.", outputStorage); return false; } - static_cast(v)->switchOffSignal(0x0fffffff); - static_cast(v)->switchOnSignal(inputStorage.readInt()); + v->switchOffSignal(0x0fffffff); + v->switchOnSignal(inputStorage.readInt()); break; case VAR_MOVE_TO: { if (valueDataType != TYPE_COMPOUND) { @@ -797,21 +810,21 @@ return false; } MSEdge& destinationEdge = l->getEdge(); - if (!static_cast(v)->willPass(&destinationEdge)) { + if (!v->willPass(&destinationEdge)) { server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Vehicle '" + laneID + "' may be set onto an edge to pass only.", outputStorage); return false; } - static_cast(v)->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT); - static_cast(v)->getLane()->removeVehicle(static_cast(v)); + v->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT); + v->getLane()->removeVehicle(v); while (v->getEdge() != &destinationEdge) { const MSEdge* nextEdge = v->succEdge(1); // let the vehicle move to the next edge - if (static_cast(v)->enterLaneAtMove(nextEdge->getLanes()[0], true)) { + if (v->enterLaneAtMove(nextEdge->getLanes()[0], true)) { MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(v); continue; } } - l->forceVehicleInsertion(static_cast(v), position); + l->forceVehicleInsertion(v, position); } break; case VAR_SPEED: { @@ -825,7 +838,7 @@ speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), speed)); speedTimeLine.push_back(std::make_pair(SUMOTime_MAX, speed)); } - static_cast(v)->getInfluencer().setSpeedTimeLine(speedTimeLine); + v->getInfluencer().setSpeedTimeLine(speedTimeLine); } break; case VAR_SPEEDSETMODE: { @@ -834,9 +847,9 @@ return false; } int speedMode = inputStorage.readInt(); - static_cast(v)->getInfluencer().setConsiderSafeVelocity((speedMode & 1) != 0); - static_cast(v)->getInfluencer().setConsiderMaxAcceleration((speedMode & 2) != 0); - static_cast(v)->getInfluencer().setConsiderMaxDeceleration((speedMode & 4) != 0); + v->getInfluencer().setConsiderSafeVelocity((speedMode & 1) != 0); + v->getInfluencer().setConsiderMaxAcceleration((speedMode & 2) != 0); + v->getInfluencer().setConsiderMaxDeceleration((speedMode & 4) != 0); } break; case VAR_COLOR: { @@ -849,6 +862,7 @@ SUMOReal b = (SUMOReal) inputStorage.readUnsignedByte() / 255.; inputStorage.readUnsignedByte(); // skip alpha level v->getParameter().color.set(r, g, b); + v->getParameter().setParameter |= VEHPARS_COLOR_SET; } break; case ADD: { @@ -871,9 +885,10 @@ server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "First parameter (type) requires a string.", outputStorage); return false; } - MSVehicleType* vehicleType = MSNet::getInstance()->getVehicleControl().getVType(inputStorage.readString()); + std::string vTypeID = inputStorage.readString(); + MSVehicleType* vehicleType = MSNet::getInstance()->getVehicleControl().getVType(vTypeID); if (!vehicleType) { - server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Invalid type for vehicle: '" + id + "'"); + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Invalid type '" + vTypeID + "' for vehicle '" + id + "'"); return false; } @@ -970,26 +985,175 @@ int why = (int) inputStorage.readByte(); MSMoveReminder::Notification n = MSMoveReminder::NOTIFICATION_ARRIVED; switch (why) { - case 0: + case REMOVE_TELEPORT: n = MSMoveReminder::NOTIFICATION_TELEPORT; break; - case 1: + case REMOVE_PARKING: n = MSMoveReminder::NOTIFICATION_PARKING; break; - case 2: + case REMOVE_ARRIVED: n = MSMoveReminder::NOTIFICATION_ARRIVED; break; - case 3: + case REMOVE_VAPORIZED: n = MSMoveReminder::NOTIFICATION_VAPORIZED; break; - case 4: - default: + case REMOVE_TELEPORT_ARRIVED: n = MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED; break; + default: + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Unknown removal status.", outputStorage); + return false; + } + v->onRemovalFromNet(n); + v->getLane()->removeVehicle(v); + MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(v); + } + break; + case VAR_MOVE_TO_VTD: { + if (valueDataType != TYPE_COMPOUND) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Setting VTD vehicle requires a compound object.", outputStorage); + return false; + } + if (inputStorage.readInt() != 4) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "Setting VTD vehicle should obtain: edgeID, lane, x, y.", outputStorage); + return false; + } + // edge ID + if (inputStorage.readUnsignedByte() != TYPE_STRING) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "The first parameter for setting a VTD vehicle must be the edge ID given as a string.", outputStorage); + return false; + } + std::string edgeID = inputStorage.readString(); + // lane index + if (inputStorage.readUnsignedByte() != TYPE_INTEGER) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "The second parameter for setting a VTD vehicle must be lane given as an int.", outputStorage); + return false; + } + int laneNum = inputStorage.readInt(); + // x + if (inputStorage.readUnsignedByte() != TYPE_DOUBLE) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "The third parameter for setting a VTD vehicle must be the x-position given as a double.", outputStorage); + return false; + } + SUMOReal x = inputStorage.readDouble(); + // y + if (inputStorage.readUnsignedByte() != TYPE_DOUBLE) { + server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "The fourth parameter for setting a VTD vehicle must be the y-position given as a double.", outputStorage); + return false; + } + SUMOReal y = inputStorage.readDouble(); + //if (inputStorage.readUnsignedByte() != TYPE_DOUBLE) { + // server.writeStatusCmd(CMD_SET_VEHICLE_VARIABLE, RTYPE_ERR, "The fifth parameter for setting a VTD vehicle must be the speed given as a double.", outputStorage); + // return false; + //} + //SUMOReal speed = inputStorage.readDouble(); + // process + if (!v->isOnRoad()) { + break; + } + std::string origID = edgeID + " " + toString(laneNum); + if (laneNum < 0) { + edgeID = '-' + edgeID; + laneNum = -laneNum; + } + // + Position pos(x, y); + unsigned int r = 0; + SUMOReal minDist = 1 << (11); + MSLane* minDistLane = 0; + MSLane* nameMatchingLane = 0; + SUMOReal minDistNameMatchingLane = 1 << (11); + for (; minDistLane == 0 && r < 10 && nameMatchingLane == 0; ++r) { + std::set into; + PositionVector shape; + shape.push_back(pos); + server.collectObjectsInRange(CMD_GET_EDGE_VARIABLE, shape, 1 << r, into); + for (std::set::const_iterator j = into.begin(); j != into.end(); ++j) { + MSEdge* e = MSEdge::dictionary(*j); + const std::vector& lanes = e->getLanes(); + for (std::vector::const_iterator k = lanes.begin(); k != lanes.end(); ++k) { + MSLane* lane = *k; + bool nameMatches = false; + SUMOReal dist = lane->getShape().distance(pos); + if (lane->knowsParameter("origId")) { + if (lane->getParameter("origId", "") == origID) { + nameMatches = true; + if (dist < minDistNameMatchingLane) { + minDistNameMatchingLane = dist; + nameMatchingLane = lane; + } + } + } + if (dist < minDist) { + minDist = dist; + minDistLane = lane; + } + } + } + } + MSLane* lane = nameMatchingLane != 0 ? nameMatchingLane : minDistLane; + if (lane != v->getLane()) { + MSEdge& destinationEdge = lane->getEdge(); + MSEdge* routePos = &destinationEdge; + while (routePos->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + routePos = &routePos->getLanes()[0]->getLogicalPredecessorLane()->getEdge(); + } + r = 0; + const MSRoute& route = v->getRoute(); + unsigned int c = v->getRoutePosition(); + unsigned int l = (int)route.getEdges().size(); + unsigned int rindex = 0; + bool found = false; + while (!found && ((int)(c - r) >= 0 || c + r < l)) { + if ((int)(c - r) >= 0 && route[c - r] == routePos) { + rindex = c - r; + found = true; + } + if (c + r < l && route[c + r] == routePos) { + rindex = c + r; + found = true; + } + ++r; + } + if (v->isOnRoad()) { + v->getLane()->removeVehicle(v); + v->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT); + } + if (!found) { + MSEdgeVector edges; + MSLane* firstLane = lane; + if (destinationEdge.getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) { + edges.push_back(&destinationEdge); + } else { + firstLane = lane->getLogicalPredecessorLane(); + edges.push_back(&firstLane->getEdge()); + } + const MSLinkCont& lc = firstLane->getLinkCont(); + if (lc.size() != 0 && lc[0]->getLane() != 0) { + edges.push_back(&lc[0]->getLane()->getEdge()); + } + v->replaceRouteEdges(edges, true); + } else { + v->resetRoutePosition(rindex); + } + } else { + v->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT); + v->getLane()->removeVehicle(v); + } + /* + std::vector > speedTimeLine; + if (speed >= 0) { + speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), speed)); + speedTimeLine.push_back(std::make_pair(SUMOTime_MAX, speed)); } - static_cast(v)->onRemovalFromNet(n); - static_cast(v)->getLane()->removeVehicle(static_cast(v)); - MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(static_cast(v)); + v->getInfluencer().setSpeedTimeLine(speedTimeLine); + */ + + const SUMOReal position = lane->interpolateGeometryPosToLanePos( + lane->getShape().nearest_position_on_line_to_point2D(pos, false)); + lane->forceVehicleInsertion(v, position); + //v->getInfluencer().setPosition(position); + v->getBestLanes(true, lane); } break; default: @@ -1076,7 +1240,19 @@ return true; } + // ------ helper functions ------ +bool +TraCIServerAPI_Vehicle::getPosition(const std::string& id, Position& p) { + MSVehicle* v = dynamic_cast(MSNet::getInstance()->getVehicleControl().getVehicle(id)); + if (v == 0) { + return false; + } + p = v->getPosition(); + return true; +} + + MSVehicleType& TraCIServerAPI_Vehicle::getSingularType(SUMOVehicle* const veh) { const MSVehicleType& oType = veh->getVehicleType(); @@ -1086,6 +1262,7 @@ return *type; } + #endif diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.h sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.h --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_Vehicle.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Vehicle.h 11745 2012-01-20 07:47:11Z dkrajzew $ +/// @version $Id: TraCIServerAPI_Vehicle.h 13107 2012-12-02 13:57:34Z behrisch $ /// // APIs for getting/setting vehicle values via TraCI /****************************************************************************/ @@ -68,11 +68,19 @@ tcpip::Storage& outputStorage); + /** @brief Returns the named vehicle's position + * @param[in] id The id of the searched vehicle + * @param[out] p The position, if the vehicle is on the network + * @return Whether the vehicle is known (and on road) + */ + static bool getPosition(const std::string& id, Position& p); + + private: static bool commandDistanceRequest(traci::TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage, const MSVehicle* v); - static MSVehicleType& getSingularType(SUMOVehicle* const veh) ; + static MSVehicleType& getSingularType(SUMOVehicle* const veh); private: diff -Nru sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_VehicleType.cpp sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_VehicleType.cpp --- sumo-0.15.0~dfsg/src/traci-server/TraCIServerAPI_VehicleType.cpp 2012-01-29 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci-server/TraCIServerAPI_VehicleType.cpp 2012-09-25 22:01:57.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_VehicleType.cpp 11808 2012-01-28 21:36:11Z behrisch $ +/// @version $Id: TraCIServerAPI_VehicleType.cpp 12700 2012-09-10 10:18:34Z dkrajzew $ /// // APIs for getting/setting vehicle type values via TraCI /****************************************************************************/ @@ -56,7 +56,6 @@ bool TraCIServerAPI_VehicleType::processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage) { - std::string warning = ""; // additional description for response // variable & id int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); @@ -93,7 +92,7 @@ } getVariable(variable, *v, tempMsg); } - server.writeStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, RTYPE_OK, warning, outputStorage); + server.writeStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); return true; } diff -Nru sumo-0.15.0~dfsg/src/traci_testclient/Makefile.am sumo-0.16.0~dfsg/src/traci_testclient/Makefile.am --- sumo-0.15.0~dfsg/src/traci_testclient/Makefile.am 2010-04-30 23:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci_testclient/Makefile.am 2012-09-25 22:01:46.000000000 +0000 @@ -8,6 +8,6 @@ TraCITestClient_SOURCES = tracitestclient_main.cpp TraCITestClient.cpp TraCITestClient.h TraCITestClient_LDADD = ../utils/common/libcommon.a \ -../foreign/tcpip/libtcpip.a \ +../utils/traci/libtraci.a ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) endif diff -Nru sumo-0.15.0~dfsg/src/traci_testclient/Makefile.in sumo-0.16.0~dfsg/src/traci_testclient/Makefile.in --- sumo-0.15.0~dfsg/src/traci_testclient/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci_testclient/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -56,6 +56,7 @@ TraCITestClient_OBJECTS = $(am_TraCITestClient_OBJECTS) @TRACI_TRUE@TraCITestClient_DEPENDENCIES = \ @TRACI_TRUE@ ../utils/common/libcommon.a \ +@TRACI_TRUE@ ../utils/traci/libtraci.a \ @TRACI_TRUE@ ../foreign/tcpip/libtcpip.a $(MEM_LIBS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -106,6 +107,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -136,6 +138,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -170,6 +173,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -203,7 +207,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -226,7 +229,7 @@ @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a @TRACI_TRUE@TraCITestClient_SOURCES = tracitestclient_main.cpp TraCITestClient.cpp TraCITestClient.h @TRACI_TRUE@TraCITestClient_LDADD = ../utils/common/libcommon.a \ -@TRACI_TRUE@../foreign/tcpip/libtcpip.a \ +@TRACI_TRUE@../utils/traci/libtraci.a ../foreign/tcpip/libtcpip.a \ @TRACI_TRUE@$(MEM_LIBS) all: all-am diff -Nru sumo-0.15.0~dfsg/src/traci_testclient/TraCITestClient.cpp sumo-0.16.0~dfsg/src/traci_testclient/TraCITestClient.cpp --- sumo-0.15.0~dfsg/src/traci_testclient/TraCITestClient.cpp 2012-01-10 00:02:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci_testclient/TraCITestClient.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,9 +6,9 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date 2008/04/07 -/// @version $Id: TraCITestClient.cpp 11677 2012-01-09 11:08:19Z namdre $ +/// @version $Id: TraCITestClient.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// -/// A dummy client to simulate communication to a TraCI server +/// A test execution class /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -60,11 +60,8 @@ // =========================================================================== // method definitions // =========================================================================== - TraCITestClient::TraCITestClient(std::string outputFileName) - : socket(NULL), - outputFileName(outputFileName), - answerLog("") { + : outputFileName(outputFileName), answerLog("") { answerLog.setf(std::ios::fixed , std::ios::floatfield); // use decimal format answerLog.setf(std::ios::showpoint); // print decimal point answerLog << std::setprecision(2); @@ -73,59 +70,6 @@ TraCITestClient::~TraCITestClient() { writeResult(); - delete socket; -} - - -void -TraCITestClient::writeResult() { - time_t seconds; - tm* locTime; - - std::ofstream outFile(outputFileName.c_str()); - if (!outFile) { - std::cerr << "Unable to write result file" << std::endl; - } - time(&seconds); - locTime = localtime(&seconds); - outFile << "TraCITestClient output file. Date: " << asctime(locTime) << std::endl; - outFile << answerLog.str(); - outFile.close(); -} - - -void -TraCITestClient::errorMsg(std::stringstream& msg) { - std::cerr << msg.str() << std::endl; - answerLog << "----" << std::endl << msg.str() << std::endl; -} - - -bool -TraCITestClient::connect(int port, std::string host) { - std::stringstream msg; - socket = new tcpip::Socket(host, port); - - //socket->set_blocking(true); - - try { - socket->connect(); - } catch (tcpip::SocketException& e) { - msg << "#Error while connecting: " << e.what(); - errorMsg(msg); - return false; - } - - return true; -} - - -bool -TraCITestClient::close() { - if (socket != NULL) { - socket->close(); - } - return true; } @@ -139,13 +83,18 @@ int repNo = 1; bool commentRead = false; - if (!connect(port, host)) { + // try to connect + try { + TraCIAPI::connect(host, port); + } catch (tcpip::SocketException& e) { + std::stringstream msg; + msg << "#Error while connecting: " << e.what(); + errorMsg(msg); return false; } // read definition file and trigger commands according to it defFile.open(fileName.c_str()); - if (!defFile) { msg << "Can not open definition file " << fileName << std::endl; errorMsg(msg); @@ -173,93 +122,8 @@ std::string time; defFile >> time; for (int i = 0; i < repNo; i++) { - commandSimulationStep2(string2time(time)); + commandSimulationStep(string2time(time)); } - } else if (lineCommand.compare("posconversion2d") == 0) { - // trigger command PositionConversion for a 2d position - testclient::Position pos; - int destFormat; - - defFile >> pos.x; - defFile >> pos.y; - defFile >> destFormat; - commandPositionConversion(pos, destFormat); - } else if (lineCommand.compare("posconversion3d") == 0) { - // trigger command PositionConversion for a 3d position - testclient::Position3D pos; - int destFormat; - - defFile >> pos.x; - defFile >> pos.y; - defFile >> pos.z; - defFile >> destFormat; - commandPositionConversion(pos, destFormat); - } else if (lineCommand.compare("posconversion_roadpos") == 0) { - // trigger command PositionConversion for a road map position - testclient::PositionRoadMap pos; - int destFormat; - - defFile >> pos.roadId; - defFile >> pos.pos; - defFile >> pos.laneId; - defFile >> destFormat; - commandPositionConversion(pos, destFormat); - } else if (lineCommand.compare("distancerequest_3d_3d") == 0) { - // trigger command DistanceRequest for 2 3D positions - testclient::Position3D pos1; - testclient::Position3D pos2; - int flag; - - defFile >> pos1.x; - defFile >> pos1.y; - defFile >> pos1.z; - defFile >> pos2.x; - defFile >> pos2.y; - defFile >> pos2.z; - defFile >> flag; - commandDistanceRequest(pos1, pos2, flag); - } else if (lineCommand.compare("distancerequest_3d_roadpos") == 0) { - // trigger command DistanceRequest for 3D and road map position - testclient::Position3D pos1; - testclient::PositionRoadMap pos2; - int flag; - - defFile >> pos1.x; - defFile >> pos1.y; - defFile >> pos1.z; - defFile >> pos2.roadId; - defFile >> pos2.pos; - defFile >> pos2.laneId; - defFile >> flag; - commandDistanceRequest(pos1, pos2, flag); - } else if (lineCommand.compare("distancerequest_roadpos_3d") == 0) { - // trigger command DistanceRequest for road map and 3D position - testclient::PositionRoadMap pos1; - testclient::Position3D pos2; - int flag; - - defFile >> pos1.roadId; - defFile >> pos1.pos; - defFile >> pos1.laneId; - defFile >> pos2.x; - defFile >> pos2.y; - defFile >> pos2.z; - defFile >> flag; - commandDistanceRequest(pos1, pos2, flag); - } else if (lineCommand.compare("distancerequest_roadpos_roadpos") == 0) { - // trigger command DistanceRequest for 2 road map positions - testclient::PositionRoadMap pos1; - testclient::PositionRoadMap pos2; - int flag; - - defFile >> pos1.roadId; - defFile >> pos1.pos; - defFile >> pos1.laneId; - defFile >> pos2.roadId; - defFile >> pos2.pos; - defFile >> pos2.laneId; - defFile >> flag; - commandDistanceRequest(pos1, pos2, flag); } else if (lineCommand.compare("getvariable") == 0) { // trigger command GetXXXVariable int domID, varID; @@ -271,14 +135,29 @@ int domID, varID; std::string objID; defFile >> domID >> varID >> objID; - commandGetVariablePlus(domID, varID, objID, defFile); + std::stringstream msg; + tcpip::Storage tmp; + const int dataLength = setValueTypeDependant(tmp, defFile, msg); + std::string msgS = msg.str(); + if (msgS != "") { + errorMsg(msg); + } + commandGetVariable(domID, varID, objID, &tmp); } else if (lineCommand.compare("subscribevariable") == 0) { // trigger command SubscribeXXXVariable int domID, varNo; std::string beginTime, endTime; std::string objID; defFile >> domID >> objID >> beginTime >> endTime >> varNo; - commandSubscribeVariable(domID, objID, string2time(beginTime), string2time(endTime), varNo, defFile); + commandSubscribeObjectVariable(domID, objID, string2time(beginTime), string2time(endTime), varNo, defFile); + } else if (lineCommand.compare("subscribecontext") == 0) { + // trigger command SubscribeXXXVariable + int domID, varNo, domain; + SUMOReal range; + std::string beginTime, endTime; + std::string objID; + defFile >> domID >> objID >> beginTime >> endTime >> domain >> range >> varNo; + commandSubscribeContextVariable(domID, objID, string2time(beginTime), string2time(endTime), domain, range, varNo, defFile); } else if (lineCommand.compare("setvalue") == 0) { // trigger command SetXXXValue int domID, varID; @@ -286,8 +165,7 @@ defFile >> domID >> varID >> objID; commandSetValue(domID, varID, objID, defFile); } else { - msg << "Error in definition file: " << lineCommand - << " is not a valid command"; + msg << "Error in definition file: " << lineCommand << " is not a valid command"; errorMsg(msg); commandClose(); close(); @@ -301,567 +179,247 @@ } -bool -TraCITestClient::reportResultState(tcpip::Storage& inMsg, int command, bool ignoreCommandId) { - int cmdLength; - int cmdId; - int resultType; - int cmdStart; - std::string msg; - +// ---------- Commands handling +void +TraCITestClient::commandSimulationStep(SUMOTime time) { + send_commandSimulationStep(time); + answerLog << std::endl << "-> Command sent: :" << std::endl; + tcpip::Storage inMsg; try { - cmdStart = inMsg.position(); - cmdLength = inMsg.readUnsignedByte(); - cmdId = inMsg.readUnsignedByte(); - if (cmdId != command && !ignoreCommandId) { - answerLog << "#Error: received status response to command: " << cmdId - << " but expected: " << command << std::endl; - return false; - } - resultType = inMsg.readUnsignedByte(); - msg = inMsg.readString(); - } catch (std::invalid_argument&) { - answerLog << "#Error: an exception was thrown while reading result state message" << std::endl; - return false; - } - switch (resultType) { - case RTYPE_ERR: - answerLog << ".. Answered with error to command (" << cmdId << "), [description: " << msg << "]" << std::endl; - return false; - case RTYPE_NOTIMPLEMENTED: - answerLog << ".. Sent command is not implemented (" << cmdId << "), [description: " << msg << "]" << std::endl; - return false; - case RTYPE_OK: - answerLog << ".. Command acknowledged (" << cmdId << "), [description: " << msg << "]" << std::endl; - break; - default: - answerLog << ".. Answered with unknown result code(" << resultType << ") to command(" << cmdId - << "), [description: " << msg << "]" << std::endl; - return false; - } - if ((cmdStart + cmdLength) != inMsg.position()) { - answerLog << "#Error: command at position " << cmdStart << " has wrong length" << std::endl; - return false; + std::string acknowledgement; + check_resultState(inMsg, CMD_SIMSTEP2, false, &acknowledgement); + answerLog << acknowledgement << std::endl; + validateSimulationStep2(inMsg); + } catch (tcpip::SocketException& e) { + answerLog << e.what() << std::endl; } - - return true; } void -TraCITestClient::commandSimulationStep2(SUMOTime time) { - tcpip::Storage outMsg; - tcpip::Storage inMsg; - std::stringstream msg; - - if (socket == NULL) { - msg << "#Error while sending command: no connection to server"; - errorMsg(msg); - return; +TraCITestClient::commandClose() { + send_commandClose(); + answerLog << std::endl << "-> Command sent: :" << std::endl; + try { + tcpip::Storage inMsg; + std::string acknowledgement; + check_resultState(inMsg, CMD_CLOSE, false, &acknowledgement); + answerLog << acknowledgement << std::endl; + } catch (tcpip::SocketException& e) { + answerLog << e.what() << std::endl; } +} - // command length - outMsg.writeUnsignedByte(1 + 1 + 4); - // command id - outMsg.writeUnsignedByte(CMD_SIMSTEP2); - outMsg.writeInt(time); - // send request message + +void +TraCITestClient::commandGetVariable(int domID, int varID, const std::string& objID, tcpip::Storage* addData) { + send_commandGetVariable(domID, varID, objID, addData); + answerLog << std::endl << "-> Command sent: :" << std::endl + << " domID=" << domID << " varID=" << varID + << " objID=" << objID << std::endl; + tcpip::Storage inMsg; try { - socket->sendExact(outMsg); + std::string acknowledgement; + check_resultState(inMsg, domID, false, &acknowledgement); + answerLog << acknowledgement << std::endl; } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); + answerLog << e.what() << std::endl; return; } - answerLog << std::endl << "-> Command sent: :" << std::endl; - // receive answer message + check_commandGetResult(inMsg, domID, -1, false); + // report result state try { - socket->receiveExact(inMsg); + int variableID = inMsg.readUnsignedByte(); + std::string objectID = inMsg.readString(); + answerLog << " CommandID=" << (domID + 0x10) << " VariableID=" << variableID << " ObjectID=" << objectID; + int valueDataType = inMsg.readUnsignedByte(); + answerLog << " valueDataType=" << valueDataType; + readAndReportTypeDependent(inMsg, valueDataType); } catch (tcpip::SocketException& e) { + std::stringstream msg; msg << "Error while receiving command: " << e.what(); errorMsg(msg); return; } - // validate result state - if (!reportResultState(inMsg, CMD_SIMSTEP2)) { - return; - } - // validate answer message - validateSimulationStep2(inMsg); -} - - -void -TraCITestClient::commandPositionConversion(testclient::Position pos, int posId) { - commandPositionConversion(&pos, NULL, NULL, posId); } void -TraCITestClient::commandPositionConversion(testclient::Position3D pos, int posId) { - commandPositionConversion(NULL, &pos, NULL, posId); -} - - -void -TraCITestClient::commandPositionConversion(testclient::PositionRoadMap pos, int posId) { - commandPositionConversion(NULL, NULL, &pos, posId); -} - - -void -TraCITestClient::commandPositionConversion(testclient::Position* pos2D, - testclient::Position3D* pos3D, - testclient::PositionRoadMap* posRoad, - int posId) { - tcpip::Storage outMsg; - tcpip::Storage inMsg; - tcpip::Storage tempMsg; +TraCITestClient::commandSetValue(int domID, int varID, const std::string& objID, std::ifstream& defFile) { std::stringstream msg; - - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; + tcpip::Storage inMsg, tmp; + int dataLength = setValueTypeDependant(tmp, defFile, msg); + std::string msgS = msg.str(); + if (msgS != "") { errorMsg(msg); - return; } - - // command id - tempMsg.writeUnsignedByte(CMD_POSITIONCONVERSION); - // position - if (pos2D != NULL) { - tempMsg.writeUnsignedByte(POSITION_2D); - tempMsg.writeDouble(pos2D->x); - tempMsg.writeDouble(pos2D->y); - } else if (pos3D != NULL) { - tempMsg.writeUnsignedByte(POSITION_3D); - tempMsg.writeDouble(pos3D->x); - tempMsg.writeDouble(pos3D->y); - tempMsg.writeDouble(pos3D->z); - } else if (posRoad != NULL) { - tempMsg.writeUnsignedByte(POSITION_ROADMAP); - tempMsg.writeString(posRoad->roadId); - tempMsg.writeDouble(posRoad->pos); - tempMsg.writeUnsignedByte(posRoad->laneId); - } else { - std::cerr << "Error in method commandPositionConversion: position is NULL" << std::endl; - return; - } - // destination position id - tempMsg.writeUnsignedByte(posId); - // command length - outMsg.writeUnsignedByte(1 + (int) tempMsg.size()); - outMsg.writeStorage(tempMsg); - - // send request message + send_commandSetValue(domID, varID, objID, tmp); + answerLog << std::endl << "-> Command sent: :" << std::endl + << " domID=" << domID << " varID=" << varID + << " objID=" << objID << std::endl; try { - socket->sendExact(outMsg); + std::string acknowledgement; + check_resultState(inMsg, domID, false, &acknowledgement); + answerLog << acknowledgement << std::endl; } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; + answerLog << e.what() << std::endl; } +} - answerLog << std::endl << "-> Command sent: :" << std::endl; - if (pos2D != NULL) { - answerLog << " DestPosition-2D: x=" << pos2D->x << " y=" << pos2D->y ; - } else if (pos3D != NULL) { - answerLog << " DestPosition-3D: x=" << pos3D->x << " y=" << pos3D->y << " z=" << pos3D->z; - } else if (posRoad != NULL) { - answerLog << " DestPosition-RoadMap: roadId=" << posRoad->roadId << " pos=" << posRoad->pos << " laneId=" << (int)posRoad->laneId ; - } - answerLog << " posId=" << posId << std::endl; - // receive answer message +void +TraCITestClient::commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, int varNo, std::ifstream& defFile) { + std::vector vars; + for (int i = 0; i < varNo; ++i) { + int var; + defFile >> var; + // variable id + vars.push_back(var); + } + send_commandSubscribeObjectVariable(domID, objID, beginTime, endTime, vars); + answerLog << std::endl << "-> Command sent: :" << std::endl + << " domID=" << domID << " objID=" << objID << " with " << varNo << " variables" << std::endl; + tcpip::Storage inMsg; try { - socket->receiveExact(inMsg); + std::string acknowledgement; + check_resultState(inMsg, domID, false, &acknowledgement); + answerLog << acknowledgement << std::endl; + validateSubscription(inMsg); } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; + answerLog << e.what() << std::endl; } - - // validate result state - if (!reportResultState(inMsg, CMD_POSITIONCONVERSION)) { - return; - } - - // validate answer message - validatePositionConversion(inMsg); -} - - -void -TraCITestClient::commandDistanceRequest(testclient::Position pos1, testclient::Position pos2, int flag) { - commandDistanceRequest(&pos1, NULL, NULL, &pos2, NULL, NULL, flag); -} - - -void -TraCITestClient::commandDistanceRequest(testclient::Position pos1, testclient::Position3D pos2, int flag) { - commandDistanceRequest(&pos1, NULL, NULL, NULL, &pos2, NULL, flag); -} - - -void -TraCITestClient::commandDistanceRequest(testclient::Position3D pos1, testclient::Position3D pos2, int flag) { - commandDistanceRequest(NULL, &pos1, NULL, NULL, &pos2, NULL, flag); -} - - -void -TraCITestClient::commandDistanceRequest(testclient::Position3D pos1, testclient::Position pos2, int flag) { - commandDistanceRequest(NULL, &pos1, NULL, &pos2, NULL, NULL, flag); -} - - -void -TraCITestClient::commandDistanceRequest(testclient::PositionRoadMap pos1, testclient::Position pos2, int flag) { - commandDistanceRequest(NULL, NULL, &pos1, &pos2, NULL, NULL, flag); -} - - -void -TraCITestClient::commandDistanceRequest(testclient::PositionRoadMap pos1, testclient::Position3D pos2, int flag) { - commandDistanceRequest(NULL, NULL, &pos1, NULL, &pos2, NULL, flag); } void -TraCITestClient::commandDistanceRequest(testclient::PositionRoadMap pos1, testclient::PositionRoadMap pos2, int flag) { - commandDistanceRequest(NULL, NULL, &pos1, NULL, NULL, &pos2, flag); +TraCITestClient::commandSubscribeContextVariable(int domID, const std::string& objID, int beginTime, int endTime, + int domain, SUMOReal range, int varNo, std::ifstream& defFile) { + std::vector vars; + for (int i = 0; i < varNo; ++i) { + int var; + defFile >> var; + // variable id + vars.push_back(var); + } + send_commandSubscribeObjectContext(domID, objID, beginTime, endTime, domain, range, vars); + answerLog << std::endl << "-> Command sent: :" << std::endl + << " domID=" << domID << " objID=" << objID << " domain=" << domain << " range=" << range + << " with " << varNo << " variables" << std::endl; + tcpip::Storage inMsg; + try { + std::string acknowledgement; + check_resultState(inMsg, domID, false, &acknowledgement); + answerLog << acknowledgement << std::endl; + validateSubscription(inMsg); + } catch (tcpip::SocketException& e) { + answerLog << e.what() << std::endl; + } } +// ---------- Report helper void -TraCITestClient::commandDistanceRequest(testclient::Position pos1, testclient::PositionRoadMap pos2, int flag) { - commandDistanceRequest(&pos1, NULL, NULL, NULL, NULL, &pos2, flag); +TraCITestClient::writeResult() { + time_t seconds; + tm* locTime; + std::ofstream outFile(outputFileName.c_str()); + if (!outFile) { + std::cerr << "Unable to write result file" << std::endl; + } + time(&seconds); + locTime = localtime(&seconds); + outFile << "TraCITestClient output file. Date: " << asctime(locTime) << std::endl; + outFile << answerLog.str(); + outFile.close(); } void -TraCITestClient::commandDistanceRequest(testclient::Position3D pos1, testclient::PositionRoadMap pos2, int flag) { - commandDistanceRequest(NULL, &pos1, NULL, NULL, NULL, &pos2, flag); +TraCITestClient::errorMsg(std::stringstream& msg) { + std::cerr << msg.str() << std::endl; + answerLog << "----" << std::endl << msg.str() << std::endl; } -void -TraCITestClient::commandDistanceRequest(testclient::Position* pos1_2D, - testclient::Position3D* pos1_3D, - testclient::PositionRoadMap* pos1_Road, - testclient::Position* pos2_2D, - testclient::Position3D* pos2_3D, - testclient::PositionRoadMap* pos2_Road, - int flag) { - tcpip::Storage outMsg; - tcpip::Storage inMsg; - tcpip::Storage tempMsg; - std::stringstream msg; - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; - errorMsg(msg); - return; - } - // command id - tempMsg.writeUnsignedByte(CMD_DISTANCEREQUEST); - // position1 - if (pos1_2D != NULL) { - tempMsg.writeUnsignedByte(POSITION_2D); - tempMsg.writeDouble(pos1_2D->x); - tempMsg.writeDouble(pos1_2D->y); - } else if (pos1_3D != NULL) { - tempMsg.writeUnsignedByte(POSITION_3D); - tempMsg.writeDouble(pos1_3D->x); - tempMsg.writeDouble(pos1_3D->y); - tempMsg.writeDouble(pos1_3D->z); - } else if (pos1_Road != NULL) { - tempMsg.writeUnsignedByte(POSITION_ROADMAP); - tempMsg.writeString(pos1_Road->roadId); - tempMsg.writeDouble(pos1_Road->pos); - tempMsg.writeUnsignedByte(pos1_Road->laneId); - } else { - std::cerr << "Error in method commandDistanceRequest: position1 is NULL" << std::endl; - return; - } - // position2 - if (pos2_2D != NULL) { - tempMsg.writeUnsignedByte(POSITION_2D); - tempMsg.writeDouble(pos2_2D->x); - tempMsg.writeDouble(pos2_2D->y); - } else if (pos2_3D != NULL) { - tempMsg.writeUnsignedByte(POSITION_3D); - tempMsg.writeDouble(pos2_3D->x); - tempMsg.writeDouble(pos2_3D->y); - tempMsg.writeDouble(pos2_3D->z); - } else if (pos2_Road != NULL) { - tempMsg.writeUnsignedByte(POSITION_ROADMAP); - tempMsg.writeString(pos2_Road->roadId); - tempMsg.writeDouble(pos2_Road->pos); - tempMsg.writeUnsignedByte(pos2_Road->laneId); - } else { - std::cerr << "Error in method commandDistanceRequest: position2 is NULL" << std::endl; - return; - } - // flag - tempMsg.writeUnsignedByte(flag); - // command length - outMsg.writeUnsignedByte(1 + (int) tempMsg.size()); - outMsg.writeStorage(tempMsg); - // send request message - try { - socket->sendExact(outMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; - } - - answerLog << std::endl << "-> Command sent: :" << std::endl; - if (pos1_2D != NULL) { - answerLog << " FirstPosition-2D: x=" << pos1_2D->x << " y=" << pos1_2D->y ; - } else if (pos1_3D != NULL) { - answerLog << " FirstPosition-3D: x=" << pos1_3D->x << " y=" << pos1_3D->y << " z=" << pos1_3D->z; - } else if (pos1_Road != NULL) { - answerLog << " FirstPosition-RoadMap: roadId=" << pos1_Road->roadId << " pos=" << pos1_Road->pos << " laneId=" << (int)pos1_Road->laneId ; - } - if (pos2_2D != NULL) { - answerLog << " SecondPosition-2D: x=" << pos2_2D->x << " y=" << pos2_2D->y ; - } else if (pos2_3D != NULL) { - answerLog << " SecondPosition-3D: x=" << pos2_3D->x << " y=" << pos2_3D->y << " z=" << pos2_3D->z; - } else if (pos2_Road != NULL) { - answerLog << " SecondPosition-RoadMap: roadId=" << pos2_Road->roadId << " pos=" << pos2_Road->pos << " laneId=" << (int)pos2_Road->laneId ; - } - answerLog << " Flag=" << flag << std::endl; - - // receive answer message - try { - socket->receiveExact(inMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } - - // validate result state - if (!reportResultState(inMsg, CMD_DISTANCEREQUEST)) { - return; - } - - // validate answer message - validateDistanceRequest(inMsg); -} - - -void -TraCITestClient::commandGetVariable(int domID, int varID, const std::string& objID) { - tcpip::Storage outMsg, inMsg; - std::stringstream msg; - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; - errorMsg(msg); - return; - } - // command length - outMsg.writeUnsignedByte(1 + 1 + 1 + 4 + (int) objID.length()); - // command id - outMsg.writeUnsignedByte(domID); - // variable id - outMsg.writeUnsignedByte(varID); - // object id - outMsg.writeString(objID); - - // send request message - try { - socket->sendExact(outMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; - } - answerLog << std::endl << "-> Command sent: :" << std::endl - << " domID=" << domID << " varID=" << varID - << " objID=" << objID << std::endl; - - // receive answer message - try { - socket->receiveExact(inMsg); - if (!reportResultState(inMsg, domID)) { - return; - } - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } - // validate result state +bool +TraCITestClient::validateSimulationStep2(tcpip::Storage& inMsg) { try { - int respStart = inMsg.position(); - int length = inMsg.readUnsignedByte(); - if (length == 0) { - length = inMsg.readInt(); - } - int cmdId = inMsg.readUnsignedByte(); - if (cmdId != (domID + 0x10)) { - answerLog << "#Error: received response with command id: " << cmdId - << "but expected: " << (int)(domID + 0x10) << std::endl; - return; + int noSubscriptions = inMsg.readInt(); + for (int s = 0; s < noSubscriptions; ++s) { + if (!validateSubscription(inMsg)) { + return false; + } } - answerLog << " CommandID=" << cmdId; - answerLog << " VariableID=" << inMsg.readUnsignedByte(); - answerLog << " ObjectID=" << inMsg.readString(); - int valueDataType = inMsg.readUnsignedByte(); - answerLog << " valueDataType=" << valueDataType; - readAndReportTypeDependent(inMsg, valueDataType); - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; + } catch (std::invalid_argument& e) { + answerLog << "#Error while reading message:" << e.what() << std::endl; + return false; } + return true; } -void -TraCITestClient::commandGetVariablePlus(int domID, int varID, const std::string& objID, std::ifstream& defFile) { - std::stringstream msg; - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; - errorMsg(msg); - return; - } - tcpip::Storage outMsg, inMsg, tmp; - const int dataLength = setValueTypeDependant(tmp, defFile, msg); - std::string msgS = msg.str(); - if (msgS != "") { - errorMsg(msg); - } - // command length (domID, varID, objID, dataType, data) - outMsg.writeUnsignedByte(1 + 1 + 1 + 4 + (int) objID.length() + dataLength); - // command id - outMsg.writeUnsignedByte(domID); - // variable id - outMsg.writeUnsignedByte(varID); - // object id - outMsg.writeString(objID); - // data type - outMsg.writeStorage(tmp); - // send request message - try { - socket->sendExact(outMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; - } - answerLog << std::endl << "-> Command sent: :" << std::endl - << " domID=" << domID << " varID=" << varID - << " objID=" << objID << std::endl; - - // receive answer message - try { - socket->receiveExact(inMsg); - if (!reportResultState(inMsg, domID)) { - return; - } - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } - // validate result state +bool +TraCITestClient::validateSubscription(tcpip::Storage& inMsg) { try { - int respStart = inMsg.position(); int length = inMsg.readUnsignedByte(); if (length == 0) { length = inMsg.readInt(); } int cmdId = inMsg.readUnsignedByte(); - if (cmdId != (domID + 0x10)) { - answerLog << "#Error: received response with command id: " << cmdId - << "but expected: " << (int)(domID + 0x10) << std::endl; - return; + if (cmdId >= RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE && cmdId <= RESPONSE_SUBSCRIBE_GUI_VARIABLE) { + answerLog << " CommandID=" << cmdId; + answerLog << " ObjectID=" << inMsg.readString(); + unsigned int varNo = inMsg.readUnsignedByte(); + answerLog << " #variables=" << varNo << std::endl; + for (unsigned int i = 0; i < varNo; ++i) { + answerLog << " VariableID=" << inMsg.readUnsignedByte(); + bool ok = inMsg.readUnsignedByte() == RTYPE_OK; + answerLog << " ok=" << ok; + int valueDataType = inMsg.readUnsignedByte(); + answerLog << " valueDataType=" << valueDataType; + readAndReportTypeDependent(inMsg, valueDataType); + } + } else if (cmdId >= RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT && cmdId <= RESPONSE_SUBSCRIBE_GUI_CONTEXT) { + answerLog << " CommandID=" << cmdId; + answerLog << " ObjectID=" << inMsg.readString(); + answerLog << " Domain=" << inMsg.readUnsignedByte(); + unsigned int varNo = inMsg.readUnsignedByte(); + answerLog << " #variables=" << varNo << std::endl; + unsigned int objNo = inMsg.readInt(); + answerLog << " #objects=" << objNo << std::endl; + for (unsigned int j = 0; j < objNo; ++j) { + answerLog << " ObjectID=" << inMsg.readString() << std::endl; + for (unsigned int i = 0; i < varNo; ++i) { + answerLog << " VariableID=" << inMsg.readUnsignedByte(); + bool ok = inMsg.readUnsignedByte() == RTYPE_OK; + answerLog << " ok=" << ok; + int valueDataType = inMsg.readUnsignedByte(); + answerLog << " valueDataType=" << valueDataType; + readAndReportTypeDependent(inMsg, valueDataType); + } + } + } else { + answerLog << "#Error: received response with command id: " << cmdId << " but expected a subscription response (0xe0-0xef / 0x90-0x9f)" << std::endl; + return false; } - answerLog << " CommandID=" << cmdId; - answerLog << " VariableID=" << inMsg.readUnsignedByte(); - answerLog << " ObjectID=" << inMsg.readString(); - int valueDataType = inMsg.readUnsignedByte(); - answerLog << " valueDataType=" << valueDataType; - readAndReportTypeDependent(inMsg, valueDataType); - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; + } catch (std::invalid_argument& e) { + answerLog << "#Error while reading message:" << e.what() << std::endl; + return false; } + return true; } -void -TraCITestClient::commandSubscribeVariable(int domID, const std::string& objID, int beginTime, int endTime, int varNo, std::ifstream& defFile) { - std::stringstream msg; - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; - errorMsg(msg); - return; - } - tcpip::Storage outMsg, inMsg, tmp; - std::string msgS = msg.str(); - if (msgS != "") { - errorMsg(msg); - } - // command length (domID, beginTime, endTime, objID, varNo, ) - outMsg.writeUnsignedByte(0); - outMsg.writeInt(/*1 + 4 +*/ 5 + 1 + 4 + 4 + 4 + (int) objID.length() + 1 + varNo); - // command id - outMsg.writeUnsignedByte(domID); - // time - outMsg.writeInt(beginTime); - outMsg.writeInt(endTime); - // object id - outMsg.writeString(objID); - // command id - outMsg.writeUnsignedByte(varNo); - for (int i = 0; i < varNo; ++i) { - int var; - defFile >> var; - // variable id - outMsg.writeUnsignedByte(var); - } - // send request message - try { - socket->sendExact(outMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; - } - answerLog << std::endl << "-> Command sent: :" << std::endl - << " domID=" << domID << " objID=" << objID << " with " << varNo << " variables" << std::endl; - // receive answer message - try { - socket->receiveExact(inMsg); - if (!reportResultState(inMsg, domID)) { - return; - } - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } - // validate result state - try { - validateSubscription(inMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } -} + +// ---------- Conversion helper int TraCITestClient::setValueTypeDependant(tcpip::Storage& into, std::ifstream& defFile, std::stringstream& msg) { std::string dataTypeS, valueS; @@ -872,6 +430,18 @@ } else if (dataTypeS == "") { into.writeUnsignedByte(REQUEST_DRIVINGDIST); return 1; + } else if (dataTypeS == "") { + int beginTime, endTime, numVars; + defFile >> beginTime >> endTime >> numVars; + into.writeInt(beginTime); + into.writeInt(endTime); + into.writeInt(numVars); + for (int i = 0; i < numVars; ++i) { + int var; + defFile >> var; + into.writeUnsignedByte(var); + } + return 4 + 4 + 4 + numVars; } defFile >> valueS; if (dataTypeS == "") { @@ -884,7 +454,7 @@ return 1 + 1; } else if (dataTypeS == "") { into.writeUnsignedByte(TYPE_UBYTE); - into.writeByte(atoi(valueS.c_str())); + into.writeUnsignedByte(atoi(valueS.c_str())); return 1 + 1; } else if (dataTypeS == "") { into.writeUnsignedByte(TYPE_FLOAT); @@ -912,8 +482,8 @@ into.writeStringList(slValue); return length; } else if (dataTypeS == "") { - into.writeUnsignedByte(TYPE_COMPOUND); int number = atoi(valueS.c_str()); + into.writeUnsignedByte(TYPE_COMPOUND); into.writeInt(number); int length = 1 + 4; for (int i = 0; i < number; ++i) { @@ -969,294 +539,8 @@ return 0; } -void -TraCITestClient::commandSetValue(int domID, int varID, const std::string& objID, std::ifstream& defFile) { - std::stringstream msg; - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; - errorMsg(msg); - return; - } - tcpip::Storage outMsg, inMsg, tmp; - int dataLength = setValueTypeDependant(tmp, defFile, msg); - std::string msgS = msg.str(); - if (msgS != "") { - errorMsg(msg); - } - // command length (domID, varID, objID, dataType, data) - outMsg.writeUnsignedByte(1 + 1 + 1 + 4 + (int) objID.length() + dataLength); - // command id - outMsg.writeUnsignedByte(domID); - // variable id - outMsg.writeUnsignedByte(varID); - // object id - outMsg.writeString(objID); - // data type - outMsg.writeStorage(tmp); - // send request message - try { - socket->sendExact(outMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; - } - answerLog << std::endl << "-> Command sent: :" << std::endl - << " domID=" << domID << " varID=" << varID - << " objID=" << objID << std::endl; - - // receive answer message - try { - socket->receiveExact(inMsg); - if (!reportResultState(inMsg, domID)) { - return; - } - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } -} - - - void -TraCITestClient::commandClose() { - tcpip::Storage outMsg; - tcpip::Storage inMsg; - std::stringstream msg; - - if (socket == NULL) { - msg << "#Error while sending command: no connection to server" ; - errorMsg(msg); - return; - } - - // command length - outMsg.writeUnsignedByte(1 + 1); - // command id - outMsg.writeUnsignedByte(CMD_CLOSE); - - // send request message - try { - socket->sendExact(outMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while sending command: " << e.what(); - errorMsg(msg); - return; - } - - answerLog << std::endl << "-> Command sent: :" << std::endl; - - // receive answer message - try { - socket->receiveExact(inMsg); - } catch (tcpip::SocketException& e) { - msg << "Error while receiving command: " << e.what(); - errorMsg(msg); - return; - } - - // validate result state - if (!reportResultState(inMsg, CMD_CLOSE)) { - return; - } -} - - -bool -TraCITestClient::validateSimulationStep2(tcpip::Storage& inMsg) { - try { - int noSubscriptions = inMsg.readInt(); - for (int s = 0; s < noSubscriptions; ++s) { - /* - if (!reportResultState(inMsg, CMD_SIMSTEP2, true)) { - return false; - } - */ - if (!validateSubscription(inMsg)) { - return false; - } - } - } catch (std::invalid_argument& e) { - answerLog << "#Error while reading message:" << e.what() << std::endl; - return false; - } - return true; -} - - -bool -TraCITestClient::validateSubscription(tcpip::Storage& inMsg) { - try { - int respStart = inMsg.position(); - int length = inMsg.readUnsignedByte(); - if (length == 0) { - length = inMsg.readInt(); - } - int cmdId = inMsg.readUnsignedByte(); - if (cmdId < 0xe0 || cmdId > 0xef) { - answerLog << "#Error: received response with command id: " << cmdId << " but expected a subscription response (0xe0-0xef)" << std::endl; - return false; - } - answerLog << " CommandID=" << cmdId; - answerLog << " ObjectID=" << inMsg.readString(); - unsigned int varNo = inMsg.readUnsignedByte(); - answerLog << " #variables=" << varNo << std::endl; - for (unsigned int i = 0; i < varNo; ++i) { - answerLog << " VariableID=" << inMsg.readUnsignedByte(); - bool ok = inMsg.readUnsignedByte() == RTYPE_OK; - answerLog << " ok=" << ok; - int valueDataType = inMsg.readUnsignedByte(); - answerLog << " valueDataType=" << valueDataType; - readAndReportTypeDependent(inMsg, valueDataType); - } - } catch (std::invalid_argument& e) { - answerLog << "#Error while reading message:" << e.what() << std::endl; - return false; - } - return true; -} - - -bool -TraCITestClient::validatePositionConversion(tcpip::Storage& inMsg) { - int cmdId; - int cmdLength; - int posType; - int reqPosType; - int cmdStart; - testclient::PositionRoadMap roadPos; - testclient::Position pos2D; - testclient::Position3D pos3D; - - try { - cmdStart = inMsg.position(); - cmdLength = inMsg.readUnsignedByte(); - // read command id - cmdId = inMsg.readUnsignedByte(); - if (cmdId != CMD_POSITIONCONVERSION) { - answerLog << "#Error: received response with command id: " << cmdId - << "but expected: " << (int)CMD_POSITIONCONVERSION << std::endl; - return false; - } - answerLog << ".. Received Response :" << std::endl; - // read converted position - posType = inMsg.readUnsignedByte(); - switch (posType) { - case POSITION_2D: - pos2D.x = inMsg.readDouble(); - pos2D.y = inMsg.readDouble(); - answerLog << "2D-Position: x=" << pos2D.x << " y=" << pos2D.y << std::endl; - break; - case POSITION_3D: - answerLog << "3D-Position: "; - pos3D.x = inMsg.readDouble(); - pos3D.y = inMsg.readDouble(); - pos3D.z = inMsg.readDouble(); - answerLog << "x=" << pos3D.x << " y=" << pos3D.y << " z=" << pos3D.z << std::endl; - break; - case POSITION_ROADMAP: - roadPos.roadId = inMsg.readString(); - roadPos.pos = inMsg.readDouble(); - roadPos.laneId = inMsg.readUnsignedByte(); - answerLog << "RoadMap-Position: roadId=" << roadPos.roadId << " pos=" << roadPos.pos - << " laneId=" << (int)roadPos.laneId << std::endl; - break; - default: - answerLog << "#Error: received unknown position format" << std::endl; - return false; - } - // read requested position type - reqPosType = inMsg.readUnsignedByte(); - if (reqPosType != posType) { - answerLog << "#Warning: requested position type (" << reqPosType - << ") and received position type (" << posType << ") do not match" << std::endl; - } - // check command length - if ((cmdStart + cmdLength) != inMsg.position()) { - answerLog << "#Error: command at position " << cmdStart << " has wrong length" << std::endl; - return false; - } - } catch (std::invalid_argument& e) { - answerLog << "#Error while reading message:" << e.what() << std::endl; - return false; - } - - return true; -} - - -bool -TraCITestClient::validateDistanceRequest(tcpip::Storage& inMsg) { - int cmdId; - int cmdLength; - int flag; - int cmdStart; - SUMOReal distance; - /*testclient::PositionRoadMap roadPos; - testclient::Position pos2D; - testclient::Position3D pos3D;*/ - - try { - cmdStart = inMsg.position(); - cmdLength = inMsg.readUnsignedByte(); - // read command id - cmdId = inMsg.readUnsignedByte(); - if (cmdId != CMD_DISTANCEREQUEST) { - answerLog << "#Error: received response with command id: " << cmdId - << "but expected: " << (int)CMD_DISTANCEREQUEST << std::endl; - return false; - } - answerLog << ".. Received Response :" << std::endl; - // read flag - flag = inMsg.readUnsignedByte(); - answerLog << " flag=" << flag; - // read computed distance - distance = inMsg.readDouble(); - answerLog << " distance=" << distance << std::endl; - //// read computed position - //posType = inMsg.readUnsignedByte(); - //switch (posType) { - //case POSITION_2D: - // pos2D.x = inMsg.readDouble(); - // pos2D.y = inMsg.readDouble(); - // answerLog << "2D-Position: x=" << pos2D.x << " y=" << pos2D.y; - // break; - //case POSITION_3D: - // answerLog << "3D-Position: "; - // pos3D.x = inMsg.readDouble(); - // pos3D.y = inMsg.readDouble(); - // pos3D.z = inMsg.readDouble(); - // answerLog << "x=" << pos3D.x << " y=" << pos3D.y << " z=" << pos3D.z; - // break; - //case POSITION_ROADMAP: - // roadPos.roadId = inMsg.readString(); - // roadPos.pos = inMsg.readDouble(); - // roadPos.laneId = inMsg.readUnsignedByte(); - // answerLog << "RoadMap-Position: roadId=" << roadPos.roadId << " pos=" << roadPos.pos - // << " laneId=" << (int)roadPos.laneId; - // break; - //default: - // answerLog << "#Error: received unknown position format: " << posType << std::endl; - // return false; - //} - // check command length - if ((cmdStart + cmdLength) != inMsg.position()) { - answerLog << "#Error: command at position " << cmdStart << " has wrong length" << std::endl; - return false; - } - } catch (std::invalid_argument& e) { - answerLog << "#Error while reading message:" << e.what() << std::endl; - return false; - } - - return true; -} - - -bool TraCITestClient::readAndReportTypeDependent(tcpip::Storage& inMsg, int valueDataType) { if (valueDataType == TYPE_UBYTE) { int ubyte = inMsg.readUnsignedByte(); @@ -1280,14 +564,13 @@ double doublev = inMsg.readDouble(); answerLog << " Double value: " << doublev << std::endl; } else if (valueDataType == TYPE_BOUNDINGBOX) { - testclient::BoundingBox box; - box.lowerLeft.x = inMsg.readDouble(); - box.lowerLeft.y = inMsg.readDouble(); - box.upperRight.x = inMsg.readDouble(); - box.upperRight.y = inMsg.readDouble(); - answerLog << " BoundaryBoxValue: lowerLeft x=" << box.lowerLeft.x - << " y=" << box.lowerLeft.y << " upperRight x=" << box.upperRight.x - << " y=" << box.upperRight.y << std::endl; + SUMOReal lowerLeftX = inMsg.readDouble(); + SUMOReal lowerLeftY = inMsg.readDouble(); + SUMOReal upperRightX = inMsg.readDouble(); + SUMOReal upperRightY = inMsg.readDouble(); + answerLog << " BoundaryBoxValue: lowerLeft x=" << lowerLeftX + << " y=" << lowerLeftY << " upperRight x=" << upperRightX + << " y=" << upperRightY << std::endl; } else if (valueDataType == TYPE_POLYGON) { int length = inMsg.readUnsignedByte(); answerLog << " PolygonValue: "; @@ -1332,7 +615,7 @@ break; default: answerLog << "#Error: unknown phase value" << (int)phase << std::endl; - return false; + return; } } } else if (valueDataType == TYPE_STRING) { @@ -1369,7 +652,7 @@ answerLog << " color value: (" << r << "," << g << "," << b << "," << a << ")" << std::endl; } else { answerLog << "#Error: unknown valueDataType!" << std::endl; - return false; } - return true; } + + diff -Nru sumo-0.15.0~dfsg/src/traci_testclient/TraCITestClient.h sumo-0.16.0~dfsg/src/traci_testclient/TraCITestClient.h --- sumo-0.15.0~dfsg/src/traci_testclient/TraCITestClient.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci_testclient/TraCITestClient.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,9 +5,9 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date 2008/04/07 -/// @version $Id: TraCITestClient.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TraCITestClient.h 13107 2012-12-02 13:57:34Z behrisch $ /// -/// A dummy client to simulate communication to a TraCI server +/// A test execution class /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -32,116 +32,137 @@ #include #include +#include -namespace testclient { -// =========================================================================== -// Definitions -// =========================================================================== -struct Position { - SUMOReal x; - SUMOReal y; -}; - -struct Position3D { - SUMOReal x; - SUMOReal y; - SUMOReal z; -}; - -struct PositionRoadMap { - std::string roadId; - SUMOReal pos; - int laneId; -}; - -struct BoundingBox { - Position lowerLeft; - Position upperRight; -}; - -typedef std::vector Polygon; - -struct TLPhase { - std::string precRoadId; - std::string succRoadId; - int phase; -}; -typedef std::vector TLPhaseList; +namespace testclient { // =========================================================================== // class definitions // =========================================================================== /** * @class TraCITestClient + * @brief A test execution class + * + * Reads a program file and executes the actions stored within it */ -class TraCITestClient { - +class TraCITestClient : public TraCIAPI { public: + /** @brief Constructor + * @param[in] outputFileName The name of the file the outputs will be written into + */ TraCITestClient(std::string outputFileName = "testclient_result.out"); + + /// @brief Destructor ~TraCITestClient(); + + /** @brief Runs a test + * @param[in] fileName The name of the file containing the test script + * @param[in] port The server port to connect to + * @param[in] host The server name to connect to + */ bool run(std::string fileName, int port, std::string host = "localhost"); - bool connect(int port, std::string host = "localhost"); - bool close(); +protected: + /// @name Commands handling + /// @{ - // simulation commands - void commandSimulationStep2(SUMOTime time); + /** @brief Sends and validates a simulation step command + * @param[in] time The time step to send + */ + void commandSimulationStep(SUMOTime time); - void commandPositionConversion(testclient::Position pos, int posId); - void commandPositionConversion(testclient::Position3D pos, int posId); - void commandPositionConversion(testclient::PositionRoadMap pos, int posId); - - void commandDistanceRequest(testclient::Position pos1, testclient::Position pos2, int flag); - void commandDistanceRequest(testclient::Position3D pos1, testclient::Position3D pos2, int flag); - void commandDistanceRequest(testclient::Position pos1, testclient::Position3D pos2, int flag); - void commandDistanceRequest(testclient::Position3D pos1, testclient::Position pos2, int flag); - void commandDistanceRequest(testclient::PositionRoadMap pos1, testclient::PositionRoadMap pos2, int flag); - void commandDistanceRequest(testclient::PositionRoadMap pos1, testclient::Position pos2, int flag); - void commandDistanceRequest(testclient::PositionRoadMap pos1, testclient::Position3D pos2, int flag); - void commandDistanceRequest(testclient::Position pos1, testclient::PositionRoadMap pos2, int flag); - void commandDistanceRequest(testclient::Position3D pos1, testclient::PositionRoadMap pos2, int flag); - - void commandGetVariable(int domID, int varID, const std::string& objID); - void commandGetVariablePlus(int domID, int varID, const std::string& objID, std::ifstream& defFile); - void commandSubscribeVariable(int domID, const std::string& objID, int beginTime, int endTime, int varNo, std::ifstream& defFile); - void commandSetValue(int domID, int varID, const std::string& objID, std::ifstream& defFile); + /** @brief Sends and validates a Close command + */ void commandClose(); + + /** @brief Sends and validates a GetVariable command + * @param[in] domID The ID of the domain the addressed object belongs to + * @param[in] varID The ID of the variable one asks for + * @param[in] objID The ID of the object a variable shall be retrieved from + * @param[in] addData Storage to read additional data from, if needed + */ + void commandGetVariable(int domID, int varID, const std::string& objID, tcpip::Storage* addData = 0); + + + /** @brief Sends and validates a SetVariable command + * @param[in] domID The ID of the domain the addressed object belongs to + * @param[in] varID The ID of the variable to set + * @param[in] objID The ID of the object which shall be changed + * @param[in] defFile Storage to read additional data from + */ + void commandSetValue(int domID, int varID, const std::string& objID, std::ifstream& defFile); + + + /** @brief Sends and validates a SubscribeVariable command + * @param[in] domID The ID of the domain the addressed object belongs to + * @param[in] objID The ID of the object a variable shall be subscribed from + * @param[in] beginTime The time the subscription shall begin at + * @param[in] endTime The time the subscription shall end at + * @param[in] varNo The number of subscribed variables + * @param[in] defFile The stream to read variable values from + */ + void commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, int varNo, std::ifstream& defFile); + + + /** @brief Sends and validates a SubscribeContext command + * @param[in] domID The ID of the domain the addressed object belongs to + * @param[in] objID The ID of the object a variable shall be subscribed from + * @param[in] beginTime The time the subscription shall begin at + * @param[in] endTime The time the subscription shall end at + * @param[in] domain The domain of the objects which shall be reported + * @param[in] range The range within which objects shall be for being reported + * @param[in] varNo The number of subscribed variables + * @param[in] defFile The stream to read variable values from + */ + void commandSubscribeContextVariable(int domID, const std::string& objID, int beginTime, int endTime, int domain, SUMOReal range, int varNo, std::ifstream& defFile); + /// @} + + + private: + /// @name Report helper + /// @{ + + /** @brief Writes the results file + */ void writeResult(); + + /** @brief Writes an error message + * @param[in] msg The message to write + */ void errorMsg(std::stringstream& msg); + /// @} + - void commandPositionConversion(testclient::Position* pos2D, - testclient::Position3D* pos3D, - testclient::PositionRoadMap* posRoad, - int posId); - - void commandDistanceRequest(testclient::Position* pos1_2D, - testclient::Position3D* pos1_3D, - testclient::PositionRoadMap* pos1_Road, - testclient::Position* pos2_2D, - testclient::Position3D* pos2_3D, - testclient::PositionRoadMap* pos2_Road, - int flag); - // validation of received command responses - bool reportResultState(tcpip::Storage& inMsg, int command, bool ignoreCommandId = false); + /// @name Results validation methods + /// @{ + /** @brief Validates whether the given message is a valid answer to CMD_SIMSTEP2 + * @param[in] inMsg The storage contain the message to validate + * @return Whether the message is valid + */ bool validateSimulationStep2(tcpip::Storage& inMsg); - bool validateSubscription(tcpip::Storage& inMsg); - bool validatePositionConversion(tcpip::Storage& inMsg); - bool validateDistanceRequest(tcpip::Storage& inMsg); + /** @brief Validates whether the given message is a valid subscription return message + * @param[in] inMsg The storage contain the message to validate + * @return Whether the message is valid + */ + bool validateSubscription(tcpip::Storage& inMsg); + /// @} + - bool readAndReportTypeDependent(tcpip::Storage& inMsg, int valueDataType); + /// @name Conversion helper + /// @{ /** @brief Parses the next value type / value pair from the stream and inserts it into the storage * @@ -153,13 +174,21 @@ int setValueTypeDependant(tcpip::Storage& into, std::ifstream& defFile, std::stringstream& msg); + /** @brief Reads a value of the given type from the given storage and reports it + * @param[in] inMsg The storage to read the value from + * @param[in] valueDataType The type of the expected value + */ + void readAndReportTypeDependent(tcpip::Storage& inMsg, int valueDataType); + /// @} + private: - tcpip::Socket* socket; - + /// @brief The name of the file to write the results log into std::string outputFileName; + /// @brief Stream containing the log std::stringstream answerLog; + }; } diff -Nru sumo-0.15.0~dfsg/src/traci_testclient/tracitestclient_main.cpp sumo-0.16.0~dfsg/src/traci_testclient/tracitestclient_main.cpp --- sumo-0.15.0~dfsg/src/traci_testclient/tracitestclient_main.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/traci_testclient/tracitestclient_main.cpp 2012-09-25 22:01:46.000000000 +0000 @@ -3,8 +3,9 @@ /// @author Friedemann Wesner /// @author Axel Wegener /// @author Michael Behrisch +/// @author Daniel Krajzewicz /// @date 2008/04/07 -/// @version $Id: tracitestclient_main.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: tracitestclient_main.cpp 12655 2012-09-03 12:17:13Z dkrajzew $ /// /// Main method for TraCITestClient /****************************************************************************/ @@ -50,10 +51,9 @@ std::string outFileName = "testclient_out.txt"; int port = -1; std::string host = "localhost"; - TraCITestClient* client; if ((argc == 1) || (argc % 2 == 0)) { - std::cout << "Usage: TraciTestClient -def -p " + std::cout << "Usage: TraCITestClient -def -p " << "[-h ] [-o ]" << std::endl; return 0; } @@ -87,9 +87,6 @@ return 1; } - client = new TraCITestClient(outFileName); - bool success = client->run(defFile, port, host); - delete client; - - return !success; + TraCITestClient client(outFileName); + return !client.run(defFile, port, host); } diff -Nru sumo-0.15.0~dfsg/src/utils/Makefile.am sumo-0.16.0~dfsg/src/utils/Makefile.am --- sumo-0.15.0~dfsg/src/utils/Makefile.am 2008-05-01 22:26:29.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/Makefile.am 2012-09-25 22:01:54.000000000 +0000 @@ -2,5 +2,10 @@ GUI_DIRS = foxtools gui endif +if TRACI +TRACI_DIRS = traci +endif + SUBDIRS = common distribution \ -geom importio iodevices options shapes xml $(GUI_DIRS) +geom importio iodevices options shapes \ +xml $(GUI_DIRS) $(TRACI_DIRS) diff -Nru sumo-0.15.0~dfsg/src/utils/Makefile.in sumo-0.16.0~dfsg/src/utils/Makefile.in --- sumo-0.15.0~dfsg/src/utils/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -61,7 +61,7 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = common distribution geom importio iodevices options \ - shapes xml foxtools gui + shapes xml foxtools gui traci DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -110,6 +110,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -140,6 +141,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -174,6 +176,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -207,7 +210,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -228,8 +230,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @WITH_GUI_TRUE@GUI_DIRS = foxtools gui +@TRACI_TRUE@TRACI_DIRS = traci SUBDIRS = common distribution \ -geom importio iodevices options shapes xml $(GUI_DIRS) +geom importio iodevices options shapes \ +xml $(GUI_DIRS) $(TRACI_DIRS) all: all-recursive diff -Nru sumo-0.15.0~dfsg/src/utils/common/AStarRouter.h sumo-0.16.0~dfsg/src/utils/common/AStarRouter.h --- sumo-0.15.0~dfsg/src/utils/common/AStarRouter.h 2012-02-29 00:03:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/AStarRouter.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,9 +2,9 @@ /// @file AStarRouter.h /// @author Jakob Erdmann /// @date January 2012 -/// @version $Id: AStarRouter.h 11970 2012-02-28 14:08:38Z namdre $ +/// @version $Id: AStarRouter.h 13107 2012-12-02 13:57:34Z behrisch $ /// -// A* Algorithm using euclidean distance heuristic. +// A* Algorithm using euclidean distance heuristic. // Based on DijkstraRouterTT. For routing by effort a novel heuristic would be needed. /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ @@ -31,6 +31,7 @@ #include #endif +#include #include #include #include @@ -71,8 +72,7 @@ /// Constructor AStarRouterTTBase(size_t noE, bool unbuildIsWarning): SUMOAbstractRouter("AStarRouter"), - myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) - { + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { for (size_t i = 0; i < noE; i++) { myEdgeInfos.push_back(EdgeInfo(i)); } @@ -90,11 +90,11 @@ public: /// Constructor EdgeInfo(size_t id) : - edge(E::dictionary(id)), - traveltime(std::numeric_limits::max()), - heuristicTime(std::numeric_limits::max()), - prev(0), - visited(false) + edge(E::dictionary(id)), + traveltime(std::numeric_limits::max()), + heuristicTime(std::numeric_limits::max()), + prev(0), + visited(false) {} /// The current edge @@ -153,7 +153,7 @@ /** @brief Builds the route between the given edges using the minimum travel time */ virtual void compute(const E* from, const E* to, const V* const vehicle, - SUMOTime msTime, std::vector &into) { + SUMOTime msTime, std::vector& into) { assert(from != 0 && to != 0); startQuery(); const SUMOReal time = STEPS2TIME(msTime); @@ -216,7 +216,7 @@ } - SUMOReal recomputeCosts(const std::vector &edges, const V* const v, SUMOTime msTime) const { + SUMOReal recomputeCosts(const std::vector& edges, const V* const v, SUMOTime msTime) const { const SUMOReal time = STEPS2TIME(msTime); SUMOReal costs = 0; for (typename std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { @@ -230,7 +230,7 @@ public: /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector &edges) { + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { std::deque tmp; while (rbegin != 0) { tmp.push_front((E*) rbegin->edge); // !!! @@ -256,28 +256,23 @@ }; -template +template class AStarRouterTT_ByProxi : public AStarRouterTTBase { public: /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(EC::* Operation)(const E* const, const V* const, SUMOReal) const; + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); - AStarRouterTT_ByProxi(size_t noE, bool unbuildIsWarningOnly, EC* receiver, Operation operation) - : AStarRouterTTBase(noE, unbuildIsWarningOnly), - myReceiver(receiver), myOperation(operation) {} + AStarRouterTT_ByProxi(size_t noE, bool unbuildIsWarningOnly, Operation operation): + AStarRouterTTBase(noE, unbuildIsWarningOnly), + myOperation(operation) {} inline SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const { - return (myReceiver->*myOperation)(e, v, t); + return (*myOperation)(e, v, t); } private: - /// @brief The object the action is directed to. - EC* myReceiver; - /// @brief The object's operation to perform. Operation myOperation; - - }; @@ -296,7 +291,6 @@ private: Operation myOperation; - }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/AbstractMutex.h sumo-0.16.0~dfsg/src/utils/common/AbstractMutex.h --- sumo-0.15.0~dfsg/src/utils/common/AbstractMutex.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/AbstractMutex.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-07-12 -/// @version $Id: AbstractMutex.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: AbstractMutex.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An abstract class for encapsulating mutex implementations /****************************************************************************/ @@ -40,6 +40,7 @@ * @brief An abstract class for encapsulating mutex implementations * * This class defines access to a mutex. The implementation may differ. + * * Within gui-applications, FXMutexes may be used while this is improper * for command-line applications. Normally, they do not need mutexes unless * a synchronized communication with an external application is established. @@ -62,6 +63,46 @@ /// @brief Unlocks the mutex virtual void unlock() = 0; + + + /** @class ScopedLocker + * @brief A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively + */ + class ScopedLocker { + public: + /** @brief Constructor + * @param[in] lock The mutex to lock + * + * Locks the mutex. + */ + ScopedLocker(AbstractMutex& lock): myLock(lock) { + myLock.lock(); + } + + + /** @brief Destructor + * Unlocks the mutex. + */ + ~ScopedLocker() { + myLock.unlock(); + } + + private: + /// @brief The mutex to lock + AbstractMutex& myLock; + + private: + /// @brief Invalidated copy constructor. + ScopedLocker(const ScopedLocker&); + + /// Invalidated assignment operator. + ScopedLocker& operator=(const ScopedLocker&); + + + }; + + + }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/DijkstraRouterEffort.h sumo-0.16.0~dfsg/src/utils/common/DijkstraRouterEffort.h --- sumo-0.15.0~dfsg/src/utils/common/DijkstraRouterEffort.h 2012-02-29 00:03:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/DijkstraRouterEffort.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 July 2005 -/// @version $Id: DijkstraRouterEffort.h 11970 2012-02-28 14:08:38Z namdre $ +/// @version $Id: DijkstraRouterEffort.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Dijkstra shortest path algorithm using other values /****************************************************************************/ @@ -32,6 +32,7 @@ #include #endif +#include #include #include #include @@ -71,8 +72,7 @@ /// Constructor DijkstraRouterEffortBase(size_t noE, bool unbuildIsWarning) : SUMOAbstractRouter("DijkstraRouterEffort"), - myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) - { + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { for (size_t i = 0; i < noE; i++) { myEdgeInfos.push_back(EdgeInfo(i)); } @@ -148,7 +148,7 @@ /** @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 void compute(const E* from, const E* to, const V* const vehicle, - SUMOTime msTime, std::vector &into) { + SUMOTime msTime, std::vector& into) { assert(from != 0 && to != 0); startQuery(); init(); @@ -208,7 +208,7 @@ } - SUMOReal recomputeCosts(const std::vector &edges, const V* const v, SUMOTime msTime) const { + SUMOReal recomputeCosts(const std::vector& edges, const V* const v, SUMOTime msTime) const { SUMOReal costs = 0; SUMOReal t = STEPS2TIME(msTime); for (typename std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { @@ -223,7 +223,7 @@ public: /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector &edges) { + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { std::deque tmp; while (rbegin != 0) { tmp.push_front((E*) rbegin->edge); // !!! @@ -249,28 +249,26 @@ }; -template +template class DijkstraRouterEffort_ByProxi : public DijkstraRouterEffortBase { public: /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(EC::* Operation)(const E* const, const V* const, SUMOReal) const; + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); - DijkstraRouterEffort_ByProxi(size_t noE, bool unbuildIsWarningOnly, EC* receiver, Operation effortOperation, Operation ttOperation) - : DijkstraRouterEffortBase(noE, unbuildIsWarningOnly), - myReceiver(receiver), myEffortOperation(effortOperation), myTTOperation(ttOperation) {} + DijkstraRouterEffort_ByProxi(size_t noE, bool unbuildIsWarningOnly, Operation effortOperation, Operation ttOperation): + DijkstraRouterEffortBase(noE, unbuildIsWarningOnly), + myEffortOperation(effortOperation), + myTTOperation(ttOperation) {} inline SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const { - return (myReceiver->*myEffortOperation)(e, v, t); + return (*myEffortOperation)(e, v, t); } inline SUMOReal getTravelTime(const E* const e, const V* const v, SUMOReal t) const { - return (myReceiver->*myTTOperation)(e, v, t); + return (*myTTOperation)(e, v, t); } private: - /// @brief The object the action is directed to. - EC* myReceiver; - /// @brief The object's operation to perform for obtaining the effort Operation myEffortOperation; diff -Nru sumo-0.15.0~dfsg/src/utils/common/DijkstraRouterTT.h sumo-0.16.0~dfsg/src/utils/common/DijkstraRouterTT.h --- sumo-0.15.0~dfsg/src/utils/common/DijkstraRouterTT.h 2012-02-29 00:03:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/DijkstraRouterTT.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 July 2005 -/// @version $Id: DijkstraRouterTT.h 11970 2012-02-28 14:08:38Z namdre $ +/// @version $Id: DijkstraRouterTT.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Dijkstra shortest path algorithm using travel time /****************************************************************************/ @@ -32,6 +32,7 @@ #include #endif +#include #include #include #include @@ -75,8 +76,7 @@ /// Constructor DijkstraRouterTTBase(size_t noE, bool unbuildIsWarning) : SUMOAbstractRouter("DijkstraRouterTT"), - myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) - { + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { for (size_t i = 0; i < noE; i++) { myEdgeInfos.push_back(EdgeInfo(i)); } @@ -148,7 +148,7 @@ /** @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 void compute(const E* from, const E* to, const V* const vehicle, - SUMOTime msTime, std::vector &into) { + SUMOTime msTime, std::vector& into) { assert(from != 0 && to != 0); startQuery(); const SUMOReal time = STEPS2TIME(msTime); @@ -219,7 +219,7 @@ } - SUMOReal recomputeCosts(const std::vector &edges, const V* const v, SUMOTime msTime) const { + SUMOReal recomputeCosts(const std::vector& edges, const V* const v, SUMOTime msTime) const { const SUMOReal time = STEPS2TIME(msTime); SUMOReal costs = 0; for (typename std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { @@ -233,7 +233,7 @@ public: /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector &edges) { + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { std::deque tmp; while (rbegin != 0) { tmp.push_front((E*) rbegin->edge); // !!! @@ -258,24 +258,21 @@ }; -template +template class DijkstraRouterTT_ByProxi : public DijkstraRouterTTBase { public: /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(EC::* Operation)(const E* const, const V* const, SUMOReal) const; + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); - DijkstraRouterTT_ByProxi(size_t noE, bool unbuildIsWarningOnly, EC* receiver, Operation operation) - : DijkstraRouterTTBase(noE, unbuildIsWarningOnly), - myReceiver(receiver), myOperation(operation) {} + DijkstraRouterTT_ByProxi(size_t noE, bool unbuildIsWarningOnly, Operation operation): + DijkstraRouterTTBase(noE, unbuildIsWarningOnly), + myOperation(operation) {} inline SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const { - return (myReceiver->*myOperation)(e, v, t); + return (*myOperation)(e, v, t); } private: - /// @brief The object the action is directed to. - EC* myReceiver; - /// @brief The object's operation to perform. Operation myOperation; diff -Nru sumo-0.15.0~dfsg/src/utils/common/FileHelpers.h sumo-0.16.0~dfsg/src/utils/common/FileHelpers.h --- sumo-0.15.0~dfsg/src/utils/common/FileHelpers.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/FileHelpers.h 2012-11-29 00:02:20.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: FileHelpers.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: FileHelpers.h 13067 2012-11-28 13:56:00Z behrisch $ /// // Functions for an easier usage of files /****************************************************************************/ @@ -31,8 +31,10 @@ #include #endif +#include #include #include +#include #include "SUMOTime.h" @@ -178,7 +180,7 @@ * @return Reference to the stream */ static std::ostream& writeString(std::ostream& strm, const std::string& value); - //@} + /** @brief Writes a time description binary * @@ -192,9 +194,132 @@ static std::ostream& writeTime(std::ostream& strm, SUMOTime value); + /** @brief Writes an edge vector binary + * + * @param[in, out] os The stream to write into + * @param[in] edges The edges to write + * @return Reference to the stream + */ + template + static std::ostream& writeEdgeVector(std::ostream& os, const std::vector& edges); + + + /** @brief Reads an edge vector binary + * + * @param[in] is The stream to read from + * @param[out] edges The edge vector to write into + * @return Reference to the stream + */ + template + static void readEdgeVector(std::istream& in, std::vector& edges, const std::string& rid); + //@} + + }; +template +std::ostream& FileHelpers::writeEdgeVector(std::ostream& os, const std::vector& edges) { + FileHelpers::writeUInt(os, (unsigned int)edges.size()); + std::vector follow; + unsigned int maxFollow = 0; + E prev = edges.front(); + for (typename std::vector::const_iterator i = edges.begin() + 1; i != edges.end(); ++i) { + unsigned int idx = 0; + for (; idx < prev->getNoFollowing(); ++idx) { + if (idx > 15) { + break; + } + if (prev->getFollower(idx) == (*i)) { + follow.push_back(idx); + if (idx > maxFollow) { + maxFollow = idx; + } + break; + } + } + if (idx > 15 || idx == prev->getNoFollowing()) { + follow.clear(); + break; + } + prev = *i; + } + if (follow.empty()) { + for (typename std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + FileHelpers::writeInt(os, (*i)->getNumericalID()); + } + } else { + const int bits = maxFollow > 3 ? 4 : 2; + const unsigned int numFields = 8 * sizeof(unsigned int) / bits; + FileHelpers::writeInt(os, -bits); + FileHelpers::writeUInt(os, edges.front()->getNumericalID()); + unsigned int data = 0; + unsigned int field = 0; + for (std::vector::const_iterator i = follow.begin(); i != follow.end(); ++i) { + data |= *i; + field++; + if (field == numFields) { + FileHelpers::writeUInt(os, data); + data = 0; + field = 0; + } else { + data <<= bits; + } + } + if (field > 0) { + FileHelpers::writeUInt(os, data << ((numFields - field - 1) * bits)); + } + } + return os; +} + + +template +void FileHelpers::readEdgeVector(std::istream& in, std::vector& edges, const std::string& rid) { + int size; + in.read((char*) &size, sizeof(int)); + edges.reserve(size); + int bitsOrEntry; + in.read((char*) &bitsOrEntry, sizeof(int)); + if (bitsOrEntry < 0) { + const unsigned int bits = -bitsOrEntry; + const unsigned int numFields = 8 * sizeof(unsigned int) / bits; + const unsigned int mask = (1 << bits) - 1; + unsigned int edgeID; + in.read((char*) &edgeID, sizeof(int)); + const E* prev = E::dictionary(edgeID); + assert(prev != 0); + edges.push_back(prev); + size--; + unsigned int data = 0; + unsigned int field = numFields; + for (; size > 0; size--) { + if (field == numFields) { + in.read((char*) &data, sizeof(int)); + field = 0; + } + unsigned int followIndex = (data >> ((numFields - field - 1) * bits)) & mask; + if (followIndex >= prev->getNoFollowing()) { + throw ProcessError("Invalid follower index in route '" + rid + "'!"); + } + prev = prev->getFollower(followIndex); + edges.push_back(prev); + field++; + } + } else { + while (size > 0) { + const E* edge = E::dictionary(bitsOrEntry); + if (edge == 0) { + throw ProcessError("An edge within the route '" + rid + "' is not known!"); + } + edges.push_back(edge); + size--; + if (size > 0) { + in.read((char*) &bitsOrEntry, sizeof(int)); + } + } + } +} #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/common/HelpersHBEFA.cpp sumo-0.16.0~dfsg/src/utils/common/HelpersHBEFA.cpp --- sumo-0.15.0~dfsg/src/utils/common/HelpersHBEFA.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/HelpersHBEFA.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHBEFA.cpp 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: HelpersHBEFA.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ @@ -161,73 +161,73 @@ // =========================================================================== SUMOReal HelpersHBEFA::computeCO(SUMOEmissionClass c, double v, double a) { - return compute(c, CO_OFFSET, v, a); + return compute(c, CO_OFFSET, v, a); } SUMOReal HelpersHBEFA::computeCO2(SUMOEmissionClass c, double v, double a) { - return compute(c, CO2_OFFSET, v, a); + return compute(c, CO2_OFFSET, v, a); } SUMOReal HelpersHBEFA::computeHC(SUMOEmissionClass c, double v, double a) { - return compute(c, HC_OFFSET, v, a); + return compute(c, HC_OFFSET, v, a); } SUMOReal HelpersHBEFA::computeNOx(SUMOEmissionClass c, double v, double a) { - return compute(c, NOx_OFFSET, v, a); + return compute(c, NOx_OFFSET, v, a); } SUMOReal HelpersHBEFA::computePMx(SUMOEmissionClass c, double v, double a) { - return compute(c, PMx_OFFSET, v, a); + return compute(c, PMx_OFFSET, v, a); } SUMOReal HelpersHBEFA::computeFuel(SUMOEmissionClass c, double v, double a) { - return compute(c, FUEL_OFFSET, v, a) / 790.; + return compute(c, FUEL_OFFSET, v, a) / 790.; } SUMOReal HelpersHBEFA::computeDefaultCO(SUMOEmissionClass c, double v, double a, SUMOReal tt) { - return (compute(c, CO_OFFSET, v, 0) + compute(c, CO_OFFSET, v - a, a)) * tt / 2.; + return (compute(c, CO_OFFSET, v, 0) + compute(c, CO_OFFSET, v - a, a)) * tt / 2.; } SUMOReal HelpersHBEFA::computeDefaultCO2(SUMOEmissionClass c, double v, double a, SUMOReal tt) { - return (compute(c, CO2_OFFSET, v, 0) + compute(c, CO2_OFFSET, v - a, a)) * tt / 2.; + return (compute(c, CO2_OFFSET, v, 0) + compute(c, CO2_OFFSET, v - a, a)) * tt / 2.; } SUMOReal HelpersHBEFA::computeDefaultHC(SUMOEmissionClass c, double v, double a, SUMOReal tt) { - return (compute(c, HC_OFFSET, v, 0) + compute(c, HC_OFFSET, v - a, a)) * tt / 2.; + return (compute(c, HC_OFFSET, v, 0) + compute(c, HC_OFFSET, v - a, a)) * tt / 2.; } SUMOReal HelpersHBEFA::computeDefaultNOx(SUMOEmissionClass c, double v, double a, SUMOReal tt) { - return (compute(c, NOx_OFFSET, v, 0) + compute(c, NOx_OFFSET, v - a, a)) * tt / 2.; + return (compute(c, NOx_OFFSET, v, 0) + compute(c, NOx_OFFSET, v - a, a)) * tt / 2.; } SUMOReal HelpersHBEFA::computeDefaultPMx(SUMOEmissionClass c, double v, double a, SUMOReal tt) { - return (compute(c, PMx_OFFSET, v, 0) + compute(c, PMx_OFFSET, v - a, a)) * tt / 2.; + return (compute(c, PMx_OFFSET, v, 0) + compute(c, PMx_OFFSET, v - a, a)) * tt / 2.; } SUMOReal HelpersHBEFA::computeDefaultFuel(SUMOEmissionClass c, double v, double a, SUMOReal tt) { - return (compute(c, FUEL_OFFSET, v, 0) + compute(c, FUEL_OFFSET, v - a, a)) * tt / 2. / 790.; + return (compute(c, FUEL_OFFSET, v, 0) + compute(c, FUEL_OFFSET, v - a, a)) * tt / 2. / 790.; } diff -Nru sumo-0.15.0~dfsg/src/utils/common/HelpersHBEFA.h sumo-0.16.0~dfsg/src/utils/common/HelpersHBEFA.h --- sumo-0.15.0~dfsg/src/utils/common/HelpersHBEFA.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/HelpersHBEFA.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHBEFA.h 12066 2012-03-12 13:58:43Z behrisch $ +/// @version $Id: HelpersHBEFA.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ @@ -32,7 +32,6 @@ #endif #include -#include #include "StdDefs.h" #include "SUMOVehicleClass.h" #include @@ -66,7 +65,7 @@ * @param[in] a The vehicle's current acceleration * @return The amount of CO emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s] */ - static SUMOReal computeCO(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computeCO(SUMOEmissionClass c, double v, double a); /** @brief Returns the amount of emitted CO2 given the vehicle type and state (in mg/s) @@ -75,7 +74,7 @@ * @param[in] a The vehicle's current acceleration * @return The amount of CO2 emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s] */ - static SUMOReal computeCO2(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computeCO2(SUMOEmissionClass c, double v, double a); /** @brief Returns the amount of emitted HC given the vehicle type and state (in mg/s) @@ -84,7 +83,7 @@ * @param[in] a The vehicle's current acceleration * @return The amount of HC emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s] */ - static SUMOReal computeHC(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computeHC(SUMOEmissionClass c, double v, double a); /** @brief Returns the amount of emitted NOx given the vehicle type and state (in mg/s) @@ -93,7 +92,7 @@ * @param[in] a The vehicle's current acceleration * @return The amount of NOx emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s] */ - static SUMOReal computeNOx(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computeNOx(SUMOEmissionClass c, double v, double a); /** @brief Returns the amount of emitted PMx given the vehicle type and state (in mg/s) @@ -102,19 +101,19 @@ * @param[in] a The vehicle's current acceleration * @return The amount of PMx emitted by the given vehicle class when moving with the given velocity and acceleration [mg/s] */ - static SUMOReal computePMx(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computePMx(SUMOEmissionClass c, double v, double a); /** @brief Returns the amount of consumed fuel given the vehicle type and state (in ml/s) * * As the general function returns mg/s, this implementation scales with 790 (average density of fuel) - * - * @param[in] c The vehicle emission class + * + * @param[in] c The vehicle emission class * @param[in] v The vehicle's current velocity * @param[in] a The vehicle's current acceleration * @return The amount of fuel consumed by the given vehicle class when moving with the given velocity and acceleration [ml/s] */ - static SUMOReal computeFuel(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computeFuel(SUMOEmissionClass c, double v, double a); /** @brief Returns the amount of emitted CO given the vehicle type and default values for the state (in mg) @@ -124,7 +123,7 @@ * @param{in] tt the time the vehicle travels * @return The amount of CO emitted by the given vehicle class [mg] */ - static SUMOReal computeDefaultCO(SUMOEmissionClass c, double v, double a, SUMOReal tt) ; + static SUMOReal computeDefaultCO(SUMOEmissionClass c, double v, double a, SUMOReal tt); /** @brief Returns the amount of emitted CO2 given the vehicle type and default values for the state (in mg) @@ -134,7 +133,7 @@ * @param{in] tt the time the vehicle travels * @return The amount of CO2 emitted by the given vehicle class [mg] */ - static SUMOReal computeDefaultCO2(SUMOEmissionClass c, double v, double a, SUMOReal tt) ; + static SUMOReal computeDefaultCO2(SUMOEmissionClass c, double v, double a, SUMOReal tt); /** @brief Returns the amount of emitted HC given the vehicle type and default values for the state (in mg) @@ -144,7 +143,7 @@ * @param{in] tt the time the vehicle travels * @return The amount of HC emitted by the given vehicle class [mg] */ - static SUMOReal computeDefaultHC(SUMOEmissionClass c, double v, double a, SUMOReal tt) ; + static SUMOReal computeDefaultHC(SUMOEmissionClass c, double v, double a, SUMOReal tt); /** @brief Returns the amount of emitted NOx given the vehicle type and default values for the state (in mg) @@ -154,7 +153,7 @@ * @param{in] tt the time the vehicle travels * @return The amount of NOx emitted by the given vehicle class [mg] */ - static SUMOReal computeDefaultNOx(SUMOEmissionClass c, double v, double a, SUMOReal tt) ; + static SUMOReal computeDefaultNOx(SUMOEmissionClass c, double v, double a, SUMOReal tt); /** @brief Returns the amount of emitted PMx given the vehicle type and default values for the state (in mg) @@ -164,7 +163,7 @@ * @param{in] tt the time the vehicle travels * @return The amount of PMx emitted by the given vehicle class [mg] */ - static SUMOReal computeDefaultPMx(SUMOEmissionClass c, double v, double a, SUMOReal tt) ; + static SUMOReal computeDefaultPMx(SUMOEmissionClass c, double v, double a, SUMOReal tt); /** @brief Returns the amount of fuel given the vehicle type and default values for the state (in ml) @@ -174,7 +173,7 @@ * @param{in] tt the time the vehicle travels * @return The amount of fuel emitted by the given vehicle class [ml] */ - static SUMOReal computeDefaultFuel(SUMOEmissionClass c, double v, double a, SUMOReal tt) ; + static SUMOReal computeDefaultFuel(SUMOEmissionClass c, double v, double a, SUMOReal tt); private: @@ -182,7 +181,7 @@ * * As the functions are defining emissions(in g)/hour, the function's result is normed * by 3.6 (seconds in an hour/1000) yielding mg/s. Negative acceleration - * results directly in zero emission. + * results directly in zero emission. * * @param[in] c emission class for the function parameters to use * @param[in] offset the offset in the function parameters for the correct pollutant @@ -190,24 +189,24 @@ * @param[in] a The vehicle's current acceleration */ static inline SUMOReal compute(SUMOEmissionClass c, const int offset, double v, const double a) { - switch (c) { - case SVE_ZERO_EMISSIONS: - return 0.; - case SVE_UNKNOWN: - c = SVE_P_LDV_7_7; - break; - default: - break; - } + switch (c) { + case SVE_ZERO_EMISSIONS: + return 0.; + case SVE_UNKNOWN: + c = SVE_P_LDV_7_7; + break; + default: + break; + } v *= 3.6; - if (c > 42) { - const double* f = myFunctionParameter[c - 42] + offset; - return (SUMOReal) MAX2((f[0] + f[3] * v + f[4] * v * v + f[5] * v * v * v) / 3.6, 0.); - } + if (c > 42) { + const double* f = myFunctionParameter[c - 42] + offset; + return (SUMOReal) MAX2((f[0] + f[3] * v + f[4] * v * v + f[5] * v * v * v) / 3.6, 0.); + } if (a < 0.) { return 0.; } - const double* f = myFunctionParameter[c] + offset; + const double* f = myFunctionParameter[c] + offset; const double alpha = asin(a / 9.81) * 180. / PI; return (SUMOReal) MAX2((f[0] + f[1] * alpha * v + f[2] * alpha * alpha * v + f[3] * v + f[4] * v * v + f[5] * v * v * v) / 3.6, 0.); } diff -Nru sumo-0.15.0~dfsg/src/utils/common/HelpersHarmonoise.h sumo-0.16.0~dfsg/src/utils/common/HelpersHarmonoise.h --- sumo-0.15.0~dfsg/src/utils/common/HelpersHarmonoise.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/HelpersHarmonoise.h 2012-09-25 22:01:52.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHarmonoise.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: HelpersHarmonoise.h 12381 2012-06-08 09:28:48Z dkrajzew $ /// // Helper methods for Harmonoise-based noise emission computation /****************************************************************************/ @@ -32,7 +32,6 @@ #endif #include -#include #include "StdDefs.h" #include "SUMOVehicleClass.h" #include @@ -58,7 +57,7 @@ * @param[in] a The vehicle's current acceleration * @return The noise produced by the vehicle of the given class running with v and a */ - static SUMOReal computeNoise(SUMOEmissionClass c, double v, double a) ; + static SUMOReal computeNoise(SUMOEmissionClass c, double v, double a); /** @brief Computes the resulting noise diff -Nru sumo-0.15.0~dfsg/src/utils/common/IDSupplier.cpp sumo-0.16.0~dfsg/src/utils/common/IDSupplier.cpp --- sumo-0.15.0~dfsg/src/utils/common/IDSupplier.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/IDSupplier.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: IDSupplier.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: IDSupplier.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A class that generates enumerated and prefixed string-ids /****************************************************************************/ @@ -48,7 +48,7 @@ -IDSupplier::IDSupplier(const std::string& prefix, const std::vector &knownIDs) +IDSupplier::IDSupplier(const std::string& prefix, const std::vector& knownIDs) : myCurrent(0), myPrefix(prefix) { for (std::vector::const_iterator id_it = knownIDs.begin(); id_it != knownIDs.end(); ++id_it) { avoid(*id_it); diff -Nru sumo-0.15.0~dfsg/src/utils/common/IDSupplier.h sumo-0.16.0~dfsg/src/utils/common/IDSupplier.h --- sumo-0.15.0~dfsg/src/utils/common/IDSupplier.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/IDSupplier.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: IDSupplier.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: IDSupplier.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A class that generates enumerated and prefixed string-ids /****************************************************************************/ @@ -53,7 +53,7 @@ * @param[in] knownIDs List of IDs that should never be returned by this * IDSupplier **/ - IDSupplier(const std::string& prefix, const std::vector &knownIDs); + IDSupplier(const std::string& prefix, const std::vector& knownIDs); /// Destructor ~IDSupplier(); diff -Nru sumo-0.15.0~dfsg/src/utils/common/InstancePool.h sumo-0.16.0~dfsg/src/utils/common/InstancePool.h --- sumo-0.15.0~dfsg/src/utils/common/InstancePool.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/InstancePool.h 2012-09-25 22:01:52.000000000 +0000 @@ -2,7 +2,7 @@ /// @file InstancePool.h /// @author Daniel Krajzewicz /// @date Fri, 29.04.2005 -/// @version $Id: InstancePool.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: InstancePool.h 12381 2012-06-08 09:28:48Z dkrajzew $ /// // A pool of resuable instances /****************************************************************************/ @@ -32,7 +32,6 @@ #include #include -#include // =========================================================================== diff -Nru sumo-0.15.0~dfsg/src/utils/common/Makefile.am sumo-0.16.0~dfsg/src/utils/common/Makefile.am --- sumo-0.15.0~dfsg/src/utils/common/Makefile.am 2012-01-28 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/Makefile.am 2012-10-07 23:02:19.000000000 +0000 @@ -14,7 +14,8 @@ HelpersHBEFA.cpp HelpersHBEFA.h \ InstancePool.h \ IDSupplier.h IDSupplier.cpp \ -Named.h StringTokenizer.cpp StringTokenizer.h \ +Named.h Parameterised.cpp Parameterised.h \ +StringTokenizer.cpp StringTokenizer.h \ StringUtils.cpp StringUtils.h UtilExceptions.h \ MsgHandler.h MsgHandler.cpp \ RGBColor.cpp RGBColor.h RandHelper.h RandHelper.cpp \ @@ -24,7 +25,7 @@ SUMOVTypeParameter.cpp SUMOVTypeParameter.h \ MsgRetrievingFunction.h \ SUMOVehicleClass.cpp SUMOVehicleClass.h \ -ToString.h TplConvert.h TplConvertSec.h \ +ToString.h TplConvert.h \ ValueTimeLine.h diff -Nru sumo-0.15.0~dfsg/src/utils/common/Makefile.in sumo-0.16.0~dfsg/src/utils/common/Makefile.in --- sumo-0.15.0~dfsg/src/utils/common/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -51,11 +51,12 @@ libcommon_a_LIBADD = am_libcommon_a_OBJECTS = FileHelpers.$(OBJEXT) \ HelpersHarmonoise.$(OBJEXT) HelpersHBEFA.$(OBJEXT) \ - IDSupplier.$(OBJEXT) StringTokenizer.$(OBJEXT) \ - StringUtils.$(OBJEXT) MsgHandler.$(OBJEXT) RGBColor.$(OBJEXT) \ - RandHelper.$(OBJEXT) SUMOTime.$(OBJEXT) SystemFrame.$(OBJEXT) \ - SysUtils.$(OBJEXT) SUMOVehicleParameter.$(OBJEXT) \ - SUMOVTypeParameter.$(OBJEXT) SUMOVehicleClass.$(OBJEXT) + IDSupplier.$(OBJEXT) Parameterised.$(OBJEXT) \ + StringTokenizer.$(OBJEXT) StringUtils.$(OBJEXT) \ + MsgHandler.$(OBJEXT) RGBColor.$(OBJEXT) RandHelper.$(OBJEXT) \ + SUMOTime.$(OBJEXT) SystemFrame.$(OBJEXT) SysUtils.$(OBJEXT) \ + SUMOVehicleParameter.$(OBJEXT) SUMOVTypeParameter.$(OBJEXT) \ + SUMOVehicleClass.$(OBJEXT) libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -106,6 +107,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -136,6 +138,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -170,6 +173,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -203,7 +207,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -238,7 +241,8 @@ HelpersHBEFA.cpp HelpersHBEFA.h \ InstancePool.h \ IDSupplier.h IDSupplier.cpp \ -Named.h StringTokenizer.cpp StringTokenizer.h \ +Named.h Parameterised.cpp Parameterised.h \ +StringTokenizer.cpp StringTokenizer.h \ StringUtils.cpp StringUtils.h UtilExceptions.h \ MsgHandler.h MsgHandler.cpp \ RGBColor.cpp RGBColor.h RandHelper.h RandHelper.cpp \ @@ -248,7 +252,7 @@ SUMOVTypeParameter.cpp SUMOVTypeParameter.h \ MsgRetrievingFunction.h \ SUMOVehicleClass.cpp SUMOVehicleClass.h \ -ToString.h TplConvert.h TplConvertSec.h \ +ToString.h TplConvert.h \ ValueTimeLine.h all: all-am @@ -304,6 +308,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HelpersHarmonoise.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IDSupplier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MsgHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Parameterised.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RGBColor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RandHelper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOTime.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/utils/common/MsgHandler.cpp sumo-0.16.0~dfsg/src/utils/common/MsgHandler.cpp --- sumo-0.15.0~dfsg/src/utils/common/MsgHandler.cpp 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/MsgHandler.cpp 2012-09-25 22:01:52.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 17 Jun 2003 -/// @version $Id: MsgHandler.cpp 12029 2012-03-07 10:03:36Z behrisch $ +/// @version $Id: MsgHandler.cpp 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Retrieves messages about the process and gives them further to output /****************************************************************************/ @@ -274,7 +274,7 @@ void MsgHandler::assignLock(AbstractMutex* lock) { assert(myLock == 0); - myLock = lock ; + myLock = lock; } diff -Nru sumo-0.15.0~dfsg/src/utils/common/Named.h sumo-0.16.0~dfsg/src/utils/common/Named.h --- sumo-0.15.0~dfsg/src/utils/common/Named.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/Named.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,9 +3,9 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: Named.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Named.h 13107 2012-12-02 13:57:34Z behrisch $ /// -// Base class for objects which do have an id. +// Base class for objects which have an id. /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -32,6 +32,7 @@ #endif #include +#include // =========================================================================== @@ -39,12 +40,11 @@ // =========================================================================== /** * @class Named - * @brief Base class for objects which do have an id. + * @brief Base class for objects which have an id. */ class Named { public: /** @brief Constructor - * * @param[in] id The id of the object */ Named(const std::string& id) : myID(id) { } @@ -55,7 +55,6 @@ /** @brief Returns the id - * * @return The stored id */ const std::string& getID() const { @@ -63,13 +62,15 @@ } - /// @brief resets the id + /** @brief resets the id + * @param[in] newID The new id of this object + */ void setID(const std::string& newID) { myID = newID; } - /** Function-object for stable sorting in containers. */ + /// @brief Function-object for stable sorting in containers struct ComparatorIdLess { bool operator()(Named* const a, Named* const b) { return (a->getID() < b->getID()); @@ -78,6 +79,43 @@ + /** @class StoringVisitor + * @brief Allows to store the object; used as context while traveling the rtree in TraCI + */ + class StoringVisitor { + public: + /// @brief Contructor + StoringVisitor(std::set& ids) : myIDs(ids) {} + + /// @brief Destructor + ~StoringVisitor() {} + + /// @brief Adds the given object to the container + void add(const Named* const o) const { + myIDs.insert(o->getID()); + } + + /// @brief The container + std::set& myIDs; + + private: + /// @brief invalidated copy constructor + StoringVisitor(const StoringVisitor& src); + + /// @brief invalidated assignment operator + StoringVisitor& operator=(const StoringVisitor& src); + }; + + + + /** @brief Adds this object to the given container + * @param[in, filled] cont The container to add this item to + */ + void addTo(const StoringVisitor& cont) const { + cont.add(this); + } + + protected: /// @brief The name of the object std::string myID; diff -Nru sumo-0.15.0~dfsg/src/utils/common/NamedObjectCont.h sumo-0.16.0~dfsg/src/utils/common/NamedObjectCont.h --- sumo-0.15.0~dfsg/src/utils/common/NamedObjectCont.h 2012-02-01 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/NamedObjectCont.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NamedObjectCont.h 11822 2012-01-31 16:15:15Z namdre $ +/// @version $Id: NamedObjectCont.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A map of named object pointers /****************************************************************************/ @@ -175,7 +175,7 @@ * * @return Reference to a saved vector of objects within the map */ - const std::vector &buildAndGetStaticVector() const { + const std::vector& buildAndGetStaticVector() const { if (myHaveChanged) { myVector.clear(); typename IDMap::const_iterator i; @@ -208,7 +208,7 @@ /* @brief Fills the given vector with the stored objects' ids * @param[in] into The container to fill */ - void insertIDs(std::vector &into) const { + void insertIDs(std::vector& into) const { typename IDMap::const_iterator i; for (i = myMap.begin(); i != myMap.end(); ++i) { into.push_back((*i).first); @@ -220,7 +220,7 @@ * * @return A reference to the internal map */ - const IDMap &getMyMap() const { + const IDMap& getMyMap() const { return myMap; } diff -Nru sumo-0.15.0~dfsg/src/utils/common/Parameterised.cpp sumo-0.16.0~dfsg/src/utils/common/Parameterised.cpp --- sumo-0.15.0~dfsg/src/utils/common/Parameterised.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/Parameterised.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,97 @@ +/****************************************************************************/ +/// @file Parameterised.cpp +/// @author Daniel Krajzewicz +/// @date Sept 2002 +/// @version $Id: Parameterised.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// A RGB-color definition +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "Parameterised.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +Parameterised::Parameterised() {} + + +Parameterised::~Parameterised() {} + + +Parameterised::Parameterised(const std::map& mapArg) + : myMap(mapArg) +{ } + + +void +Parameterised::addParameter(const std::string& key, const std::string& value) { + myMap[key] = value; +} + + +void +Parameterised::addParameter(const std::map& mapArg) { + for (std::map::const_iterator i = mapArg.begin(); i != mapArg.end(); ++i) { + myMap[(*i).first] = (*i).second; + } +} + + +void +Parameterised::addParameter(const Parameterised& p) { + for (std::map::const_iterator i = p.myMap.begin(); i != p.myMap.end(); ++i) { + myMap[(*i).first] = (*i).second; + } +} + + +bool +Parameterised::knowsParameter(const std::string& key) const { + return myMap.find(key) != myMap.end(); +} + + +const std::string& +Parameterised::getParameter(const std::string& key, const std::string& defaultValue) const { + std::map::const_iterator i = myMap.find(key); + if (i != myMap.end()) { + return (*i).second; + } + return defaultValue; +} + + +void +Parameterised::clearParameter() { + myMap.clear(); +} + + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/common/Parameterised.h sumo-0.16.0~dfsg/src/utils/common/Parameterised.h --- sumo-0.15.0~dfsg/src/utils/common/Parameterised.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/Parameterised.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,112 @@ +/****************************************************************************/ +/// @file Parameterised.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: Parameterised.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// An upper class for objects with additional parameters +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef Parameterised_h +#define Parameterised_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class Parameterised + * @brief An upper class for objects with additional parameters + */ +class Parameterised { +public: + /** @brief Constructor + */ + Parameterised(); + + + /** @brief Constructor + * @param[in] mapArg Pre-given parameter + */ + Parameterised(const std::map& mapArg); + + + /// @brief Destructor + ~Parameterised(); + + + + /** @brief Adds a parameter + * @param[in] key The parameter's name + * @param[in] value The parameter's value + */ + void addParameter(const std::string& key, const std::string& value); + + + /** @brief Adds all given parameter + * @param[in] mapArg The keys/values to insert + */ + void addParameter(const std::map& mapArg); + + + /** @brief Adds all given parameter + * @param[in] p The keys/values to insert + */ + void addParameter(const Parameterised& p); + + + /** @brief Returns whether the parameter is known + * @param[in] key The key to ask for + * @return Whether the key is known + */ + bool knowsParameter(const std::string& key) const; + + + /** @brief Returns the value for a given key + * @param[in] key The key to ask for + * @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; + + + /** @brief Clears the parameter map + */ + void clearParameter(); + +private: + /// @brief The key->value map + std::map myMap; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/common/RGBColor.cpp sumo-0.16.0~dfsg/src/utils/common/RGBColor.cpp --- sumo-0.15.0~dfsg/src/utils/common/RGBColor.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/RGBColor.cpp 2012-11-17 00:02:20.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: RGBColor.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RGBColor.cpp 13001 2012-11-16 15:12:43Z behrisch $ /// // A RGB-color definition /****************************************************************************/ @@ -118,9 +118,9 @@ if (st.size() < 3) { throw EmptyData(); } - SUMOReal r = TplConvert::_2SUMOReal(st.next().c_str()); - SUMOReal g = TplConvert::_2SUMOReal(st.next().c_str()); - SUMOReal b = TplConvert::_2SUMOReal(st.next().c_str()); + const SUMOReal r = TplConvert::_2SUMOReal(st.next().c_str()); + const SUMOReal g = TplConvert::_2SUMOReal(st.next().c_str()); + const SUMOReal b = TplConvert::_2SUMOReal(st.next().c_str()); return RGBColor(r, g, b); } @@ -152,12 +152,6 @@ RGBColor -RGBColor::getDefaultColor() { - return parseColor(RGBColor::DEFAULT_COLOR_STRING); -} - - -RGBColor RGBColor::interpolate(const RGBColor& minColor, const RGBColor& maxColor, SUMOReal weight) { if (weight < 0) { weight = 0; diff -Nru sumo-0.15.0~dfsg/src/utils/common/RGBColor.h sumo-0.16.0~dfsg/src/utils/common/RGBColor.h --- sumo-0.15.0~dfsg/src/utils/common/RGBColor.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/RGBColor.h 2012-11-17 00:02:20.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RGBColor.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RGBColor.h 13001 2012-11-16 15:12:43Z behrisch $ /// // A RGB-color definition /****************************************************************************/ @@ -48,7 +48,7 @@ public: /** @brief Constructor */ - RGBColor() ; + RGBColor(); /** @brief Constructor @@ -56,16 +56,16 @@ * @param[in] green The green component's value * @param[in] blue The blue component's value */ - RGBColor(SUMOReal red, SUMOReal green, SUMOReal blue) ; + RGBColor(SUMOReal red, SUMOReal green, SUMOReal blue); /** @brief Copy constructor */ - RGBColor(const RGBColor& col) ; + RGBColor(const RGBColor& col); /// @brief Destructor - ~RGBColor() ; + ~RGBColor(); @@ -98,7 +98,7 @@ * @param[in] g The green component's value * @param[in] b The blue component's value */ - void set(SUMOReal r, SUMOReal g, SUMOReal b) ; + void set(SUMOReal r, SUMOReal g, SUMOReal b); /** @brief Writes the color to the given stream @@ -146,13 +146,7 @@ * @exception NumberFormatException If one of the components is not numeric */ static RGBColor parseColorReporting(const std::string& coldef, const std::string& objecttype, - const char* objectid, bool report, bool& ok) ; - - - /** @brief Returns the default color by parsing DEFAULT_COLOR_STRING - * @return The default color - */ - static RGBColor getDefaultColor() ; + const char* objectid, bool report, bool& ok); /** @brief Interpolates between two colors @@ -165,7 +159,7 @@ * @param[in] weight The weight of the first color * @return The interpolated color */ - static RGBColor interpolate(const RGBColor& minColor, const RGBColor& maxColor, SUMOReal weight) ; + static RGBColor interpolate(const RGBColor& minColor, const RGBColor& maxColor, SUMOReal weight); /** @brief Converts the given hsv-triplet to rgb @@ -175,7 +169,7 @@ * @return The color as RGB * @author Alvy Ray Smith (http://www.alvyray.com/default.htm) */ - static RGBColor fromHSV(SUMOReal h, SUMOReal s, SUMOReal v) ; + static RGBColor fromHSV(SUMOReal h, SUMOReal s, SUMOReal v); /// @brief The string description of the default color diff -Nru sumo-0.15.0~dfsg/src/utils/common/RandHelper.cpp sumo-0.16.0~dfsg/src/utils/common/RandHelper.cpp --- sumo-0.15.0~dfsg/src/utils/common/RandHelper.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/RandHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: RandHelper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RandHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // /****************************************************************************/ @@ -30,6 +30,7 @@ #endif #include +#include #include "RandHelper.h" #include #include @@ -63,14 +64,25 @@ oc.addDescription("seed", "Random Number", "Initialises the random number generator with the given value"); } - void -RandHelper::initRandGlobal() { +RandHelper::initRandGlobal(MTRand* which) { OptionsCont& oc = OptionsCont::getOptions(); + if (which == 0) { + which = &myRandomNumberGenerator; + } if (oc.getBool("random")) { - myRandomNumberGenerator.seed(); +#ifdef _MSC_VER + long s = myRandomNumberGenerator.hash(time(NULL), clock()) + SysUtils::getWindowsTicks(); + unsigned int s2 = (unsigned int)(s & 0xffff) ^ (s >> 16); + if (s2 < 0) { + s2 *= -1; + } + which->seed(s2); +#else + which->seed(); +#endif } else { - myRandomNumberGenerator.seed(oc.getInt("seed")); + which->seed(oc.getInt("seed")); } } diff -Nru sumo-0.15.0~dfsg/src/utils/common/RandHelper.h sumo-0.16.0~dfsg/src/utils/common/RandHelper.h --- sumo-0.15.0~dfsg/src/utils/common/RandHelper.h 2012-02-15 00:02:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/RandHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: RandHelper.h 11891 2012-02-14 12:45:16Z namdre $ +/// @version $Id: RandHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // /****************************************************************************/ @@ -31,6 +31,7 @@ #include #endif +#include #include #include @@ -50,57 +51,58 @@ */ class RandHelper { public: - /// Initialises the given options container with random number options + /// @brief Initialises the given options container with random number options static void insertRandOptions(); - /// Reads the given random number options and initialises the random number generator in accordance - static void initRandGlobal(); + /// @brief Reads the given random number options and initialises the random number generator in accordance + static void initRandGlobal(MTRand* which = 0); - /// Returns a random real number in [0, 1) + /// @brief Returns a random real number in [0, 1) static inline SUMOReal rand() { return (SUMOReal) RandHelper::myRandomNumberGenerator.randExc(); } - /// Returns a random real number in [0, maxV) + /// @brief Returns a random real number in [0, maxV) static inline SUMOReal rand(SUMOReal maxV) { return maxV * rand(); } - /// Returns a random real number in [minV, maxV) + /// @brief Returns a random real number in [minV, maxV) static inline SUMOReal rand(SUMOReal minV, SUMOReal maxV) { return minV + (maxV - minV) * rand(); } - /// Returns a random integer in [0, maxV-1] + /// @brief Returns a random integer in [0, maxV-1] static inline size_t rand(size_t maxV) { return (size_t) RandHelper::myRandomNumberGenerator.randInt((MTRand::uint32)(maxV - 1)); } - /// Returns a random integer in [0, maxV-1] + /// @brief Returns a random integer in [0, maxV-1] static inline int rand(int maxV) { return (int) RandHelper::myRandomNumberGenerator.randInt((MTRand::uint32)(maxV - 1)); } - /// Returns a random integer in [minV, maxV-1] + /// @brief Returns a random integer in [minV, maxV-1] static inline int rand(int minV, int maxV) { return minV + rand(maxV - minV); } - /// Access to a random number from a normal distribution - static inline SUMOReal randNorm(SUMOReal mean, SUMOReal variance) { - return (SUMOReal) RandHelper::myRandomNumberGenerator.randNorm(mean, variance); + /// @brief Access to a random number from a normal distribution + static inline SUMOReal randNorm(SUMOReal mean, SUMOReal variance, MTRand& rng = myRandomNumberGenerator) { + return (SUMOReal) rng.randNorm(mean, variance); } - /// Returns a random element from the given vector + /// @brief Returns a random element from the given vector template static inline T - getRandomFrom(const std::vector &v) { + getRandomFrom(const std::vector& v) { assert(v.size() > 0); return v[rand(v.size())]; } + protected: - /// the random number generator to use + /// @brief the random number generator to use static MTRand myRandomNumberGenerator; }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/RandomDistributor.h sumo-0.16.0~dfsg/src/utils/common/RandomDistributor.h --- sumo-0.15.0~dfsg/src/utils/common/RandomDistributor.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/RandomDistributor.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: RandomDistributor.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: RandomDistributor.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Represents a generic random distribution /****************************************************************************/ @@ -32,6 +32,7 @@ #endif #include +#include #include #include @@ -53,8 +54,20 @@ template class RandomDistributor { public: - /// @brief Constructor for an empty distribution - RandomDistributor() : myProb(0) { } + typedef void(*Operation)(const T); + static void doNothing(const T) {} + + /** @brief Constructor for an empty distribution + * @param[in] maximumSize The maximum size to maintain + * older entrys will be removed when adding more than the maximumSize + */ + RandomDistributor(unsigned int maximumSize = std::numeric_limits::max(), + Operation operation = &doNothing) : + myProb(0), + myMaximumSize(maximumSize), + myInsertionIndex(0), + myOperation(operation) + {} /// @brief Destructor ~RandomDistributor() { } @@ -80,21 +93,29 @@ } } } - myVals.push_back(val); - myProbs.push_back(prob); + if (myVals.size() < myMaximumSize) { + myVals.push_back(val); + myProbs.push_back(prob); + } else { + myOperation(myVals[myInsertionIndex]); + myVals[myInsertionIndex] = val; + myProbs[myInsertionIndex] = prob; + myInsertionIndex = (myInsertionIndex + 1) % myMaximumSize; + } } /** @brief Draw a sample of the distribution. * * A random sample is drawn according to the assigned probabilities. * + * @param[in] which The random number generator to use; the static one will be used if 0 is passed * @return the drawn member */ - T get() const { + T get(MTRand* which = 0) const { if (myProb == 0) { throw OutOfBoundsException(); } - SUMOReal prob = RandHelper::rand(myProb); + SUMOReal prob = which == 0 ? RandHelper::rand(myProb) : which->rand(myProb); for (size_t i = 0; i < myVals.size(); i++) { if (prob < myProbs[i]) { return myVals[i]; @@ -117,6 +138,9 @@ /// @brief Clears the distribution void clear() { myProb = 0; + for (size_t i = 0; i < myVals.size(); i++) { + myOperation(myVals[i]); + } myVals.clear(); myProbs.clear(); } @@ -128,7 +152,7 @@ * @return the members of the distribution * @see RandomDistributor::getProbs */ - const std::vector &getVals() const { + const std::vector& getVals() const { return myVals; } @@ -139,16 +163,22 @@ * @return the probabilities assigned to the distribution * @see RandomDistributor::getVals */ - const std::vector &getProbs() const { + const std::vector& getProbs() const { return myProbs; } private: /// @brief the total probability SUMOReal myProb; - /// @brief the members + /// @brief the maximumSize of the distribution that shall be maintained + unsigned int myMaximumSize; + /// @brief the index at which the next element shall be inserted if maximumSize is exceeded + unsigned int myInsertionIndex; + /// @brief the operation to perform with replaced elements + Operation myOperation; + /// @brief the members (acts as a ring buffer if myMaximumSize is reached) std::vector myVals; - /// @brief the corresponding probabilities + /// @brief the corresponding probabilities (acts as a ring buffer if myMaximumSize is reached) std::vector myProbs; }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOAbstractRouter.h sumo-0.16.0~dfsg/src/utils/common/SUMOAbstractRouter.h --- sumo-0.15.0~dfsg/src/utils/common/SUMOAbstractRouter.h 2012-02-29 00:03:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOAbstractRouter.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 25.Jan 2006 -/// @version $Id: SUMOAbstractRouter.h 11970 2012-02-28 14:08:38Z namdre $ +/// @version $Id: SUMOAbstractRouter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The dijkstra-router /****************************************************************************/ @@ -61,7 +61,7 @@ { } /// Destructor - virtual ~SUMOAbstractRouter() { + virtual ~SUMOAbstractRouter() { if (myNumQueries > 0) { WRITE_MESSAGE(myType + " answered " + toString(myNumQueries) + " queries and explored " + toString(double(myQueryVisits) / myNumQueries) + " edges on average."); WRITE_MESSAGE(myType + " spent " + toString(myQueryTimeSum) + " ms answering queries (" + toString(double(myQueryTimeSum) / myNumQueries) + " ms on average)."); @@ -71,9 +71,9 @@ /** @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 void compute(const E* from, const E* to, const V* const vehicle, - SUMOTime msTime, std::vector &into) = 0; + SUMOTime msTime, std::vector& into) = 0; - virtual SUMOReal recomputeCosts(const std::vector &edges, + virtual SUMOReal recomputeCosts(const std::vector& edges, const V* const v, SUMOTime msTime) const = 0; // interface extension for BulkStarRouter @@ -100,6 +100,9 @@ /// @brief the time spent querying in milliseconds long myQueryStartTime; long myQueryTimeSum; +private: + /// @brief Invalidated assignment operator + SUMOAbstractRouter& operator=(const SUMOAbstractRouter& s); }; @@ -113,7 +116,7 @@ return edge->prohibits(vehicle); } - void prohibit(const std::vector &toProhibit) { + void prohibit(const std::vector& toProhibit) { myProhibited = toProhibit; } diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOTime.h sumo-0.16.0~dfsg/src/utils/common/SUMOTime.h --- sumo-0.15.0~dfsg/src/utils/common/SUMOTime.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOTime.h 2012-09-25 22:01:52.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: SUMOTime.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SUMOTime.h 12388 2012-06-14 10:39:50Z namdre $ /// // Variables, methods, and tools for internal time representation /****************************************************************************/ @@ -42,6 +42,7 @@ // =========================================================================== typedef int SUMOTime; #define SUMOTime_MAX INT_MAX +#define SUMOTime_MIN INT_MIN #define SUMOTIME_MAXSTRING "2147483" // INT_MAX / 1000 #ifndef HAVE_SUBSECOND_TIMESTEPS @@ -95,7 +96,7 @@ // method declarations // =========================================================================== SUMOTime string2time(const std::string& r) throw(EmptyData, NumberFormatException, ProcessError); -std::string time2string(SUMOTime t) ; +std::string time2string(SUMOTime t); #endif diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVTypeParameter.cpp sumo-0.16.0~dfsg/src/utils/common/SUMOVTypeParameter.cpp --- sumo-0.15.0~dfsg/src/utils/common/SUMOVTypeParameter.cpp 2012-02-16 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVTypeParameter.cpp 2012-11-14 00:02:17.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 10.09.2009 -/// @version $Id: SUMOVTypeParameter.cpp 11905 2012-02-15 22:39:36Z behrisch $ +/// @version $Id: SUMOVTypeParameter.cpp 12973 2012-11-13 10:33:30Z behrisch $ /// // Structure representing possible vehicle parameter /****************************************************************************/ @@ -106,9 +106,12 @@ if (wasSet(VTYPEPARS_OSGFILE_SET)) { dev.writeAttr(SUMO_ATTR_OSGFILE, osgFile); } + if (wasSet(VTYPEPARS_IMGFILE_SET)) { + dev.writeAttr(SUMO_ATTR_IMGFILE, imgFile); + } if (cfParameter.size() != 0) { - dev << ">\n"; + dev.closeOpener(); dev.openTag(cfModel); std::vector attrs; for (CFParams::const_iterator i = cfParameter.begin(); i != cfParameter.end(); ++i) { diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVTypeParameter.h sumo-0.16.0~dfsg/src/utils/common/SUMOVTypeParameter.h --- sumo-0.15.0~dfsg/src/utils/common/SUMOVTypeParameter.h 2012-02-16 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVTypeParameter.h 2012-10-25 23:02:23.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 10.09.2009 -/// @version $Id: SUMOVTypeParameter.h 11905 2012-02-15 22:39:36Z behrisch $ +/// @version $Id: SUMOVTypeParameter.h 12887 2012-10-25 11:58:17Z behrisch $ /// // Structure representing possible vehicle parameter /****************************************************************************/ @@ -62,6 +62,7 @@ const int VTYPEPARS_HEIGHT_SET = 2 << 10; const int VTYPEPARS_SHAPE_SET = 2 << 11; const int VTYPEPARS_OSGFILE_SET = 2 << 12; +const int VTYPEPARS_IMGFILE_SET = 2 << 13; // =========================================================================== @@ -77,7 +78,7 @@ * * Initialises the structure with default values */ - SUMOVTypeParameter() ; + SUMOVTypeParameter(); /** @brief Returns whether the given parameter was set @@ -112,7 +113,7 @@ /// @brief The vehicle type's id std::string id; - /// @brief The physical vehicle length + the standing gap in m + /// @brief The physical vehicle length SUMOReal length; /// @brief This class' free space in front of the vehicle itself SUMOReal minGap; @@ -144,8 +145,11 @@ /// @brief This class' shape SUMOVehicleShape shape; - /// @brief This class 3D model file + /// @brief 3D model file for this class std::string osgFile; + + /// @brief Image file for this class + std::string imgFile; /// @} diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVehicle.h sumo-0.16.0~dfsg/src/utils/common/SUMOVehicle.h --- sumo-0.15.0~dfsg/src/utils/common/SUMOVehicle.h 2012-03-02 00:03:38.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVehicle.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 17 Feb 2009 -/// @version $Id: SUMOVehicle.h 11988 2012-03-01 15:06:05Z behrisch $ +/// @version $Id: SUMOVehicle.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Abstract base class for vehicle representations /****************************************************************************/ @@ -100,12 +100,6 @@ */ virtual const MSEdge* succEdge(unsigned int nSuccs) const = 0; - /** @brief Adapt the vehicle's maximum speed depending on the reference speed - * @param[in] the maximum speed on the edge - * @return The vehicle's new maximum speed - */ - virtual SUMOReal adaptMaxSpeed(SUMOReal referenceSpeed) = 0; - /// Replaces the current route by the given edges virtual bool replaceRouteEdges(const MSEdgeVector& edges, bool onInit = false) = 0; @@ -121,12 +115,12 @@ * @param[in] router The router to use * @see replaceRoute */ - virtual void reroute(SUMOTime t, SUMOAbstractRouter &router, bool withTaz = false) = 0; + virtual void reroute(SUMOTime t, SUMOAbstractRouter& router, bool withTaz = false) = 0; - /** @brief Returns the vehicle's acceleration before dawdling - * @return The acceleration before dawdling + /** @brief Returns the vehicle's acceleration + * @return The acceleration */ - virtual SUMOReal getPreDawdleAcceleration() const = 0; + virtual SUMOReal getAcceleration() const = 0; /** @brief Returns the edge the vehicle is currently at * @@ -157,6 +151,14 @@ */ virtual SUMOTime getDeparture() const = 0; + /** @brief Returns whether this vehicle has departed + */ + virtual bool hasDeparted() const = 0; + + /** @brief Returns whether this vehicle has arrived + */ + virtual bool hasArrived() const = 0; + /** @brief Returns the number of new routes this vehicle got * @return the number of new routes this vehicle got */ @@ -165,7 +167,7 @@ /** @brief Returns this vehicle's devices * @return This vehicle's devices */ - virtual const std::vector &getDevices() const = 0; + virtual const std::vector& getDevices() const = 0; /** @brief Adds a person to this vehicle * @@ -181,7 +183,7 @@ * @param[in] stop The stop to add * @return Whether the stop could be added */ - virtual bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset=0) = 0; + virtual bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset = 0) = 0; /** @brief Returns whether the vehicle is at a stop * @return Whether the has stopped @@ -189,6 +191,7 @@ virtual bool isStopped() const = 0; + virtual SUMOReal getChosenSpeedFactor() const = 0; }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleClass.cpp sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleClass.cpp --- sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleClass.cpp 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleClass.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date 2006-01-24 -/// @version $Id: SUMOVehicleClass.cpp 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: SUMOVehicleClass.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Definitions of SUMO vehicle classes and helper functions /****************************************************************************/ @@ -134,19 +134,9 @@ } -std::string +std::string getAllowedVehicleClassNames(SVCPermissions permissions) { - std::ostringstream oss; - const std::vector classNames = getAllowedVehicleClassNamesList(permissions); - bool hadOne = false; - for (std::vector::const_iterator it = classNames.begin(); it != classNames.end(); it++) { - if (hadOne) { - oss << ' '; - } - oss << *it; - hadOne = true; - } - return oss.str(); + return joinToString(getAllowedVehicleClassNamesList(permissions), ' '); } @@ -165,7 +155,7 @@ } -std::pair +std::pair getPermissionEncoding(SVCPermissions permissions) { // shortcut the common cases if (permissions == SVCFreeForAll) { @@ -173,12 +163,12 @@ } // figure out whether its shorter to write allow or disallow size_t num_allowed = 0; - for(int mask = 1; mask < SUMOVehicleClass_MAX; mask = mask << 1) { + for (int mask = 1; mask <= SUMOVehicleClass_MAX; mask = mask << 1) { if ((mask & permissions) == mask) { ++num_allowed; } } - if (num_allowed <= (SumoVehicleClassStrings.size() - num_allowed)) { + if (num_allowed <= (SumoVehicleClassStrings.size() - num_allowed) && num_allowed > 0) { return std::pair(getAllowedVehicleClassNames(permissions), true); } else { return std::pair(getAllowedVehicleClassNames(~permissions), false); @@ -208,7 +198,7 @@ } -SVCPermissions +SVCPermissions parseVehicleClasses(const std::string& allowedS) { SVCPermissions result = 0; StringTokenizer sta(allowedS, " "); @@ -219,7 +209,7 @@ } -bool +bool canParseVehicleClasses(const std::string& classes) { StringTokenizer sta(classes, " "); while (sta.hasNext()) { @@ -245,8 +235,8 @@ } -SVCPermissions -parseVehicleClasses(const std::vector &allowedS) { +SVCPermissions +parseVehicleClasses(const std::vector& allowedS) { SVCPermissions result = 0; for (std::vector::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) { result |= getVehicleClassID(*i); @@ -271,6 +261,11 @@ } +bool isRailway(SVCPermissions permissions) { + const int anyRail = SVC_RAIL_FAST + SVC_RAIL_SLOW + SVC_CITYRAIL + SVC_LIGHTRAIL; + return (permissions & anyRail) > 0 && (permissions & SVC_PASSENGER) == 0; +} + // ------------ Conversion of SUMOEmissionClass SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name) { @@ -280,25 +275,25 @@ } else if (name == "zero") { return SVE_ZERO_EMISSIONS; } else if (name.find("HDV_3_") == 0) { - return (SUMOEmissionClass)(SVE_HDV_3_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_HDV_3_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("HDV_6_") == 0) { - return (SUMOEmissionClass)(SVE_HDV_6_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_HDV_6_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("HDV_12_") == 0) { - return (SUMOEmissionClass)(SVE_HDV_12_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_HDV_12_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("P_7_") == 0) { - return (SUMOEmissionClass)(SVE_P_LDV_7_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_P_LDV_7_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("P_14_") == 0) { - return (SUMOEmissionClass)(SVE_P_LDV_14_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_P_LDV_14_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("HDV_A0_3_") == 0) { - return (SUMOEmissionClass)(SVE_HDV_A0_3_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_HDV_A0_3_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("HDV_A0_6_") == 0) { - return (SUMOEmissionClass)(SVE_HDV_A0_6_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_HDV_A0_6_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("HDV_A0_12_") == 0) { - return (SUMOEmissionClass)(SVE_HDV_A0_12_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_HDV_A0_12_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("P_A0_7_") == 0) { - return (SUMOEmissionClass)(SVE_P_LDV_A0_7_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_P_LDV_A0_7_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } else if (name.find("P_A0_14_") == 0) { - return (SUMOEmissionClass)(SVE_P_LDV_A0_14_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); + return (SUMOEmissionClass)(SVE_P_LDV_A0_14_1 - 1 + TplConvert::_2int(name.substr(name.rfind("_") + 1).c_str())); } } catch (NumberFormatException&) { } @@ -344,6 +339,13 @@ const SumoXMLTag DEFAULT_VEH_FOLLOW_MODEL(SUMO_TAG_CF_KRAUSS); const std::string DEFAULT_VEH_LANE_CHANGE_MODEL("dkrajzew2008"); const SUMOVehicleShape DEFAULT_VEH_SHAPE(SVS_UNKNOWN); +const SUMOReal DEFAULT_VEH_TMP1(1.); +const SUMOReal DEFAULT_VEH_TMP2(1.); +const SUMOReal DEFAULT_VEH_TMP3(1.); +const SUMOReal DEFAULT_VEH_TMP4(1.); +const SUMOReal DEFAULT_VEH_TMP5(1.); + +const SUMOReal DEFAULT_PERSON_SPEED(5. / 3.6); /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleClass.h sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleClass.h --- sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleClass.h 2012-03-08 00:03:23.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleClass.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date 2006-01-24 -/// @version $Id: SUMOVehicleClass.h 12038 2012-03-07 14:50:31Z namdre $ +/// @version $Id: SUMOVehicleClass.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Definitions of SUMO vehicle classes and helper functions /****************************************************************************/ @@ -375,7 +375,7 @@ /** @brief Encodes the given vector of allowed classs into a bitset * @param[in] classesS The names vector to parse */ -extern SVCPermissions parseVehicleClasses(const std::vector &allowedS); +extern SVCPermissions parseVehicleClasses(const std::vector& allowedS); // --------------------------------------------------------------------------- @@ -409,7 +409,14 @@ * @param[in] name The name of the emission class * @return The internal representation of this class */ -extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name) ; +extern SUMOEmissionClass getVehicleEmissionTypeID(const std::string& name); + + +/** @brief Returns whether an edge with the given permission is a railway edge + * @param[in] permissions The permissions of the edge + * @return Whether the edge is a railway edge + */ +extern bool isRailway(SVCPermissions permissions); // --------------------------------------------------------------------------- @@ -432,6 +439,13 @@ extern const SumoXMLTag DEFAULT_VEH_FOLLOW_MODEL; extern const std::string DEFAULT_VEH_LANE_CHANGE_MODEL; extern const SUMOVehicleShape DEFAULT_VEH_SHAPE; +extern const SUMOReal DEFAULT_VEH_TMP1; +extern const SUMOReal DEFAULT_VEH_TMP2; +extern const SUMOReal DEFAULT_VEH_TMP3; +extern const SUMOReal DEFAULT_VEH_TMP4; +extern const SUMOReal DEFAULT_VEH_TMP5; + +extern const SUMOReal DEFAULT_PERSON_SPEED; #endif diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleParameter.cpp sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleParameter.cpp --- sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleParameter.cpp 2012-02-08 00:02:17.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleParameter.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 31.03.2009 -/// @version $Id: SUMOVehicleParameter.cpp 11840 2012-02-07 08:22:50Z behrisch $ +/// @version $Id: SUMOVehicleParameter.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Structure representing possible vehicle parameter /****************************************************************************/ @@ -55,7 +55,7 @@ arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT), arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT), repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), - line(), fromTaz(), toTaz(), setParameter(0) { + line(), fromTaz(), toTaz(), personCapacity(0), personNumber(0), setParameter(0) { } @@ -239,105 +239,184 @@ if (wasSet(VEHPARS_TAZ_SET)) { dev.writeAttr(SUMO_ATTR_FROM_TAZ, fromTaz).writeAttr(SUMO_ATTR_TO_TAZ, toTaz); } + 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); + } dev.closeOpener(); } bool -SUMOVehicleParameter::departlaneValidate(const std::string& val) { - if (val == "random" || val == "free" || val == "departlane" || val == "allowed" || val == "best") { - return true; - } - try { - TplConvert::_2int(val.c_str()); - return true; - } catch (NumberFormatException&) { - } catch (EmptyData&) { +SUMOVehicleParameter::parseDepartLane(const std::string& val, const std::string& element, const std::string& id, + int& lane, DepartLaneDefinition& dld, std::string& error) { + bool ok = true; + if (val == "random") { + dld = DEPART_LANE_RANDOM; + } else if (val == "free") { + dld = DEPART_LANE_FREE; + } else if (val == "allowed") { + dld = DEPART_LANE_ALLOWED_FREE; + } else if (val == "best") { + dld = DEPART_LANE_BEST_FREE; + } else { + try { + lane = TplConvert::_2int(val.c_str()); + dld = DEPART_LANE_GIVEN; + if (lane < 0) { + ok = false; + } + } catch (...) { + ok = false; + } + } + if (!ok) { + error = "Invalid departLane definition for " + element + " '" + id + "';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", or an int>0)"; } - WRITE_ERROR("Invalid departlane definition;\n must be one of (\"departlane\", \"random\", \"free\", \"allowed\", \"best\", or an int>0)"); - return false; + return ok; } bool -SUMOVehicleParameter::departposValidate(const std::string& val) { - if (val == "random" || val == "free" || val == "random_free" || val == "base" || val == "pwagSimple" || val == "pwagGeneric" || val == "maxSpeedGap") { - return true; - } - try { - TplConvert::_2SUMOReal(val.c_str()); - return true; - } catch (NumberFormatException&) { - } catch (EmptyData&) { +SUMOVehicleParameter::parseDepartPos(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& pos, DepartPosDefinition& dpd, std::string& error) { + bool ok = true; + if (val == "random") { + dpd = DEPART_POS_RANDOM; + } else if (val == "random_free") { + dpd = DEPART_POS_RANDOM_FREE; + } else if (val == "free") { + dpd = DEPART_POS_FREE; + } else if (val == "base") { + dpd = DEPART_POS_BASE; + } else if (val == "pwagSimple") { + dpd = DEPART_POS_PWAG_SIMPLE; + } else if (val == "pwagGeneric") { + dpd = DEPART_POS_PWAG_GENERIC; + } else if (val == "maxSpeedGap") { + dpd = DEPART_POS_MAX_SPEED_GAP; + } else { + try { + pos = TplConvert::_2SUMOReal(val.c_str()); + dpd = DEPART_POS_GIVEN; + } catch (...) { + ok = false; + } + } + if (!ok) { + error = "Invalid departPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"pwagSimple\", \"pwagGeneric\", \"maxSpeedGap\", or a float)"; } - WRITE_ERROR("Invalid departpos definition;\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"pwagSimple\", \"pwagGeneric\", \"maxSpeedGap\", or a float)"); - return false; + return ok; } bool -SUMOVehicleParameter::departspeedValidate(const std::string& val) { - if (val == "random" || val == "max") { - return true; - } - try { - TplConvert::_2SUMOReal(val.c_str()); - return true; - } catch (NumberFormatException&) { - } catch (EmptyData&) { +SUMOVehicleParameter::parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error) { + bool ok = true; + if (val == "random") { + dsd = DEPART_SPEED_RANDOM; + } else if (val == "max") { + dsd = DEPART_SPEED_MAX; + } else { + try { + speed = TplConvert::_2SUMOReal(val.c_str()); + dsd = DEPART_SPEED_GIVEN; + if (speed < 0) { + ok = false; + } + } catch (...) { + ok = false; + } + } + if (!ok) { + error = "Invalid departSpeed definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float>0)"; } - WRITE_ERROR("Invalid departspeed definition;\n must be one of (\"random\", \"max\", or a float>0)"); - return false; + return ok; } bool -SUMOVehicleParameter::arrivallaneValidate(const std::string& val) { +SUMOVehicleParameter::parseArrivalLane(const std::string& val, const std::string& element, const std::string& id, + int& lane, ArrivalLaneDefinition& ald, std::string& error) { + bool ok = true; if (val == "current") { - return true; + ald = ARRIVAL_LANE_CURRENT; + } else { + try { + lane = TplConvert::_2int(val.c_str()); + ald = ARRIVAL_LANE_GIVEN; + if (lane < 0) { + ok = false; + } + } catch (...) { + ok = false; + } } - try { - TplConvert::_2int(val.c_str()); - return true; - } catch (NumberFormatException&) { - } catch (EmptyData&) { + if (!ok) { + error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or int>0)"; } - WRITE_ERROR("Invalid arrivallane definition;\n must be one of (\"current\", or int>0)"); - return false; + return ok; } bool -SUMOVehicleParameter::arrivalposValidate(const std::string& val) { - if (val == "random" || val == "max") { - return true; - } - try { - TplConvert::_2SUMOReal(val.c_str()); - return true; - } catch (NumberFormatException&) { - } catch (EmptyData&) { +SUMOVehicleParameter::parseArrivalPos(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error) { + bool ok = true; + if (val == "random") { + apd = ARRIVAL_POS_RANDOM; + } else if (val == "max") { + apd = ARRIVAL_POS_MAX; + } else { + try { + pos = TplConvert::_2SUMOReal(val.c_str()); + apd = ARRIVAL_POS_GIVEN; + } catch (...) { + ok = false; + } } - WRITE_ERROR("Invalid arrivalpos definition;\n must be one of (\"random\", \"max\", or a float)"); - return false; + if (!ok) { + error = "Invalid arrivalPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float)"; + } + return ok; } bool -SUMOVehicleParameter::arrivalspeedValidate(const std::string& val) { +SUMOVehicleParameter::parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error) { + bool ok = true; if (val == "current") { - return true; + asd = ARRIVAL_SPEED_CURRENT; + } else { + try { + speed = TplConvert::_2SUMOReal(val.c_str()); + asd = ARRIVAL_SPEED_GIVEN; + } catch (...) { + ok = false; + } } - try { - TplConvert::_2SUMOReal(val.c_str()); - return true; - } catch (NumberFormatException&) { - } catch (EmptyData&) { + if (!ok) { + error = "Invalid arrivalSpeed definition for " + element + " '" + id + "';\n must be one of (\"current\", or a float>0)"; } - WRITE_ERROR("Invalid arrivalspeed definition;\n must be one of (\"current\", or a float>0)"); - return false; + return ok; } +SUMOReal +SUMOVehicleParameter::interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id) { + if (pos < 0) { + pos = maximumValue + pos; + } + if (pos > maximumValue) { + WRITE_WARNING("Invalid " + toString(attr) + " " + toString(pos) + " given for " + id + ". Inserting at edge end instead."); + pos = maximumValue; + } + return pos; +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleParameter.h sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleParameter.h --- sumo-0.15.0~dfsg/src/utils/common/SUMOVehicleParameter.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SUMOVehicleParameter.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date 2006-01-24 -/// @version $Id: SUMOVehicleParameter.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SUMOVehicleParameter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Structure representing possible vehicle parameter /****************************************************************************/ @@ -62,6 +62,8 @@ const int VEHPARS_LINE_SET = 2 << 11; const int VEHPARS_TAZ_SET = 2 << 12; const int VEHPARS_FORCE_REROUTE = 2 << 13; +const int VEHPARS_PERSON_CAPACITY_SET = 2 << 14; +const int VEHPARS_PERSON_NUMBER_SET = 2 << 15; const int STOP_INDEX_END = -1; const int STOP_INDEX_FIT = -2; @@ -223,7 +225,7 @@ * * Initialises the structure with default values */ - SUMOVehicleParameter() ; + SUMOVehicleParameter(); /** @brief Returns whether the given parameter was set @@ -251,56 +253,100 @@ * @param[in] optionName The name of the option to determine whether its value shall be used * @return Whether the option is set and --defaults-override was set */ - bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const ; + bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const; /// @name Depart/arrival-attributes verification /// @{ - /** @brief Validates a given departlane value - * @param[in] val The departlane value to validate - * @return Whether the given value is a valid departlane definition + /** @brief Validates a given departLane value + * @param[in] val The departLane value to parse + * @param[in] element The name of the type of the parsed element, for building the error message + * @param[in] id The id of the parsed element, for building the error message + * @param[out] lane The parsed lane, if given + * @param[out] dld The parsed departLane definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid departLane definition + */ + static bool parseDepartLane(const std::string& val, const std::string& element, const std::string& id, + int& lane, DepartLaneDefinition& dld, std::string& error); + + + /** @brief Validates a given departPos value + * @param[in] val The departPos value to parse + * @param[in] element The name of the type of the parsed element, for building the error message + * @param[in] id The id of the parsed element, for building the error message + * @param[out] pos The parsed position, if given + * @param[out] dpd The parsed departPos definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid departPos definition + */ + static bool parseDepartPos(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& pos, DepartPosDefinition& dpd, std::string& error); + + + /** @brief Validates a given departSpeed value + * @param[in] val The departSpeed value to parse + * @param[in] element The name of the type of the parsed element, for building the error message + * @param[in] id The id of the parsed element, for building the error message + * @param[out] speed The parsed speed, if given + * @param[out] dsd The parsed departSpeed definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid departSpeed definition + */ + static bool parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error); + + + /** @brief Validates a given arrivalLane value + * @param[in] val The arrivalLane value to parse + * @param[in] element The name of the type of the parsed element, for building the error message + * @param[in] id The id of the parsed element, for building the error message + * @param[out] lane The parsed lane, if given + * @param[out] ald The parsed arrivalLane definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid arrivalLane definition + */ + static bool parseArrivalLane(const std::string& val, const std::string& element, const std::string& id, + int& lane, ArrivalLaneDefinition& ald, std::string& error); + + + /** @brief Validates a given arrivalPos value + * @param[in] val The arrivalPos value to parse + * @param[in] element The name of the type of the parsed element, for building the error message + * @param[in] id The id of the parsed element, for building the error message + * @param[out] pos The parsed position, if given + * @param[out] apd The parsed arrivalPos definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid arrivalPos definition + */ + static bool parseArrivalPos(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error); + + + /** @brief Validates a given arrivalSpeed value + * @param[in] val The arrivalSpeed value to parse + * @param[in] element The name of the type of the parsed element, for building the error message + * @param[in] id The id of the parsed element, for building the error message + * @param[out] speed The parsed speed, if given + * @param[out] asd The parsed arrivalSpeed definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid arrivalSpeed definition */ - static bool departlaneValidate(const std::string& val) ; - - - /** @brief Validates a given departpos value - * @param[in] val The departpos value to validate - * @return Whether the given value is a valid departpos definition - */ - static bool departposValidate(const std::string& val) ; - - - /** @brief Validates a given departspeed value - * @param[in] val The departspeed value to validate - * @return Whether the given value is a valid departspeed definition - */ - static bool departspeedValidate(const std::string& val) ; - - - /** @brief Validates a given arrivallane value - * @param[in] val The arrivallane value to validate - * @return Whether the given value is a valid arrivallane definition - */ - static bool arrivallaneValidate(const std::string& val) ; - - - /** @brief Validates a given arrivalpos value - * @param[in] val The arrivalpos value to validate - * @return Whether the given value is a valid arrivalpos definition - */ - static bool arrivalposValidate(const std::string& val) ; - - - /** @brief Validates a given arrivalspeed value - * @param[in] val The arrivalspeed value to validate - * @return Whether the given value is a valid arrivalspeed definition - */ - static bool arrivalspeedValidate(const std::string& val) ; + static bool parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id, + SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error); /// @} + /** @brief Interprets negative edge positions and fits them onto a given edge + * @param[in] pos The position to be interpreted + * @param[in] maximumValue The maximum allowed value (edge length) + * @param[in] attr The attribute from which the value originated + * @param[in] id The id of the object to which this attribute belongs + * @return Whether the interpreted position + */ + static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id); /// @brief The vehicle's id std::string id; @@ -405,8 +451,15 @@ /// @brief List of the stops the vehicle will make std::vector stops; + /// @brief The vehicle's capacity (persons) + unsigned int personCapacity; + + /// @brief The number of persons in the vehicle + unsigned int personNumber; + /// @brief Information for the router which parameter were set - int setParameter; + mutable int setParameter; + }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/StringUtils.h sumo-0.16.0~dfsg/src/utils/common/StringUtils.h --- sumo-0.15.0~dfsg/src/utils/common/StringUtils.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/StringUtils.h 2012-09-25 22:01:52.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date unknown -/// @version $Id: StringUtils.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: StringUtils.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Some static methods for string processing /****************************************************************************/ @@ -69,7 +69,7 @@ * @param[in] orig The original string * @return the string with the escaped sequences */ - static std::string escapeXML(const std::string& orig) ; + static std::string escapeXML(const std::string& orig); /// An empty string static std::string emptyString; diff -Nru sumo-0.15.0~dfsg/src/utils/common/SysUtils.cpp sumo-0.16.0~dfsg/src/utils/common/SysUtils.cpp --- sumo-0.15.0~dfsg/src/utils/common/SysUtils.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SysUtils.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,9 +2,9 @@ /// @file SysUtils.cpp /// @author Daniel Krajzewicz /// @date Tue, 29.05.2005 -/// @version $Id: SysUtils.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SysUtils.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// -// +// A few system-specific functions /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -31,7 +31,9 @@ #ifndef WIN32 #include #else +#define NOMINMAX #include +#undef NOMINMAX #endif #ifdef CHECK_MEMORY_LEAKS @@ -59,6 +61,14 @@ } +#ifdef _MSC_VER +long +SysUtils::getWindowsTicks() { + return (long) GetTickCount(); +} +#endif + + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/common/SysUtils.h sumo-0.16.0~dfsg/src/utils/common/SysUtils.h --- sumo-0.15.0~dfsg/src/utils/common/SysUtils.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SysUtils.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,9 +2,9 @@ /// @file SysUtils.h /// @author Daniel Krajzewicz /// @date Fri, 29.04.2005 -/// @version $Id: SysUtils.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SysUtils.h 13107 2012-12-02 13:57:34Z behrisch $ /// -// +// A few system-specific functions /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors @@ -34,10 +34,26 @@ // =========================================================================== // class definitions // =========================================================================== +/** @class SysUtils + * @brief A few system-specific functions + */ class SysUtils { public: + /** @brief Returns the current time in milliseconds + * @return Current time + */ static long getCurrentMillis(); + +#ifdef _MSC_VER + /** @brief Returns the CPU ticks (windows only) + * + * Used for random number initialisation, linux version + * uses a different method + */ + static long getWindowsTicks(); +#endif + }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/SystemFrame.cpp sumo-0.16.0~dfsg/src/utils/common/SystemFrame.cpp --- sumo-0.15.0~dfsg/src/utils/common/SystemFrame.cpp 2012-02-25 00:03:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/SystemFrame.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 23.06.2003 -/// @version $Id: SystemFrame.cpp 11955 2012-02-24 13:13:35Z behrisch $ +/// @version $Id: SystemFrame.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // A set of actions common to all applications /****************************************************************************/ @@ -35,6 +35,7 @@ #include #include #include +#include #include "RandHelper.h" #ifdef CHECK_MEMORY_LEAKS @@ -85,6 +86,9 @@ oc.doRegister("version", 'V', new Option_Bool(false)); oc.addDescription("version", "Report", "Prints the current version"); + oc.doRegister("xml-validation", 'X', new Option_Bool(false)); + oc.addDescription("xml-validation", "Report", "Enable schema validation of XML inputs"); + oc.doRegister("no-warnings", 'W', new Option_Bool(false)); oc.addSynonyme("no-warnings", "suppress-warnings", true); oc.addDescription("no-warnings", "Report", "Disables output of warnings"); @@ -103,6 +107,8 @@ void SystemFrame::close() { + // close all output devices + OutputDevice::closeAll(); // close the xml-subsystem XMLSubSys::close(); // delete build program options diff -Nru sumo-0.15.0~dfsg/src/utils/common/ToString.h sumo-0.16.0~dfsg/src/utils/common/ToString.h --- sumo-0.15.0~dfsg/src/utils/common/ToString.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/ToString.h 2012-10-19 23:02:43.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Wed, 23 Sep 2002 -/// @version $Id: ToString.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ToString.h 12872 2012-10-19 11:14:03Z behrisch $ /// // ------------------- /****************************************************************************/ @@ -116,6 +116,38 @@ return SUMOXMLDefinitions::TrafficLightTypes.getString(type); } + +template +inline std::string joinToString(const std::vector& v, const T_BETWEEN& between, std::streamsize accuracy = OUTPUT_ACCURACY) { + std::ostringstream oss; + bool connect = false; + for (typename std::vector::const_iterator it = v.begin(); it != v.end(); ++it) { + if (connect) { + oss << toString(between, accuracy); + } else { + connect = true; + } + oss << toString(*it, accuracy); + } + return oss.str(); +} + + +template +inline std::string joinToString(const std::set& s, const T_BETWEEN& between, std::streamsize accuracy = OUTPUT_ACCURACY) { + std::ostringstream oss; + bool connect = false; + for (typename std::set::const_iterator it = s.begin(); it != s.end(); ++it) { + if (connect) { + oss << toString(between, accuracy); + } else { + connect = true; + } + oss << toString(*it, accuracy); + } + return oss.str(); +} + #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/common/TplConvert.h sumo-0.16.0~dfsg/src/utils/common/TplConvert.h --- sumo-0.15.0~dfsg/src/utils/common/TplConvert.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/TplConvert.h 2012-12-01 00:02:18.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sun, 09 Jun 2002 -/// @version $Id: TplConvert.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TplConvert.h 13092 2012-11-30 09:27:53Z namdre $ /// // Some conversion methods (from strings to other) /****************************************************************************/ @@ -34,7 +34,8 @@ #include #include -#include +#include +#include #include #include @@ -47,70 +48,31 @@ * Some methods that convert 0-terminated char-arrays of any type into * other values (numerical/boolean) or into std::strings */ -template class TplConvert { public: - // conversion methods without a length /** converts a 0-terminated char-type array into std::string - throws an EmptyData - exception if the given string is empty */ - static std::string _2str(const E* const data) { + throws an EmptyData - exception if the given pointer is 0 */ + template + static inline std::string _2str(const E* const data) { return _2str(data, getLength(data)); } - /** converts a 0-terminated char-type array into the integer value - described by it - throws an EmptyData - exception if the given string is empty - throws a NumberFormatException - exception when the string does - not contain an integer */ - static int _2int(const E* const data) { - return _2int(data, INT_MAX); - } - - - /** converts a 0-terminated char-type array into the long value - described by it - throws an EmptyData - exception if the given string is empty - throws a NumberFormatException - exception when the string does - not contain a long */ - static long _2long(const E* const data) { - return _2long(data, INT_MAX); - } - - - /** converts a 0-terminated char-type array into the SUMOReal value - described by it - throws an EmptyData - exception if the given string is empty - throws a NumberFormatException - exception when the string - does not contain a SUMOReal */ - static SUMOReal _2SUMOReal(const E* const data) { - return _2SUMOReal(data, INT_MAX); - } - - - /** converts a 0-terminated char-type array into the SUMOReal value - described by it - returns true when the first char is one of the following: '1', - 'x', 't', 'T' - throws an EmptyData - exception if the given string is empty */ - static bool _2bool(const E* const data) { - return _2bool(data, 1); - } - - - /** converts a 0-terminated char-type array into a 0-terminated - 0-terminated c-char-string - throws an EmptyData - exception if the given string is empty */ - static char* _2charp(const E* const data) { - return _2charp(data, getLength(data)); + /** converts a 0-terminated char array into std::string + throws an EmptyData - exception if the given pointer is 0 */ + static inline std::string _2str(const char* const data) { + if (data == 0) { + throw EmptyData(); + } + return std::string(data); } - // conversion methods with a length /** converts a char-type array into std::string considering the given length - throws an EmptyData - exception if the given string is empty */ - static std::string _2str(const E* const data, unsigned length) { + throws an EmptyData - exception if the given pointer is 0 */ + template + static inline std::string _2str(const E* const data, unsigned length) { if (data == 0) { throw EmptyData(); } @@ -133,50 +95,41 @@ } + /** converts a char array into std::string considering the given + length + throws an EmptyData - exception if the given pointer is 0 */ + static inline std::string _2str(const char* const data, unsigned length) { + if (data == 0) { + throw EmptyData(); + } + return std::string(data, length); + } + + /** converts a char-type array into the integer value described by it - considering the given length throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain an integer */ - static int _2int(const E* const data, unsigned length) { - if (data == 0 || length == 0 || data[0] == 0) { - throw EmptyData(); - } - int sgn = 1; - unsigned i = 0; - if (data[0] == '+') { - i++; - } - if (data[0] == '-') { - i++; - sgn = -1; - } - int val = 0; - for (; i < length && data[i] != 0; i++) { - val = val * 10; - char akt = (char) data[i]; - if (akt < '0' || akt > '9') { - throw NumberFormatException(); - } - val = val + akt - 48; - } - if (i == 0) { - throw EmptyData(); + template + static int _2int(const E* const data) { + SUMOLong result = _2long(data); + if (result > std::numeric_limits::max() || result < std::numeric_limits::min()) { + throw NumberFormatException(); } - return val * sgn; + return (int)result; } /** converts a char-type array into the long value described by it - considering the given length throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain a long */ - static long _2long(const E* const data, unsigned length) { - if (data == 0 || length == 0 || data[0] == 0) { + template + static SUMOLong _2long(const E* const data) { + if (data == 0 || data[0] == 0) { throw EmptyData(); } - long sgn = 1; + SUMOLong sgn = 1; unsigned i = 0; if (data[0] == '+') { i++; @@ -185,14 +138,15 @@ i++; sgn = -1; } - long ret = 0; - for (; i < length && data[i] != 0; i++) { - ret = ret * 10; + SUMOLong ret = 0; + for (; data[i] != 0; i++) { + ret *= 10; + // !!! need to catch overflows char akt = (char) data[i]; if (akt < '0' || akt > '9') { throw NumberFormatException(); } - ret = ret + akt - 48; + ret += akt - 48; } if (i == 0) { throw EmptyData(); @@ -202,15 +156,14 @@ /** converts a char-type array into the SUMOReal value described by it - considering the given length throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain a SUMOReal */ - static SUMOReal _2SUMOReal(const E* const data, unsigned length) { - if (data == 0 || length == 0 || data[0] == 0) { + template + static SUMOReal _2SUMOReal(const E* const data) { + if (data == 0 || data[0] == 0) { throw EmptyData(); } - SUMOReal ret = 0; unsigned i = 0; SUMOReal sgn = 1; if (data[0] == '+') { @@ -220,53 +173,35 @@ i++; sgn = -1; } - for (; i < length && data[i] != 0 && data[i] != '.' && data[i] != ',' && data[i] != 'e' && data[i] != 'E'; i++) { - ret = ret * 10; + // we try to parse it as a SUMOLong storing the decimal point pos + int pointPos = -1; + int digits = std::numeric_limits::digits10; + SUMOLong ret = 0; + for (; data[i] != 0 && data[i] != 'e' && data[i] != 'E'; i++) { char akt = (char) data[i]; if (akt < '0' || akt > '9') { + if (pointPos < 0 && (akt == '.' || akt == ',')) { + pointPos = i; + continue; + } throw NumberFormatException(); } - ret = ret + akt - 48; - } - // check what has happened - end of string, e or decimal point - if ((char) data[i] != '.' && (char) data[i] != ',' && data[i] != 'e' && data[i] != 'E') { - if (i == 0) { - throw EmptyData(); - } - return ret * sgn; - } - if (data[i] == 'e' || data[i] == 'E') { - // no decimal point, just an exponent - try { - int exp = _2int(data + i + 1, length - i - 1); - SUMOReal exp2 = (SUMOReal) pow(10.0, exp); - return ret * sgn * exp2; - } catch (EmptyData&) { - // the exponent was empty - throw NumberFormatException(); - } - } - SUMOReal div = 10; - // skip the dot - i++; - // parse values behin decimal point - for (; i < length && data[i] != 0 && data[i] != 'e' && data[i] != 'E'; i++) { - char akt = (char) data[i]; - if (akt < '0' || akt > '9') { - throw NumberFormatException(); + digits--; + if (digits >= 0) { // we skip the digits which don't fit into SUMOLong + ret = ret * 10 + akt - 48; } - ret = ret + ((SUMOReal)(akt - 48)) / div; - div = div * 10; } - if (data[i] != 'e' && data[i] != 'E') { - // no exponent - return ret * sgn; + int exponent = digits >= 0 ? 0 : -digits; + if (pointPos != -1) { + exponent += pointPos - i + 1; + } + // check what has happened - end of string or exponent + if (data[i] == 0) { + return ret * sgn * (SUMOReal) pow(10.0, exponent); } - // eponent and decimal dot + // now the exponent try { - int exp = _2int(data + i + 1, length - i - 1); - SUMOReal exp2 = (SUMOReal) pow(10.0, exp); - return ret * sgn * exp2; + return ret * sgn * (SUMOReal) pow(10.0, _2int(data + i + 1) + exponent); } catch (EmptyData&) { // the exponent was empty throw NumberFormatException(); @@ -274,44 +209,109 @@ } - /** converts a char-type array into the SUMOReal value described by it - considering the given length - returns true when the first char is one of the following: '1', - 'x', 't', 'T' - throws an EmptyData - exception if the given string is empty */ - static bool _2bool(const E* const data, unsigned length) { - if (data == 0 || length == 0 || data[0] == 0) { + /** converts a 0-terminated char-type array into the boolean value + described by it + returns true if the data* is one of the following (case insensitive): + '1', 'x', 'true', 'yes', 'on' + returns false if the data* is one of the following (case insensitive): + '0', '-', 'false', 'no', 'off' + throws an EmptyData - exception if the given string is empty or 0 pointer + throws a BoolFormatException in any other case + */ + template + static bool _2bool(const E* const data) { + if (data == 0 || data[0] == 0) { throw EmptyData(); } - char akt = (char) data[0]; - if (akt == '1' || akt == 'x' || akt == 't' || akt == 'T') { + std::string s = _2str(data); + std::transform(s.begin(), s.end(), s.begin(), tolower); + if (s == "1" || s == "yes" || s == "true" || s == "on" || s == "x" || s == "t") { return true; - } - if (akt == '0' || akt == '-' || akt == 'f' || akt == 'F') { + } else if (s == "0" || s == "no" || s == "false" || s == "off" || s == "-" || s == "f") { return false; + } else { + throw BoolFormatException(); } - throw BoolFormatException(); } - /** converts a char-type array into a 0-terminated 0-terminated - c-char-string considering the given length - throws an EmptyData - exception if the given string is empty */ - static char* _2charp(const E* const data, int length) { - if (length == 0 || data == 0) { - throw EmptyData(); + // conversion methods not throwing an exception + /** converts a 0-terminated char-type array into std::string + returns the default value if the data is empty */ + template + static std::string _2strSec(const E* const data, + const std::string& def) { + return _2strSec(data, getLength(data), def); + } + + + /** converts a 0-terminated char-type array into the integer value + described by it + returns the default value if the data is empty */ + template + static int _2intSec(const E* const data, int def) { + if (data == 0 || data[0] == 0) { + return def; } - char* ret = new char[length + 1]; - unsigned i = 0; - for (; i < length; i++) { - ret[i] = (char) data[i]; + return _2int(data); + } + + + /** converts a 0-terminated char-type array into the long value + described by it + returns the default value if the data is empty */ + template + static SUMOLong _2longSec(const E* const data, long def) { + if (data == 0 || data[0] == 0) { + return def; } - ret[i] = 0; - return ret; + return _2long(data); + } + + + /** converts a 0-terminated char-type array into the SUMOReal value + described by it + returns the default value if the data is empty */ + template + static SUMOReal _2SUMORealSec(const E* const data, SUMOReal def) { + if (data == 0 || data[0] == 0) { + return def; + } + return _2SUMOReal(data); + } + + + /** converts a 0-terminated char-type array into the SUMOReal value + described by it + returns true if the data* is one of the following (case insensitive): + '1', 'x', 'true', 'yes', 'on' + returns false if the data* is one of the following (case insensitive): + '0', '-', 'false', 'no', 'off' + returns the default value if the data is empty */ + template + static bool _2boolSec(const E* const data, bool def) { + if (data == 0 || data[0] == 0) { + return def; + } + return _2bool(data); + } + + + /** converts a char-type array into std::string considering + the given length + returns the default value if the data is empty */ + template + static std::string _2strSec(const E* const data, int length, + const std::string& def) { + if (data == 0 || length == 0) { + return def; + } + return _2str(data, length); } /** returns the length of the string (the position of the 0-character) */ + template static unsigned getLength(const E* const data) { if (data == 0) { return 0; @@ -329,4 +329,3 @@ #endif /****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/utils/common/TplConvertSec.h sumo-0.16.0~dfsg/src/utils/common/TplConvertSec.h --- sumo-0.15.0~dfsg/src/utils/common/TplConvertSec.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/TplConvertSec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -/****************************************************************************/ -/// @file TplConvertSec.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sun, 09 Jun 2002 -/// @version $Id: TplConvertSec.h 11671 2012-01-07 20:14:30Z behrisch $ -/// -// Some conversion methods (from strings to other) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors -/****************************************************************************/ -// -// This file is part of SUMO. -// SUMO is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -/****************************************************************************/ -#ifndef TplConvertSec_h -#define TplConvertSec_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include "TplConvert.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * TplConvertSec - * The same as TplConvert, but more secure, meaning throwing less exceptions - * as methods do retrieve a value that is used when nothing to convert is - * supplied. Still, some methods do throw exceptions when f.e. something - * that should be a number is not. - */ -template -class TplConvertSec { -public: - // conversion methods not throwing an exeption without a length - /** converts a 0-terminated char-type array into std::string - returns the default value if the data is empty */ - static std::string _2strSec(const E* const data, - const std::string& def) { - return _2strSec(data, TplConvert::getLength(data), def); - } - - - /** converts a 0-terminated char-type array into the integer value - described by it - returns the default value if the data is empty */ - static int _2intSec(const E* const data, int def) { - return _2intSec(data, INT_MAX, def); - } - - - /** converts a 0-terminated char-type array into the long value - described by it - returns the default value if the data is empty */ - static long _2longSec(const E* const data, long def) { - return _2longSec(data, INT_MAX, def); - } - - - /** converts a 0-terminated char-type array into the SUMOReal value - described by it - returns the default value if the data is empty */ - static SUMOReal _2SUMORealSec(const E* const data, SUMOReal def) { - return _2SUMORealSec(data, INT_MAX, def); - } - - - /** converts a 0-terminated char-type array into the SUMOReal value - described by it - returns true when the first char is one of the following: '1', 'x', 't', 'T' - returns the default value if the data is empty */ - static bool _2boolSec(const E* const data, bool def) { - return _2boolSec(data, 1, def); - } - - - /** converts a 0-terminated char-type array into a 0-terminated - 0-terminated c-char-string - returns the default value if the data is empty */ - static char* _2charpSec(const E* const data, char* def) { - return _2charpSec(data, TplConvert::getLength(data), def); - } - - - // conversion not throwing an exception methods with a length - /** converts a char-type array into std::string considering - the given length - returns the default value if the data is empty */ - static std::string _2strSec(const E* const data, int length, - const std::string& def) { - if (data == 0 || length == 0) { - return def; - } - return TplConvert::_2str(data, length); - } - - - /** converts a char-type array into the integer value described - by it considering the given length - returns the default value if the data is empty */ - static int _2intSec(const E* const data, int length, int def) { - if (data == 0 || length == 0 || data[0] == 0) { - return def; - } - return TplConvert::_2int(data, length); - } - - - /** converts a char-type array into the long value described - by it considering the given length - returns the default value if the data is empty */ - static long _2longSec(const E* const data, int length, long def) { - if (data == 0 || length == 0 || data[0] == 0) { - return def; - } - return TplConvert::_2long(data, length); - } - - - /** converts a char-type array into the SUMOReal value described - by it considering the given length - returns the default value if the data is empty */ - static SUMOReal _2SUMORealSec(const E* const data, int length, SUMOReal def) { - if (data == 0 || length == 0 || data[0] == 0) { - return def; - } - return TplConvert::_2SUMOReal(data, length); - } - - - /** converts a char-type array into the SUMOReal value described - by it considering the given length - returns the default value if the data is empty */ - static bool _2boolSec(const E* const data, int length, bool def) { - if (data == 0 || length == 0 || data[0] == 0) { - return def; - } - return TplConvert::_2bool(data, length); - } - - - /** converts a char-type array into a 0-terminated 0-terminated - c-char-string considering the given length - returns the default value if the data is empty */ - static char* _2charpSec(const E* const data, int length, char* def) { - if (data == 0 || length == 0) { - return TplConvert::copy(def); - } - return TplConvert::_2charp(data, length); - } - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.15.0~dfsg/src/utils/common/ValueSource.h sumo-0.16.0~dfsg/src/utils/common/ValueSource.h --- sumo-0.15.0~dfsg/src/utils/common/ValueSource.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/ValueSource.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file ValueSource.h /// @author Daniel Krajzewicz /// @date Fri, 29.04.2005 -/// @version $Id: ValueSource.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ValueSource.h 13107 2012-12-02 13:57:34Z behrisch $ /// // /****************************************************************************/ @@ -44,7 +44,7 @@ virtual ~ValueSource() { } virtual T getValue() const = 0; virtual ValueSource* copy() const = 0; - virtual ValueSource *makeSUMORealReturningCopy() const = 0; + virtual ValueSource* makeSUMORealReturningCopy() const = 0; }; diff -Nru sumo-0.15.0~dfsg/src/utils/common/VectorHelper.h sumo-0.16.0~dfsg/src/utils/common/VectorHelper.h --- sumo-0.15.0~dfsg/src/utils/common/VectorHelper.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/common/VectorHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: VectorHelper.h 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: VectorHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A simple vector of SUMOReals /****************************************************************************/ @@ -46,7 +46,7 @@ template class VectorHelper { public: - static T sum(const std::vector &v) { + static T sum(const std::vector& v) { T sum = 0; for (typename std::vector::const_iterator i = v.begin(); i != v.end(); i++) { sum += *i; @@ -54,7 +54,7 @@ return sum; } - static void normaliseSum(std::vector &v, T msum = 1.0) { + static void normaliseSum(std::vector& v, T msum = 1.0) { if (msum == 0) { // is an error; do nothing return; @@ -67,13 +67,13 @@ div(v, rsum / msum); } - static void div(std::vector &v, T by) { + static void div(std::vector& v, T by) { for (typename std::vector::iterator i = v.begin(); i != v.end(); i++) { *i /= by; } } - static void removeDouble(std::vector &v) { + static void removeDouble(std::vector& v) { typename std::vector::iterator i = v.begin(); while (i != v.end()) { for (typename std::vector::iterator j = i + 1; j != v.end();) { @@ -88,13 +88,13 @@ } - static void set(std::vector &v, T to) { + static void set(std::vector& v, T to) { for (typename std::vector::iterator i = v.begin(); i != v.end(); i++) { *i = to; } } - static T maxValue(const std::vector &v) { + static T maxValue(const std::vector& v) { SUMOReal m = *(v.begin()); for (typename std::vector::const_iterator j = v.begin() + 1; j != v.end(); j++) { if ((*j) > m) { @@ -104,7 +104,7 @@ return m; } - static T minValue(const std::vector &v) { + static T minValue(const std::vector& v) { SUMOReal m = *(v.begin()); for (typename std::vector::const_iterator j = v.begin() + 1; j != v.end(); j++) { if ((*j) < m) { @@ -114,7 +114,7 @@ return m; } - static void remove_smaller_than(std::vector &v, T swell) { + static void remove_smaller_than(std::vector& v, T swell) { for (typename std::vector::iterator j = v.begin(); j != v.end();) { if ((*j) < swell) { j = v.erase(j); @@ -124,7 +124,7 @@ } } - static void remove_larger_than(std::vector &v, T swell) { + static void remove_larger_than(std::vector& v, T swell) { for (typename std::vector::iterator j = v.begin(); j != v.end();) { if ((*j) > swell) { j = v.erase(j); @@ -134,14 +134,14 @@ } } - static void add2All(std::vector &v, T what) { + static void add2All(std::vector& v, T what) { for (typename std::vector::iterator j = v.begin(); j != v.end(); j++) { (*j) += what; } } /// Returns the information whether at least one element is within both vectors - static bool subSetExists(const std::vector &v1, const std::vector &v2) { + static bool subSetExists(const std::vector& v1, const std::vector& v2) { for (typename std::vector::const_iterator i = v1.begin(); i != v1.end(); i++) { int val1 = (*i); if (find(v2.begin(), v2.end(), val1) != v2.end()) { @@ -156,7 +156,7 @@ }; template -std::ostream& operator<<(std::ostream& os, const std::vector &v) { +std::ostream& operator<<(std::ostream& os, const std::vector& v) { for (typename std::vector::const_iterator i = v.begin(); i != v.end(); i++) { if (i != v.begin()) { os << ", "; diff -Nru sumo-0.15.0~dfsg/src/utils/distribution/Distribution_MeanDev.h sumo-0.16.0~dfsg/src/utils/distribution/Distribution_MeanDev.h --- sumo-0.15.0~dfsg/src/utils/distribution/Distribution_MeanDev.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/distribution/Distribution_MeanDev.h 2012-09-25 22:01:46.000000000 +0000 @@ -2,7 +2,7 @@ /// @file Distribution_MeanDev.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: Distribution_MeanDev.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Distribution_MeanDev.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A distribution described by the mean value and std-dev amount /****************************************************************************/ @@ -47,10 +47,10 @@ public: /// Constructor Distribution_MeanDev(const std::string& id, SUMOReal mean, - SUMOReal deviation) ; + SUMOReal deviation); /// Destructor - virtual ~Distribution_MeanDev() ; + virtual ~Distribution_MeanDev(); /// Returns the maximum value of this distribution SUMOReal getMax() const; diff -Nru sumo-0.15.0~dfsg/src/utils/distribution/Distribution_Points.h sumo-0.16.0~dfsg/src/utils/distribution/Distribution_Points.h --- sumo-0.15.0~dfsg/src/utils/distribution/Distribution_Points.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/distribution/Distribution_Points.h 2012-09-25 22:01:46.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Distribution_Points.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Distribution_Points.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The description of a distribution by a curve /****************************************************************************/ @@ -49,10 +49,10 @@ public: /// Constructor Distribution_Points(const std::string& id, - const PositionVector& points, bool interpolating = false) ; + const PositionVector& points, bool interpolating = false); /// Destructor - virtual ~Distribution_Points() ; + virtual ~Distribution_Points(); /// Returns the maximum value of this distribution SUMOReal getMax() const; diff -Nru sumo-0.15.0~dfsg/src/utils/distribution/Makefile.in sumo-0.16.0~dfsg/src/utils/distribution/Makefile.in --- sumo-0.15.0~dfsg/src/utils/distribution/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/distribution/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -101,6 +101,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -131,6 +132,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -165,6 +167,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -198,7 +201,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/FXLinkLabel.cpp sumo-0.16.0~dfsg/src/utils/foxtools/FXLinkLabel.cpp --- sumo-0.15.0~dfsg/src/utils/foxtools/FXLinkLabel.cpp 2012-01-07 19:53:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/FXLinkLabel.cpp 2012-09-25 22:01:54.000000000 +0000 @@ -8,7 +8,9 @@ #endif #ifdef WIN32 +#define NOMINMAX #include +#undef NOMINMAX #endif #include "FXLinkLabel.h" diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/FXRealSpinDial.cpp sumo-0.16.0~dfsg/src/utils/foxtools/FXRealSpinDial.cpp --- sumo-0.15.0~dfsg/src/utils/foxtools/FXRealSpinDial.cpp 2012-01-07 19:53:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/FXRealSpinDial.cpp 2012-09-25 22:01:54.000000000 +0000 @@ -19,7 +19,7 @@ * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * ********************************************************************************* -* $Id: FXRealSpinDial.cpp 11451 2011-11-02 09:07:49Z behrisch $ * +* $Id: FXRealSpinDial.cpp 12641 2012-08-31 20:26:04Z behrisch $ * ********************************************************************************/ /* ========================================================================= * included modules @@ -518,7 +518,7 @@ // Recompute layout void FXRealSpinDial::layout() { - FXint dialWidth, dialHeight, buttonWidth, buttonHeight, textHeight; + FXint dialHeight, buttonHeight, textHeight; textHeight = height - 2 * border; dialHeight = textHeight; @@ -550,7 +550,6 @@ } } else { // dial/buttons are default width, text stretches to fill the rest - dialWidth = buttonWidth = 0; if (!(options & SPINDIAL_NODIAL)) { FXint w = DIALWIDTH; dial->position(right - w, border, w, dialHeight); @@ -604,11 +603,11 @@ if (options & SPINDIAL_LOG) { if (options & SPINDIAL_CYCLIC && newpos > range[1]) { FXdouble lr0 = log(range[0]), lr1 = log(range[1]), lnp = log(newpos); - newpos = exp(lr0 + fmod(lnp - lr0, lr1 - lr0)) ; + newpos = exp(lr0 + fmod(lnp - lr0, lr1 - lr0)); } } else { if (options & SPINDIAL_CYCLIC) { - newpos = range[0] + fmod(newpos - range[0], range[1] - range[0] + 1) ; + newpos = range[0] + fmod(newpos - range[0], range[1] - range[0] + 1); } } } else { @@ -800,7 +799,6 @@ default: return textField->handle(sender, sel, ptr); } - return 0; } @@ -823,7 +821,6 @@ default: return textField->handle(sender, sel, ptr); } - return 0; } // Mouse motion @@ -912,12 +909,12 @@ if (options & SPINDIAL_CYCLIC && newpos > range[1]) { // can have a huge magnitude disparity here, so better to work in log space FXdouble lr0 = log(range[0]), lr1 = log(range[1]), lnp = log(newpos); - newpos = exp(lr0 + fmod(lnp - lr0, lr1 - lr0)) ; + newpos = exp(lr0 + fmod(lnp - lr0, lr1 - lr0)); } } else { newpos = pos + inc; if (options & SPINDIAL_CYCLIC) { - newpos = range[0] + fmod(newpos - range[0], range[1] - range[0] + 1) ; + newpos = range[0] + fmod(newpos - range[0], range[1] - range[0] + 1); } } setValue(newpos); diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/FXSingleEventThread.cpp sumo-0.16.0~dfsg/src/utils/foxtools/FXSingleEventThread.cpp --- sumo-0.15.0~dfsg/src/utils/foxtools/FXSingleEventThread.cpp 2012-01-07 19:53:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/FXSingleEventThread.cpp 2012-09-25 22:01:54.000000000 +0000 @@ -70,8 +70,8 @@ void FXSingleEventThread::signal() { - FXuint seltype = SEL_THREAD; #ifndef WIN32 + FXuint seltype = SEL_THREAD; ::write(event[PIPE_WRITE], &seltype, sizeof(seltype)); #else ::SetEvent(event); @@ -92,8 +92,8 @@ long FXSingleEventThread::onThreadSignal(FXObject*, FXSelector, void*) { - FXuint seltype = SEL_THREAD; #ifndef WIN32 + FXuint seltype = SEL_THREAD; ::read(event[PIPE_READ], &seltype, sizeof(seltype)); #else //FIXME need win32 support diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/FXThreadEvent.cpp sumo-0.16.0~dfsg/src/utils/foxtools/FXThreadEvent.cpp --- sumo-0.15.0~dfsg/src/utils/foxtools/FXThreadEvent.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/FXThreadEvent.cpp 2012-09-25 22:01:54.000000000 +0000 @@ -2,7 +2,7 @@ /// @file FXThreadEvent.cpp /// @author unknown_author /// @date 2004-03-19 -/// @version $Id: FXThreadEvent.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: FXThreadEvent.cpp 12596 2012-08-26 19:12:56Z behrisch $ /// // /****************************************************************************/ @@ -103,8 +103,8 @@ // signal the target using the SEL_THREAD seltype // this method is meant to be called from the worker thread void FXThreadEvent::signal() { - FXuint seltype = SEL_THREAD; #ifndef WIN32 + FXuint seltype = SEL_THREAD; ::write(event[PIPE_WRITE], &seltype, sizeof(seltype)); #else ::SetEvent(event); diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.cpp sumo-0.16.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.cpp --- sumo-0.15.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MFXAddEditTypedTable.cpp /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXAddEditTypedTable.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MFXAddEditTypedTable.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // missing_desc /****************************************************************************/ @@ -106,7 +106,7 @@ { try { myNumberEditor->setValue( - TplConvert::_2SUMOReal(it->getText().text())); + TplConvert::_2SUMOReal(it->getText().text())); } catch (NumberFormatException &) { } catch (EmptyData &) { } @@ -129,7 +129,7 @@ { try { myNumberEditor->setValue( - TplConvert::_2int(it->getText().text())); + TplConvert::_2int(it->getText().text())); } catch (NumberFormatException &) { } catch (EmptyData &) { } @@ -150,7 +150,7 @@ case CT_BOOL: try { myBoolEditor->setCheck( - TplConvert::_2bool(it->getText().text()) + TplConvert::_2bool(it->getText().text()) ? true : false); } catch (NumberFormatException &) { } catch (EmptyData &) { @@ -203,10 +203,10 @@ register FXTableItem* item = cells[r * ncols + c]; if (item == NULL) { return 0; - cells[r * ncols + c] = item = createItem("", NULL, NULL); - if (isItemSelected(r, c)) { - item->setSelected(FALSE); - } +// cells[r * ncols + c] = item = createItem("", NULL, NULL); +// if (isItemSelected(r, c)) { +// item->setSelected(FALSE); +// } } delete editor; editor = NULL; @@ -256,9 +256,9 @@ } try { if (getCellType(c) == CT_REAL) { - field->setValue(TplConvert::_2SUMOReal(item->getText().text())); + field->setValue(TplConvert::_2SUMOReal(item->getText().text())); } else { - field->setValue(TplConvert::_2int(item->getText().text())); + field->setValue(TplConvert::_2int(item->getText().text())); } } catch (NumberFormatException&) { field->setValue(0); @@ -405,10 +405,8 @@ edited.row = r; edited.col = c; edited.updateOnly = true; - bool accepted = true; if (target) { if (!target->handle(this, FXSEL(SEL_CHANGED, ID_TEXT_CHANGED), (void*) &edited)) { - accepted = false; // !!! item->setText(myPreviousText); } } @@ -609,7 +607,7 @@ void MFXAddEditTypedTable::setEnums(size_t pos, - const std::vector ¶ms) { + const std::vector& params) { while (myEnums.size() <= pos) { myEnums.push_back(std::vector()); } @@ -627,7 +625,7 @@ } -const std::vector & +const std::vector& MFXAddEditTypedTable::getEnums(size_t pos) const { return myEnums[pos]; } diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.h sumo-0.16.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.h --- sumo-0.15.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/MFXAddEditTypedTable.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MFXAddEditTypedTable.h /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXAddEditTypedTable.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MFXAddEditTypedTable.h 13107 2012-12-02 13:57:34Z behrisch $ /// // missing_desc /****************************************************************************/ @@ -77,9 +77,9 @@ double steps1, double steps2, double steps3, const std::string& format); NumberCellParams getNumberCellParams(size_t pos) const; - void setEnums(size_t pos, const std::vector ¶ms); + void setEnums(size_t pos, const std::vector& params); void addEnum(size_t pos, const std::string& e); - const std::vector &getEnums(size_t pos) const; + const std::vector& getEnums(size_t pos) const; /* class FXTableItem_Int : public FXTableItem { public: diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/MFXImageHelper.cpp sumo-0.16.0~dfsg/src/utils/foxtools/MFXImageHelper.cpp --- sumo-0.15.0~dfsg/src/utils/foxtools/MFXImageHelper.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/MFXImageHelper.cpp 2012-10-17 23:02:19.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MFXImageHelper.cpp /// @author Daniel Krajzewicz /// @date 2005-05-04 -/// @version $Id: MFXImageHelper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MFXImageHelper.cpp 12848 2012-10-17 04:39:50Z namdre $ /// // missing_desc /****************************************************************************/ @@ -33,6 +33,7 @@ #include #include #include +#include #include "MFXImageHelper.h" #include @@ -87,7 +88,7 @@ } else if (comparecase(ext, "tif") == 0 || comparecase(ext, "tiff") == 0) { img = new FXTIFImage(a, NULL, IMAGE_KEEP | IMAGE_SHMI | IMAGE_SHMP); } else { - throw InvalidArgument("Unknown file extension for image '" + file + "'!"); + throw InvalidArgument("Unknown file extension '" + toString(ext.text()) + "' for image '" + file + "'!"); } FXFileStream stream; @@ -99,6 +100,7 @@ img->create(); a->endWaitCursor(); } else { + delete img; throw InvalidArgument("Loading failed!"); } return img; @@ -107,7 +109,7 @@ FXbool MFXImageHelper::scalePower2(FXImage* image) { - FXint newHeight; + FXint newHeight = 0; for (FXint exp = 30; exp >= 0; exp--) { newHeight = 2 << exp; if (image->getHeight() & newHeight) { @@ -117,7 +119,7 @@ if (2 * newHeight - image->getHeight() < image->getHeight() - newHeight) { newHeight *= 2; } - FXint newWidth; + FXint newWidth = 0; for (FXint exp = 30; exp >= 0; exp--) { newWidth = 2 << exp; if (image->getWidth() & newWidth) { diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/MFXMutex.h sumo-0.16.0~dfsg/src/utils/foxtools/MFXMutex.h --- sumo-0.15.0~dfsg/src/utils/foxtools/MFXMutex.h 2012-01-07 19:53:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/MFXMutex.h 2012-09-25 22:01:54.000000000 +0000 @@ -38,7 +38,9 @@ #ifndef WIN32 typedef void* FXThreadMutex; // handle to a mutex #else +#define NOMINMAX #include +#undef NOMINMAX typedef HANDLE FXThreadMutex; // handle to a mutex #endif diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/MFXUtils.h sumo-0.16.0~dfsg/src/utils/foxtools/MFXUtils.h --- sumo-0.15.0~dfsg/src/utils/foxtools/MFXUtils.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/MFXUtils.h 2012-09-25 22:01:54.000000000 +0000 @@ -2,7 +2,7 @@ /// @file MFXUtils.h /// @author Daniel Krajzewicz /// @date 2006-01-09 -/// @version $Id: MFXUtils.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: MFXUtils.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Some helper functions for FOX /****************************************************************************/ @@ -50,7 +50,7 @@ * * @param[in] w The window to delete all of his children */ - static void deleteChildren(FXWindow* w) ; + static void deleteChildren(FXWindow* w); /** @brief Returns true if either the file given by its name does not exist or the user allows overwriting it @@ -65,7 +65,7 @@ * @return Whether the named file may be written */ static FXbool userPermitsOverwritingWhenFileExists( - FXWindow* const parent, const FXString& file) ; + FXWindow* const parent, const FXString& file); /** @brief Returns the title text in dependance to an optional file name @@ -79,7 +79,7 @@ * @return The built title */ static FXString getTitleText(const FXString& appname, - FXString filename = "") ; + FXString filename = ""); /** @brief Returns the document name @@ -90,7 +90,7 @@ * @param[in] filename The file name (including the path) to obtain the name of * @return The name (without the path and the extension) */ - static FXString getDocumentName(const FXString& filename) ; + static FXString getDocumentName(const FXString& filename); /** @brief Corrects missing extension @@ -103,7 +103,7 @@ * @param[in] defaultExtension The default extension to use * @return The corrected filename (with extension if no one was given */ - static FXString assureExtension(const FXString& filename, const FXString& defaultExtension) ; + static FXString assureExtension(const FXString& filename, const FXString& defaultExtension); /** @brief Returns the file name to write @@ -125,7 +125,7 @@ */ static FXString getFilename2Write(FXWindow* parent, const FXString& header, const FXString& extension, - FXIcon* icon, FXString& currentFolder) ; + FXIcon* icon, FXString& currentFolder); /** @brief converts FXColor to RGBColor */ diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/Makefile.in sumo-0.16.0~dfsg/src/utils/foxtools/Makefile.in --- sumo-0.15.0~dfsg/src/utils/foxtools/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -107,6 +107,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -137,6 +138,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -171,6 +173,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -204,7 +207,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/foxtools/fxexdefs.h sumo-0.16.0~dfsg/src/utils/foxtools/fxexdefs.h --- sumo-0.15.0~dfsg/src/utils/foxtools/fxexdefs.h 2012-01-07 19:53:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/foxtools/fxexdefs.h 2012-09-25 22:01:54.000000000 +0000 @@ -31,7 +31,9 @@ #include #ifdef WIN32 +#define NOMINMAX #include +#undef NOMINMAX #endif // loads the FOX defs @@ -303,7 +305,6 @@ typedef void* FXThreadSemaphore; // handle to a semaphore typedef FXInputHandle* FXThreadEventHandle; // handle to a thread event object #else -#include typedef HANDLE FXThreadHandle; // handle to a thread typedef HANDLE FXThreadMutex; // handle to a mutex typedef HANDLE FXThreadCondition; // handle to a condition variable diff -Nru sumo-0.15.0~dfsg/src/utils/geom/GeoConvHelper.cpp sumo-0.16.0~dfsg/src/utils/geom/GeoConvHelper.cpp --- sumo-0.15.0~dfsg/src/utils/geom/GeoConvHelper.cpp 2012-02-01 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/GeoConvHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2006-08-01 -/// @version $Id: GeoConvHelper.cpp 11817 2012-01-31 07:36:48Z namdre $ +/// @version $Id: GeoConvHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // static methods for processing the coordinates conversion for the current net /****************************************************************************/ @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -62,14 +61,14 @@ myProjection(0), #endif myOffset(offset), - myProjectionMethod(NONE), - myOrigBoundary(orig), - myConvBoundary(conv), myGeoScale(pow(10, (double) - shift)), + myProjectionMethod(NONE), myUseInverseProjection(inverse), myBaseFound(baseFound), myBaseX(0), - myBaseY(0) { + myBaseY(0), + myOrigBoundary(orig), + myConvBoundary(conv) { if (proj == "!") { myProjectionMethod = NONE; } else if (proj == "-") { @@ -241,11 +240,11 @@ #ifdef HAVE_PROJ if (myProjection == 0) { const double x = from.x() * myGeoScale; - switch(myProjectionMethod) { + switch (myProjectionMethod) { case UTM: { int zone = (int)(x + 180) / 6 + 1; myProjString = "+proj=utm +zone=" + toString(zone) + - " +ellps=WGS84 +datum=WGS84 +units=m +no_defs"; + " +ellps=WGS84 +datum=WGS84 +units=m +no_defs"; myProjection = pj_init_plus(myProjString.c_str()); //!!! check pj_errno } @@ -257,14 +256,14 @@ return false; } myProjString = "+proj=tmerc +lat_0=0 +lon_0=" + toString(3 * zone) + - " +k=1 +x_0=" + toString(zone * 1000000 + 500000) + - " +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"; + " +k=1 +x_0=" + toString(zone * 1000000 + 500000) + + " +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs"; myProjection = pj_init_plus(myProjString.c_str()); //!!! check pj_errno - } + } break; default: - break; + break; } } #endif @@ -276,7 +275,7 @@ if (myProjectionMethod == SIMPLE || from.x() > 100000 || from.y() > 100000) { myBaseX = from.x(); myBaseY = from.y(); - from.set(0,0); + from.set(0, 0); } myBaseFound = true; } @@ -370,24 +369,24 @@ } -void +void GeoConvHelper::computeFinal() { if (myNumLoaded == 0) { myFinal = myProcessing; } else { myFinal = GeoConvHelper( - // prefer options over loaded location - myProcessing.usingGeoProjection() ? myProcessing.getProjString() : myLoaded.getProjString(), - // let offset and boundary lead back to the original coords of the loaded data - myProcessing.getOffset() + myLoaded.getOffset(), - myLoaded.getOrigBoundary(), - // the new boundary (updated during loading) - myProcessing.getConvBoundary()); + // prefer options over loaded location + myProcessing.usingGeoProjection() ? myProcessing.getProjString() : myLoaded.getProjString(), + // let offset and boundary lead back to the original coords of the loaded data + myProcessing.getOffset() + myLoaded.getOffset(), + myLoaded.getOrigBoundary(), + // the new boundary (updated during loading) + myProcessing.getConvBoundary()); } } -void +void GeoConvHelper::setLoaded(const GeoConvHelper& loaded) { myNumLoaded++; if (myNumLoaded > 1) { @@ -398,7 +397,7 @@ } -void +void GeoConvHelper::resetLoaded() { myNumLoaded = 0; } diff -Nru sumo-0.15.0~dfsg/src/utils/geom/GeoConvHelper.h sumo-0.16.0~dfsg/src/utils/geom/GeoConvHelper.h --- sumo-0.15.0~dfsg/src/utils/geom/GeoConvHelper.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/GeoConvHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2006-08-01 -/// @version $Id: GeoConvHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GeoConvHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // static methods for processing the coordinates conversion for the current net /****************************************************************************/ @@ -123,7 +123,7 @@ /// Converts the given cartesian (shifted) position to its geo (lat/long) representation void cartesian2geo(Position& cartesian) const; - /** Converts the given coordinate into a cartesian + /** Converts the given coordinate into a cartesian * and optionally update myConvBoundary * @note: initializes UTM / DHDN projection on first use (select zone) */ diff -Nru sumo-0.15.0~dfsg/src/utils/geom/GeomConvHelper.cpp sumo-0.16.0~dfsg/src/utils/geom/GeomConvHelper.cpp --- sumo-0.15.0~dfsg/src/utils/geom/GeomConvHelper.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/GeomConvHelper.cpp 2012-09-25 22:01:51.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2003 -/// @version $Id: GeomConvHelper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GeomConvHelper.cpp 12418 2012-06-24 20:59:29Z behrisch $ /// // Some helping functions for geometry parsing /****************************************************************************/ @@ -66,12 +66,12 @@ return PositionVector(); } try { - SUMOReal x = TplConvert::_2SUMOReal(pos.next().c_str()); - SUMOReal y = TplConvert::_2SUMOReal(pos.next().c_str()); + SUMOReal x = TplConvert::_2SUMOReal(pos.next().c_str()); + SUMOReal y = TplConvert::_2SUMOReal(pos.next().c_str()); if (pos.size() == 2) { shape.push_back(Position(x, y)); } else { - SUMOReal z = TplConvert::_2SUMOReal(pos.next().c_str()); + SUMOReal z = TplConvert::_2SUMOReal(pos.next().c_str()); shape.push_back(Position(x, y, z)); } } catch (NumberFormatException&) { @@ -98,10 +98,10 @@ return Boundary(); } try { - SUMOReal xmin = TplConvert::_2SUMOReal(st.next().c_str()); - SUMOReal ymin = TplConvert::_2SUMOReal(st.next().c_str()); - SUMOReal xmax = TplConvert::_2SUMOReal(st.next().c_str()); - SUMOReal ymax = TplConvert::_2SUMOReal(st.next().c_str()); + SUMOReal xmin = TplConvert::_2SUMOReal(st.next().c_str()); + SUMOReal ymin = TplConvert::_2SUMOReal(st.next().c_str()); + SUMOReal xmax = TplConvert::_2SUMOReal(st.next().c_str()); + SUMOReal ymax = TplConvert::_2SUMOReal(st.next().c_str()); return Boundary(xmin, ymin, xmax, ymax); } catch (NumberFormatException&) { emitError(report, "Shape", objecttype, objectid, "not numeric entry"); diff -Nru sumo-0.15.0~dfsg/src/utils/geom/GeomConvHelper.h sumo-0.16.0~dfsg/src/utils/geom/GeomConvHelper.h --- sumo-0.15.0~dfsg/src/utils/geom/GeomConvHelper.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/GeomConvHelper.h 2012-09-25 22:01:51.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2003 -/// @version $Id: GeomConvHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GeomConvHelper.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Some helping functions for geometry parsing /****************************************************************************/ @@ -58,7 +58,7 @@ * @return The parsed position vector */ static PositionVector parseShapeReporting(const std::string& shpdef, const std::string& objecttype, - const char* objectid, bool& ok, bool allowEmpty, bool report = true) ; + const char* objectid, bool& ok, bool allowEmpty, bool report = true); /** @brief Builds a boundary from its string representation, reporting occured errors @@ -72,7 +72,7 @@ * @return The parsed boundary */ static Boundary parseBoundaryReporting(const std::string& def, const std::string& objecttype, - const char* objectid, bool& ok, bool report = true) ; + const char* objectid, bool& ok, bool report = true); private: @@ -84,7 +84,7 @@ * @param[out] desc Error description */ static void emitError(bool report, const std::string& what, const std::string& objecttype, - const char* objectid, const std::string& desc) ; + const char* objectid, const std::string& desc); }; diff -Nru sumo-0.15.0~dfsg/src/utils/geom/GeomHelper.cpp sumo-0.16.0~dfsg/src/utils/geom/GeomHelper.cpp --- sumo-0.15.0~dfsg/src/utils/geom/GeomHelper.cpp 2012-03-13 13:09:47.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/GeomHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GeomHelper.cpp 12085 2012-03-13 13:09:45Z behrisch $ +/// @version $Id: GeomHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Some geometrical helpers /****************************************************************************/ @@ -56,9 +56,9 @@ const SUMOReal x4, const SUMOReal y4, SUMOReal* x, SUMOReal* y, SUMOReal* mu) { const SUMOReal eps = std::numeric_limits::epsilon(); - const double denominator = (y4-y3) * (x2-x1) - (x4-x3) * (y2-y1); - const double numera = (x4-x3) * (y1-y3) - (y4-y3) * (x1-x3); - const double numerb = (x2-x1) * (y1-y3) - (y2-y1) * (x1-x3); + const double denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1); + const double numera = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3); + const double numerb = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3); /* Are the lines coincident? */ if (fabs(numera) < eps && fabs(numerb) < eps && fabs(denominator) < eps) { SUMOReal a1; @@ -79,16 +79,16 @@ } if (a1 <= a3 && a3 <= a2) { if (a4 < a2) { - a = (a3+a4) / 2; + a = (a3 + a4) / 2; } else { - a = (a2+a3) / 2; + a = (a2 + a3) / 2; } } if (a3 <= a1 && a1 <= a4) { if (a2 < a4) { - a = (a1+a2) / 2; + a = (a1 + a2) / 2; } else { - a = (a1+a4) / 2; + a = (a1 + a4) / 2; } } if (a != -1e12) { @@ -205,8 +205,8 @@ // scalar product equals length of orthogonal projection times length of vector being projected onto // dividing the scalar product by the square of the distance gives the relative position const SUMOReal u = (((Point.x() - LineStart.x()) * (LineEnd.x() - LineStart.x())) + - ((Point.y() - LineStart.y()) * (LineEnd.y() - LineStart.y())) - ) / (lineLength2D * lineLength2D); + ((Point.y() - LineStart.y()) * (LineEnd.y() - LineStart.y())) + ) / (lineLength2D * lineLength2D); if (u < 0.0f || u > 1.0f) { // closest point does not fall within the line segment if (perpendicular) { return -1; @@ -232,14 +232,14 @@ // scalar product equals length of orthogonal projection times length of vector being projected onto // dividing the scalar product by the square of the distance gives the relative position SUMOReal u = (((point.x() - lineStart.x()) * (lineEnd.x() - lineStart.x())) + - ((point.y() - lineStart.y()) * (lineEnd.y() - lineStart.y())) - ) / lineLengthSquared; + ((point.y() - lineStart.y()) * (lineEnd.y() - lineStart.y())) + ) / lineLengthSquared; if (u < 0.0f || u > 1.0f) { return -1; // closest point does not fall within the line segment } Position intersection( - lineStart.x() + u * (lineEnd.x() - lineStart.x()), - lineStart.y() + u * (lineEnd.y() - lineStart.y())); + lineStart.x() + u * (lineEnd.x() - lineStart.x()), + lineStart.y() + u * (lineEnd.y() - lineStart.y())); return point.distanceTo(intersection); } } diff -Nru sumo-0.15.0~dfsg/src/utils/geom/GeomHelper.h sumo-0.16.0~dfsg/src/utils/geom/GeomHelper.h --- sumo-0.15.0~dfsg/src/utils/geom/GeomHelper.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/GeomHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GeomHelper.h 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: GeomHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Some geometrical helpers /****************************************************************************/ @@ -50,19 +50,19 @@ */ class GeomHelper { public: - /** @brief return whether the line segments defined by + /** @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); - /** @brief returns the intersection point + /** @brief returns the intersection point * of the (infinite) lines p11,p12 and p21,p22. * If the given lines are parallel the result will contain NAN-values */ static Position intersection_position2D( - const Position& p11, const Position& p12, - const Position& p21, const Position& p22); + const Position& p11, const Position& p12, + const Position& p21, const Position& p22); static SUMOReal Angle2D(SUMOReal x1, SUMOReal y1, SUMOReal x2, SUMOReal y2); @@ -110,7 +110,7 @@ * @param[in] angle2 The second angle * @return Angle (counter-clockwise) starting from first to second angle */ - static SUMOReal getCCWAngleDiff(SUMOReal angle1, SUMOReal angle2) ; + static SUMOReal getCCWAngleDiff(SUMOReal angle1, SUMOReal angle2); /** @brief Returns the distance of second angle from first angle clockwise @@ -118,7 +118,7 @@ * @param[in] angle2 The second angle * @return Angle (clockwise) starting from first to second angle */ - static SUMOReal getCWAngleDiff(SUMOReal angle1, SUMOReal angle2) ; + static SUMOReal getCWAngleDiff(SUMOReal angle1, SUMOReal angle2); /** @brief Returns the minimum distance (clockwise/counter-clockwise) between both angles @@ -126,7 +126,7 @@ * @param[in] angle2 The second angle * @return The minimum distance between both angles */ - static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2) ; + static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2); /** @brief Returns the maximum distance (clockwise/counter-clockwise) between both angles @@ -134,7 +134,7 @@ * @param[in] angle2 The second angle * @return The maximum distance between both angles */ - static SUMOReal getMaxAngleDiff(SUMOReal angle1, SUMOReal angle2) ; + static SUMOReal getMaxAngleDiff(SUMOReal angle1, SUMOReal angle2); private: @@ -142,9 +142,9 @@ * and Line (x3,y3),(x4,y4) intersect */ static bool intersects( - const SUMOReal x1, const SUMOReal y1, const SUMOReal x2, const SUMOReal y2, - const SUMOReal x3, const SUMOReal y3, const SUMOReal x4, const SUMOReal y4, - SUMOReal* x, SUMOReal* y, SUMOReal* mu); + const SUMOReal x1, const SUMOReal y1, const SUMOReal x2, const SUMOReal y2, + const SUMOReal x3, const SUMOReal y3, const SUMOReal x4, const SUMOReal y4, + SUMOReal* x, SUMOReal* y, SUMOReal* mu); }; diff -Nru sumo-0.15.0~dfsg/src/utils/geom/Line.cpp sumo-0.16.0~dfsg/src/utils/geom/Line.cpp --- sumo-0.15.0~dfsg/src/utils/geom/Line.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/Line.cpp 2012-09-25 22:01:51.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2003-08-14 -/// @version $Id: Line.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: Line.cpp 12381 2012-06-08 09:28:48Z dkrajzew $ /// // } /****************************************************************************/ @@ -36,7 +36,6 @@ #include "Line.h" #include "GeomHelper.h" #include -#include #ifdef CHECK_MEMORY_LEAKS #include @@ -155,6 +154,13 @@ return angle; } + +SUMOReal +Line::atan2TiltDegree() const { + return (SUMOReal) atan2(myP1.distanceTo2D(myP2), myP1.z() - myP2.z()) * (SUMOReal) 180.0 / (SUMOReal) PI; +} + + Position Line::intersectsAt(const Line& l) const { return GeomHelper::intersection_position2D(myP1, myP2, l.myP1, l.myP2); diff -Nru sumo-0.15.0~dfsg/src/utils/geom/Line.h sumo-0.16.0~dfsg/src/utils/geom/Line.h --- sumo-0.15.0~dfsg/src/utils/geom/Line.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/Line.h 2012-09-25 22:01:51.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: Line.h 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: Line.h 12114 2012-03-16 12:40:12Z behrisch $ /// // /****************************************************************************/ @@ -69,6 +69,7 @@ SUMOReal atan2Angle() const; SUMOReal atan2DegreeAngle() const; SUMOReal atan2PositiveAngle() const; + SUMOReal atan2TiltDegree() const; bool intersects(const Line& l) const; Position intersectsAt(const Line& l) const; SUMOReal length() const; diff -Nru sumo-0.15.0~dfsg/src/utils/geom/Makefile.in sumo-0.16.0~dfsg/src/utils/geom/Makefile.in --- sumo-0.15.0~dfsg/src/utils/geom/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -103,6 +103,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -133,6 +134,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -167,6 +169,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -200,7 +203,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/geom/Position.h sumo-0.16.0~dfsg/src/utils/geom/Position.h --- sumo-0.15.0~dfsg/src/utils/geom/Position.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/Position.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Position.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Position.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A position in the 2D- or 3D-world /****************************************************************************/ @@ -215,7 +215,7 @@ } - /// @brief returns the euclidean distance in the x-y-plane + /// @brief returns the euclidean distance in the x-y-plane inline SUMOReal distanceTo2D(const Position& p2) const { return sqrt(distanceSquaredTo2D(p2)); } diff -Nru sumo-0.15.0~dfsg/src/utils/geom/PositionVector.cpp sumo-0.16.0~dfsg/src/utils/geom/PositionVector.cpp --- sumo-0.15.0~dfsg/src/utils/geom/PositionVector.cpp 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/PositionVector.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Sept 2002 -/// @version $Id: PositionVector.cpp 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: PositionVector.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A list of positions /****************************************************************************/ @@ -60,7 +60,7 @@ PositionVector::PositionVector() {} -PositionVector::PositionVector(const std::vector &v) { +PositionVector::PositionVector(const std::vector& v) { std::copy(v.begin(), v.end(), std::back_inserter(myCont)); } @@ -261,6 +261,23 @@ } +SUMOReal +PositionVector::tiltDegreeAtLengthPosition(SUMOReal pos) const { + ContType::const_iterator i = myCont.begin(); + SUMOReal seenLength = 0; + do { + SUMOReal nextLength = (*i).distanceTo(*(i + 1)); + if (seenLength + nextLength > pos) { + Line l(*i, *(i + 1)); + return l.atan2TiltDegree(); + } + seenLength += nextLength; + } while (++i != myCont.end() - 1); + Line l(*(myCont.end() - 2), *(myCont.end() - 1)); + return l.atan2TiltDegree(); +} + + Position PositionVector::positionAtLengthPosition(const Position& p1, const Position& p2, @@ -547,13 +564,13 @@ } -PositionVector +PositionVector PositionVector::intersectionPoints2D(const Line& line) const { PositionVector ret; for (ContType::const_iterator i = myCont.begin(); i != myCont.end() - 1; i++) { if (GeomHelper::intersects(*i, *(i + 1), line.p1(), line.p2())) { ret.push_back_noDoublePos(GeomHelper::intersection_position2D( - *i, *(i + 1), line.p1(), line.p2())); + *i, *(i + 1), line.p1(), line.p2())); } } return ret; @@ -776,21 +793,18 @@ SUMOReal PositionVector::nearest_position_on_line_to_point2D(const Position& p, bool perpendicular) const { - SUMOReal shortestDist = -1; + SUMOReal minDist = std::numeric_limits::max(); SUMOReal nearestPos = -1; SUMOReal seen = 0; for (ContType::const_iterator i = myCont.begin(); i != myCont.end() - 1; i++) { const SUMOReal pos = GeomHelper::nearest_position_on_line_to_point2D(*i, *(i + 1), p, perpendicular); - const SUMOReal dist = - pos < 0 ? -1 : p.distanceTo2D(positionAtLengthPosition2D(pos + seen)); - // - if (dist >= 0 && (shortestDist < 0 || shortestDist > dist)) { + const SUMOReal dist = pos < 0 ? minDist : p.distanceTo2D(Line(*i, *(i + 1)).getPositionAtDistance(pos)); + if (dist < minDist) { nearestPos = pos + seen; - shortestDist = dist; + minDist = dist; } seen += (*i).distanceTo2D(*(i + 1)); - // } return nearestPos; } @@ -802,7 +816,7 @@ SUMOReal minDist = std::numeric_limits::max(); SUMOReal dist; int closest = 0; - for (int i = 1; i < (int)size(); i++) { + for (int i = 0; i < (int)size(); i++) { dist = p.distanceTo(myCont[i]); if (dist < minDist) { closest = i; @@ -813,13 +827,13 @@ } -void +int PositionVector::insertAtClosest(const Position& p) { Position outIntersection = Position(); SUMOReal minDist = std::numeric_limits::max(); SUMOReal dist; int insertionIndex = 1; - for (int i = 1; i < (int)size() - 1; i++) { + for (int i = 0; i < (int)size() - 1; i++) { dist = GeomHelper::closestDistancePointLine(p, myCont[i], myCont[i + 1], outIntersection); if (dist < minDist) { insertionIndex = i + 1; @@ -827,12 +841,16 @@ } } insertAt(insertionIndex, p); + return insertionIndex; } SUMOReal PositionVector::distance(const Position& p) const { - Position outIntersection = Position(); + if (size() == 1) { + return myCont.front().distanceTo(p); + } + Position outIntersection; SUMOReal minDist = std::numeric_limits::max(); for (ContType::const_iterator i = myCont.begin(); i != myCont.end() - 1; i++) { minDist = MIN2(minDist, GeomHelper::closestDistancePointLine( @@ -846,7 +864,7 @@ PositionVector::intersectsAtLengths2D(const PositionVector& other) const { std::vector ret; for (ContType::const_iterator i = other.myCont.begin(); i != other.myCont.end() - 1; i++) { - std::vector atSegment = intersectsAtLengths2D(Line(*i, *(i+1))); + std::vector atSegment = intersectsAtLengths2D(Line(*i, *(i + 1))); copy(atSegment.begin(), atSegment.end(), back_inserter(ret)); } return ret; diff -Nru sumo-0.15.0~dfsg/src/utils/geom/PositionVector.h sumo-0.16.0~dfsg/src/utils/geom/PositionVector.h --- sumo-0.15.0~dfsg/src/utils/geom/PositionVector.h 2012-03-13 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/PositionVector.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: PositionVector.h 12051 2012-03-12 06:54:12Z behrisch $ +/// @version $Id: PositionVector.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A list of positions /****************************************************************************/ @@ -50,8 +50,7 @@ * @class PositionVector * @brief A list of positions */ -class PositionVector - : public AbstractPoly { +class PositionVector : public AbstractPoly { public: /// Definition of the list of points typedef std::vector ContType; @@ -61,17 +60,17 @@ * * Creates an empty position vector */ - PositionVector() ; + PositionVector(); /** @brief Constructor * @param[in] v The vector to copy */ - PositionVector(const std::vector &v) ; + PositionVector(const std::vector& v); /// @brief Destructor - ~PositionVector() ; + ~PositionVector(); /// @name Adding items to the container @@ -80,13 +79,13 @@ /** @brief Appends the given position to the list * @param[in] p The position to append */ - void push_back(const Position& p) ; + void push_back(const Position& p); /** @brief Appends all positions from the given vector * @param[in] p The vector from which values shall be appended */ - void push_back(const PositionVector& p) ; + void push_back(const PositionVector& p); /// @} @@ -115,11 +114,11 @@ /** Returns any intersection Points with the given line (ignoring z-coordinates) */ PositionVector intersectionPoints2D(const Line& line) const; - /** @brief For all intersections between this vector and other, + /** @brief For all intersections between this vector and other, * return the 2D-length of the subvector from this vectors start to the intersection */ std::vector intersectsAtLengths2D(const PositionVector& other) const; // !!! - /** @brief For all intersections between this vector and line, + /** @brief For all intersections between this vector and line, * return the 2D-length of the subvector from this vectors start to the intersection */ std::vector intersectsAtLengths2D(const Line& line) const; // !!! @@ -145,9 +144,12 @@ /// Returns the position at the given length Position positionAtLengthPosition2D(SUMOReal pos) const; - /// Returns the position at the given length + /// Returns the rotation at the given length SUMOReal rotationDegreeAtLengthPosition(SUMOReal pos) const; + /// Returns the tilt at the given length + SUMOReal tiltDegreeAtLengthPosition(SUMOReal pos) const; + /// Returns the position between the two given point at the specified position */ static Position positionAtLengthPosition(const Position& p1, const Position& p2, SUMOReal pos); @@ -194,8 +196,7 @@ std::pair splitAt(SUMOReal where) const; /// Output operator - friend std::ostream& operator<<(std::ostream& os, - const PositionVector& geom); + friend std::ostream& operator<<(std::ostream& os, const PositionVector& geom); bool crosses(const Position& p1, const Position& p2) const; @@ -238,8 +239,8 @@ void insertAt(int index, const Position& p); - // brief inserts p between the two closest positions - void insertAtClosest(const Position& p); + // @brief inserts p between the two closest positions and returns the insertion index + int insertAtClosest(const Position& p); /// comparing operation bool operator==(const PositionVector& v2) const; diff -Nru sumo-0.15.0~dfsg/src/utils/geom/bezier.cpp sumo-0.16.0~dfsg/src/utils/geom/bezier.cpp --- sumo-0.15.0~dfsg/src/utils/geom/bezier.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/geom/bezier.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2003-11-19 -/// @version $Id: bezier.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: bezier.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // missing_desc /****************************************************************************/ @@ -68,7 +68,7 @@ if (n < 0) { throw 1; - } //cout << "\nNegative factorial in routine FACTRL\n" ; + } //cout << "\nNegative factorial in routine FACTRL\n"; if (n > 32) { throw 1; } //cout << "\nFactorial value too large in routine FACTRL\n"; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -109,6 +109,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -139,6 +140,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -173,6 +175,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -206,7 +209,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GLHelper.cpp sumo-0.16.0~dfsg/src/utils/gui/div/GLHelper.cpp --- sumo-0.15.0~dfsg/src/utils/gui/div/GLHelper.cpp 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GLHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GLHelper.cpp 11852 2012-02-08 09:24:17Z behrisch $ +/// @version $Id: GLHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Some methods which help to draw certain geometrical objects in openGL /****************************************************************************/ @@ -30,16 +30,11 @@ #include #endif -#ifdef _WIN32 -#include -#endif - -#include - #include "GLHelper.h" #include #include #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -109,8 +104,8 @@ void GLHelper::drawBoxLines(const PositionVector& geom, - const std::vector &rots, - const std::vector &lengths, + const std::vector& rots, + const std::vector& lengths, SUMOReal width) { int e = (int) geom.size() - 1; for (int i = 0; i < e; i++) { @@ -122,8 +117,8 @@ void GLHelper::drawBoxLines(const PositionVector& geom1, const PositionVector& geom2, - const std::vector &rots, - const std::vector &lengths, + const std::vector& rots, + const std::vector& lengths, SUMOReal width) { int minS = (int) MIN4(rots.size(), lengths.size(), geom1.size(), geom2.size()); for (int i = 0; i < minS; i++) { @@ -216,7 +211,7 @@ std::pair p1 = beg == 0 ? myCircleCoords[0] : myCircleCoords[((int) beg / 10) % 36]; for (int i = (int)(beg / 10); i < steps && (36.0 / (SUMOReal) steps * (SUMOReal) i) * 10 < end; i++) { - const std::pair &p2 = + const std::pair& p2 = myCircleCoords[(size_t)(36.0 / (SUMOReal) steps * (SUMOReal) i)]; glBegin(GL_TRIANGLES); glVertex2d(p1.first * width, p1.second * width); @@ -225,7 +220,7 @@ glEnd(); p1 = p2; } - const std::pair &p2 = + const std::pair& p2 = end == 360 ? myCircleCoords[0] : myCircleCoords[((int) end / 10) % 36]; glBegin(GL_TRIANGLES); glVertex2d(p1.first * width, p1.second * width); @@ -255,7 +250,7 @@ std::pair p1 = beg == 0 ? myCircleCoords[0] : myCircleCoords[((int) beg / 10) % 36]; for (int i = (int)(beg / 10); i < steps && (36.0 / (SUMOReal) steps * (SUMOReal) i) * 10 < end; i++) { - const std::pair &p2 = + const std::pair& p2 = myCircleCoords[(size_t)(36.0 / (SUMOReal) steps * (SUMOReal) i)]; glBegin(GL_TRIANGLES); glVertex2d(p1.first * width, p1.second * width); @@ -268,7 +263,7 @@ glEnd(); p1 = p2; } - const std::pair &p2 = + const std::pair& p2 = end == 360 ? myCircleCoords[0] : myCircleCoords[((int) end / 10) % 36]; glBegin(GL_TRIANGLES); glVertex2d(p1.first * width, p1.second * width); diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GLHelper.h sumo-0.16.0~dfsg/src/utils/gui/div/GLHelper.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GLHelper.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GLHelper.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GLHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GLHelper.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Some methods which help to draw certain geometrical objects in openGL /****************************************************************************/ @@ -55,7 +55,7 @@ * @param[in] v The polygon to draw * @param[in] close Whether the first point shall be appended */ - static void drawFilledPoly(const PositionVector& v, bool close) ; + static void drawFilledPoly(const PositionVector& v, bool close); /** @brief Draws a thick line @@ -68,7 +68,7 @@ * @param[in] width The width of the line */ static void drawBoxLine(const Position& beg, SUMOReal rot, - SUMOReal visLength, SUMOReal width) ; + SUMOReal visLength, SUMOReal width); /** @brief Draws a thick line using the mean of both given points as begin position @@ -82,7 +82,7 @@ * @param[in] width The width of the line */ static void drawBoxLine(const Position& beg1, const Position& beg2, - SUMOReal rot, SUMOReal visLength, SUMOReal width) ; + SUMOReal rot, SUMOReal visLength, SUMOReal width); /** @brief Draws thick lines @@ -96,8 +96,8 @@ * @see drawBoxLine */ static void drawBoxLines(const PositionVector& geom, - const std::vector &rots, const std::vector &lengths, - SUMOReal width) ; + const std::vector& rots, const std::vector& lengths, + SUMOReal width); /** @brief Draws thick lines using the mean of the points given in the point lists as begin positions @@ -113,8 +113,8 @@ */ static void drawBoxLines(const PositionVector& geom1, const PositionVector& geom2, - const std::vector &rots, const std::vector &lengths, - SUMOReal width) ; + const std::vector& rots, const std::vector& lengths, + SUMOReal width); /** @brief Draws thick lines @@ -126,7 +126,7 @@ * @param[in] width The width of the lines * @see drawBoxLine */ - static void drawBoxLines(const PositionVector& geom, SUMOReal width) ; + static void drawBoxLines(const PositionVector& geom, SUMOReal width); /** @brief Draws a thin line @@ -138,7 +138,7 @@ * @param[in] visLength The length of the line */ static void drawLine(const Position& beg, SUMOReal rot, - SUMOReal visLength) ; + SUMOReal visLength); /** @brief Draws a thin line using the mean of both given points as begin position @@ -151,7 +151,7 @@ * @param[in] visLength The length of the line */ static void drawLine(const Position& beg1, const Position& beg2, - SUMOReal rot, SUMOReal visLength) ; + SUMOReal rot, SUMOReal visLength); /** @brief Draws a thin line along the given position vector @@ -160,7 +160,7 @@ * * @param[in] v The positions vector to use */ - static void drawLine(const PositionVector& v) ; + static void drawLine(const PositionVector& v); /** @brief Draws a thin line between the two points @@ -170,7 +170,7 @@ * @param[in] beg Begin of the line * @param[in] end End of the line */ - static void drawLine(const Position& beg, const Position& end) ; + static void drawLine(const Position& beg, const Position& end); /** @brief Draws a filled circle around (0,0) @@ -180,7 +180,7 @@ * @param[in] width The width of the circle * @param[in] steps The number of steps to divide the circle into */ - static void drawFilledCircle(SUMOReal width, int steps = 8) ; + static void drawFilledCircle(SUMOReal width, int steps = 8); /** @brief Draws a filled circle around (0,0) @@ -193,7 +193,7 @@ * @param[in] end The end angle in degress */ static void drawFilledCircle(SUMOReal width, int steps, - SUMOReal beg, SUMOReal end) ; + SUMOReal beg, SUMOReal end); /** @brief Draws an unfilled circle around (0,0) @@ -205,7 +205,7 @@ * @param[in] steps The number of steps to divide the circle into */ static void drawOutlineCircle(SUMOReal width, SUMOReal iwidth, - int steps = 8) ; + int steps = 8); /** @brief Draws an unfilled circle around (0,0) @@ -219,7 +219,7 @@ * @param[in] end The end angle in degress */ static void drawOutlineCircle(SUMOReal width, SUMOReal iwidth, - int steps, SUMOReal beg, SUMOReal end) ; + int steps, SUMOReal beg, SUMOReal end); /** @brief Draws a triangle at the end of the given line @@ -229,7 +229,7 @@ * @param[in] tWidth The width of the triangle */ static void drawTriangleAtEnd(const Line& l, SUMOReal tLength, - SUMOReal tWidth) ; + SUMOReal tWidth); /// @brief Sets the gl-color to this value static void setColor(const RGBColor& c); diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GLObjectValuePassConnector.h sumo-0.16.0~dfsg/src/utils/gui/div/GLObjectValuePassConnector.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GLObjectValuePassConnector.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GLObjectValuePassConnector.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GLObjectValuePassConnector.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GLObjectValuePassConnector.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Class passing values from a GUIGlObject to another object /****************************************************************************/ @@ -70,11 +70,10 @@ * @param[in] source The method for obtaining the value * @param[in] retriever The object to pass the value to */ - GLObjectValuePassConnector(GUIGlObject& o, ValueSource *source, ValueRetriever *retriever) + GLObjectValuePassConnector(GUIGlObject& o, ValueSource* source, ValueRetriever* retriever) : myObject(o), mySource(source), myRetriever(retriever) { /*, myIsInvalid(false) */ - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); myContainer.push_back(this); - myLock.unlock(); } @@ -96,21 +95,19 @@ /** @brief Updates all instances (passes values) */ static void updateAll() { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); std::for_each(myContainer.begin(), myContainer.end(), std::mem_fun(&GLObjectValuePassConnector::passValue)); - myLock.unlock(); } /** @brief Deletes all instances */ static void clear() { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); while (!myContainer.empty()) { delete(*myContainer.begin()); } myContainer.clear(); - myLock.unlock(); } @@ -120,7 +117,7 @@ * @param[in] o The object which shall no longer be asked for values */ static void removeObject(GUIGlObject& o) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); for (typename std::vector< GLObjectValuePassConnector* >::iterator i = myContainer.begin(); i != myContainer.end();) { if ((*i)->myObject.getGlID() == o.getGlID()) { i = myContainer.erase(i); @@ -128,7 +125,6 @@ ++i; } } - myLock.unlock(); } /// @} @@ -151,10 +147,10 @@ GUIGlObject& myObject; /// @brief The source for values - ValueSource *mySource; + ValueSource* mySource; /// @brief The destination for values - ValueRetriever *myRetriever; + ValueRetriever* myRetriever; /// @brief The mutex used to avoid concurrent updates of the connectors container static MFXMutex myLock; @@ -163,6 +159,14 @@ static std::vector< GLObjectValuePassConnector* > myContainer; +private: + /// @brief Invalidated copy constructor. + GLObjectValuePassConnector(const GLObjectValuePassConnector&); + + /// @brief Invalidated assignment operator. + GLObjectValuePassConnector& operator=(const GLObjectValuePassConnector&); + + }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp sumo-0.16.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2012-01-15 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 11.03.2004 -/// @version $Id: GUIDialog_GLChosenEditor.cpp 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUIDialog_GLChosenEditor.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Editor for the list of chosen objects /****************************************************************************/ @@ -44,12 +44,6 @@ #include #include -#ifdef _WIN32 -#include -#endif - -#include - #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -127,7 +121,7 @@ void GUIDialog_GLChosenEditor::rebuildList() { myList->clearItems(); - const std::set &chosen = gSelected.getSelected(); + const std::set& chosen = gSelected.getSelected(); for (std::set::const_iterator i = chosen.begin(); i != chosen.end(); ++i) { GUIGlObject* object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(*i); if (object != 0) { @@ -162,7 +156,7 @@ std::string file = opendialog.getFilename().text(); std::string msg = gSelected.load(file); if (msg != "") { - FXMessageBox::error(this, MBOX_OK, "Errors while loading Selection", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Errors while loading Selection", "%s", msg.c_str()); } rebuildList(); } @@ -179,7 +173,7 @@ try { gSelected.save(file.text()); } catch (IOError& e) { - FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); + FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); } return 1; } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.h sumo-0.16.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2012-09-25 22:01:48.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Thu, 11.03.2004 -/// @version $Id: GUIDialog_GLChosenEditor.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_GLChosenEditor.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Editor for the list of chosen objects /****************************************************************************/ @@ -67,19 +67,19 @@ * @param[in] str The storage of object selections to use */ GUIDialog_GLChosenEditor(GUIMainWindow* parent, - GUISelectedStorage* str) ; + GUISelectedStorage* str); /** @brief Destructor * * Notifies both the parent and the storage about being destroyed. */ - ~GUIDialog_GLChosenEditor() ; + ~GUIDialog_GLChosenEditor(); /** @brief Rebuilds the entire list */ - void rebuildList() ; + void rebuildList(); /// @name FOX-callbacks diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIMessageWindow.cpp sumo-0.16.0~dfsg/src/utils/gui/div/GUIMessageWindow.cpp --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIMessageWindow.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIMessageWindow.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 25 Nov 2003 -/// @version $Id: GUIMessageWindow.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIMessageWindow.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A logging window for the gui /****************************************************************************/ @@ -30,6 +30,7 @@ #endif #include +#include #include "GUIMessageWindow.h" #ifdef CHECK_MEMORY_LEAKS @@ -40,9 +41,12 @@ // =========================================================================== // method definitions // =========================================================================== -GUIMessageWindow::GUIMessageWindow(FXComposite* parent) - : FXText(parent, 0, 0, 0, 0, 0, 0, 50), - myStyles(0) { +GUIMessageWindow::GUIMessageWindow(FXComposite* parent) : + FXText(parent, 0, 0, 0, 0, 0, 0, 50), + myStyles(0), + myErrorRetriever(0), + myMessageRetriever(0), + myWarningRetriever(0) { setStyled(true); setEditable(false); myStyles = new FXHiliteStyle[4]; @@ -89,6 +93,9 @@ GUIMessageWindow::~GUIMessageWindow() { delete[] myStyles; + delete myMessageRetriever; + delete myErrorRetriever; + delete myWarningRetriever; } @@ -152,6 +159,27 @@ } +void +GUIMessageWindow::registerMsgHandlers() { + if (myMessageRetriever == 0) { + // initialize only if registration is requested + myMessageRetriever = new MsgOutputDevice(this, EVENT_MESSAGE_OCCURED); + myErrorRetriever = new MsgOutputDevice(this, EVENT_ERROR_OCCURED); + myWarningRetriever = new MsgOutputDevice(this, EVENT_WARNING_OCCURED); + } + MsgHandler::getMessageInstance()->addRetriever(myMessageRetriever); + MsgHandler::getErrorInstance()->addRetriever(myErrorRetriever); + MsgHandler::getWarningInstance()->addRetriever(myWarningRetriever); +} + + +void +GUIMessageWindow::unregisterMsgHandlers() { + MsgHandler::getMessageInstance()->removeRetriever(myMessageRetriever); + MsgHandler::getErrorInstance()->removeRetriever(myErrorRetriever); + MsgHandler::getWarningInstance()->removeRetriever(myWarningRetriever); +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIMessageWindow.h sumo-0.16.0~dfsg/src/utils/gui/div/GUIMessageWindow.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIMessageWindow.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIMessageWindow.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file GUIMessageWindow.h /// @author Daniel Krajzewicz /// @date Tue, 25 Nov 2003 -/// @version $Id: GUIMessageWindow.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIMessageWindow.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A logging window for the gui /****************************************************************************/ @@ -33,6 +33,7 @@ #include #include #include +#include // =========================================================================== @@ -56,15 +57,15 @@ * * @param[in] parent The parent window */ - GUIMessageWindow(FXComposite* parent) ; + GUIMessageWindow(FXComposite* parent); /// @brief Destructor - ~GUIMessageWindow() ; + ~GUIMessageWindow(); /// @brief Adds a a separator to this log window - void addSeparator() ; + void addSeparator(); /** @brief Adds new text to the window @@ -75,17 +76,51 @@ * @param[in] msg The message * @see GUIEventType */ - void appendText(GUIEventType eType, const std::string& msg) ; + void appendText(GUIEventType eType, const std::string& msg); /// @brief Clears the window - void clear() ; + void clear(); + + /// @brief register and unregister message handlers + void registerMsgHandlers(); + void unregisterMsgHandlers(); + + +private: + class MsgOutputDevice : public OutputDevice { + public: + MsgOutputDevice(GUIMessageWindow* msgWindow, GUIEventType type) : + myMsgWindow(msgWindow), + myType(type) { } + + ~MsgOutputDevice() { } + + protected: + std::ostream& getOStream() { + return myStream; + } + void postWriteHook() { + myMsgWindow->appendText(myType, myStream.str()); + myStream.str(""); + } + + private: + GUIMessageWindow* myMsgWindow; + std::ostringstream myStream; + GUIEventType myType; + }; private: /// @brief The text colors used FXHiliteStyle* myStyles; + /** @brief The instances of message retriever encapsulations */ + OutputDevice* myErrorRetriever, *myMessageRetriever, *myWarningRetriever; + + + }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.cpp sumo-0.16.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.cpp --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mai 2003 -/// @version $Id: GUIParam_PopupMenu.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIParam_PopupMenu.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A popup-menu for dynamic patameter table entries /****************************************************************************/ @@ -60,7 +60,7 @@ // =========================================================================== GUIParam_PopupMenuInterface::GUIParam_PopupMenuInterface(GUIMainWindow& app, GUIParameterTableWindow& parentWindow, GUIGlObject& o, const std::string& varName, - ValueSource *src) + ValueSource* src) : FXMenuPane(&parentWindow), myObject(&o), myParentWindow(&parentWindow), myApplication(&app), myVarName(varName), mySource(src) { } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.h sumo-0.16.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIParam_PopupMenu.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file GUIParam_PopupMenu.h /// @author Daniel Krajzewicz /// @date Mai 2003 -/// @version $Id: GUIParam_PopupMenu.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIParam_PopupMenu.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A popup-menu for dynamic patameter table entries /****************************************************************************/ @@ -66,11 +66,11 @@ GUIParam_PopupMenuInterface(GUIMainWindow& app, GUIParameterTableWindow& parentWindow, GUIGlObject& o, const std::string& varName, - ValueSource *src) ; + ValueSource* src); /// @brief Destructor - ~GUIParam_PopupMenuInterface() ; + ~GUIParam_PopupMenuInterface(); /// @name FOX-callbacks @@ -99,7 +99,7 @@ std::string myVarName; /// @brief The source of the value - ValueSource *mySource; + ValueSource* mySource; protected: /// @brief FOX needs this diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIParameterTableItem.h sumo-0.16.0~dfsg/src/utils/gui/div/GUIParameterTableItem.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIParameterTableItem.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIParameterTableItem.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date -/// @version $Id: GUIParameterTableItem.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIParameterTableItem.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A single line in a parameter window /****************************************************************************/ @@ -86,7 +86,7 @@ * * @return A SUMOReal-typed copy of the value-source */ - virtual ValueSource *getSUMORealSourceCopy() const = 0; + virtual ValueSource* getSUMORealSourceCopy() const = 0; /** @brief Returns the name of the value @@ -131,7 +131,7 @@ */ GUIParameterTableItem(FXTable* table, unsigned pos, const std::string& name, bool dynamic, - ValueSource *src) + ValueSource* src) : myAmDynamic(dynamic), myName(name), myTablePosition((FXint) pos), mySource(src), myValue(src->getValue()), myTable(table) { init(dynamic, toString(src->getValue())); @@ -246,7 +246,7 @@ * * @return A copy of the value source */ - ValueSource *getSourceCopy() const { + ValueSource* getSourceCopy() const { if (mySource == 0) { return 0; } @@ -258,7 +258,7 @@ * * @return A SUMOReal-typed copy of the value source */ - ValueSource *getSUMORealSourceCopy() const { + ValueSource* getSUMORealSourceCopy() const { if (mySource == 0) { return 0; } @@ -277,7 +277,7 @@ FXint myTablePosition; /** @brief The source to gain new values from; this source is==0 if the values are not dynamic */ - ValueSource *mySource; + ValueSource* mySource; /// @brief A backup of the value to avoid the redrawing when nothing has changed T myValue; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.cpp sumo-0.16.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.cpp --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.cpp 2012-02-14 00:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIParameterTableWindow.cpp 11885 2012-02-13 12:35:09Z namdre $ +/// @version $Id: GUIParameterTableWindow.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The window that holds the table of an object's parameter /****************************************************************************/ @@ -65,7 +65,7 @@ GUIParameterTableWindow::GUIParameterTableWindow(GUIMainWindow& app, GUIGlObject& o, size_t noRows) : FXMainWindow(app.getApp(), (o.getFullName() + " Parameter").c_str(), - NULL, NULL, DECOR_ALL, 20, 20, 300, (FXint)(noRows * 20 + 60)), + NULL, NULL, DECOR_ALL, 20, 20, 400, (FXint)(noRows * 20 + 60)), myObject(&o), myApplication(&app), myCurrentPos(0) { myTable = new FXTable(this, this, MID_TABLE, TABLE_COL_SIZABLE | TABLE_ROW_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y); @@ -79,7 +79,7 @@ myTable->getRowHeader()->setWidth(0); FXHeader* header = myTable->getColumnHeader(); header->setItemJustify(0, JUSTIFY_CENTER_X); - header->setItemSize(0, 150); + header->setItemSize(0, 250); header->setItemJustify(1, JUSTIFY_CENTER_X); header->setItemSize(1, 80); header->setItemJustify(2, JUSTIFY_CENTER_X); @@ -106,9 +106,8 @@ void GUIParameterTableWindow::removeObject(GUIGlObject* /*i*/) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); myObject = 0; - myLock.unlock(); } @@ -162,7 +161,7 @@ void GUIParameterTableWindow::mkItem(const char* name, bool dynamic, - ValueSource *src) { + ValueSource* src) { GUIParameterTableItemInterface* i = new GUIParameterTableItem(myTable, myCurrentPos++, name, dynamic, src); myItems.push_back(i); } @@ -170,7 +169,7 @@ void GUIParameterTableWindow::mkItem(const char* name, bool dynamic, - ValueSource *src) { + ValueSource* src) { GUIParameterTableItemInterface* i = new GUIParameterTableItem(myTable, myCurrentPos++, name, dynamic, src); myItems.push_back(i); } @@ -179,7 +178,7 @@ #ifndef HAVE_SUBSECOND_TIMESTEPS void GUIParameterTableWindow::mkItem(const char* name, bool dynamic, - ValueSource *src) { + ValueSource* src) { GUIParameterTableItemInterface* i = new GUIParameterTableItem(myTable, myCurrentPos++, name, dynamic, src); myItems.push_back(i); } @@ -223,15 +222,13 @@ void GUIParameterTableWindow::updateTable() { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); if (myObject == 0) { - myLock.unlock(); return; } for (std::vector::iterator i = myItems.begin(); i != myItems.end(); i++) { (*i)->update(); } - myLock.unlock(); } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.h sumo-0.16.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIParameterTableWindow.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIParameterTableWindow.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIParameterTableWindow.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The window that holds the table of an object's parameter /****************************************************************************/ @@ -73,11 +73,11 @@ * @param[in] noRows Number of rows to allocate */ GUIParameterTableWindow(GUIMainWindow& app, - GUIGlObject& o, size_t noRows) ; + GUIGlObject& o, size_t noRows); /// @brief Destructor - ~GUIParameterTableWindow() ; + ~GUIParameterTableWindow(); /** @brief Closes the building of the table @@ -88,14 +88,14 @@ * * @see GUIMainWindow::addChild */ - void closeBuilding() ; + void closeBuilding(); /** @brief Lets this window know the object shown is being deleted * @param[in] o The deleted (shown) object */ - void removeObject(GUIGlObject* const o) ; + void removeObject(GUIGlObject* const o); @@ -108,7 +108,7 @@ * @param[in] dynamic Information whether the entry is dynamic * @param[in] src The value source to use */ - void mkItem(const char* name, bool dynamic, ValueSource *src) ; + void mkItem(const char* name, bool dynamic, ValueSource* src); /** @brief Adds a row which obtains its value from an SUMOReal-ValueSource @@ -117,7 +117,7 @@ * @param[in] dynamic Information whether the entry is dynamic * @param[in] src The value source to use */ - void mkItem(const char* name, bool dynamic, ValueSource *src) ; + void mkItem(const char* name, bool dynamic, ValueSource* src); #ifndef HAVE_SUBSECOND_TIMESTEPS @@ -127,7 +127,7 @@ * @param[in] dynamic Information whether the entry is dynamic * @param[in] src The value source to use */ - void mkItem(const char* name, bool dynamic, ValueSource *src) ; + void mkItem(const char* name, bool dynamic, ValueSource* src); #endif /** @brief Adds a row which shows a string-value @@ -137,7 +137,7 @@ * @param[in] value The value to show * @todo the dynamic-parameter is obsolete(?) */ - void mkItem(const char* name, bool dynamic, std::string value) ; + void mkItem(const char* name, bool dynamic, std::string value); /** @brief Adds a row which shows a unsigned-value @@ -147,7 +147,7 @@ * @param[in] value The value to show * @todo the dynamic-parameter is obsolete */ - void mkItem(const char* name, bool dynamic, unsigned value) ; + void mkItem(const char* name, bool dynamic, unsigned value); /** @brief Adds a row which shows a SUMOReal-value @@ -157,7 +157,7 @@ * @param[in] value The value to show * @todo the dynamic-parameter is obsolete */ - void mkItem(const char* name, bool dynamic, SUMOReal value) ; + void mkItem(const char* name, bool dynamic, SUMOReal value); #ifndef HAVE_SUBSECOND_TIMESTEPS @@ -168,7 +168,7 @@ * @param[in] value The value to show * @todo the dynamic-parameter is obsolete */ - void mkItem(const char* name, bool dynamic, SUMOTime value) ; + void mkItem(const char* name, bool dynamic, SUMOTime value); #endif /// @} @@ -210,7 +210,7 @@ * * @see GUIParameterTableItemInterface::update */ - void updateTable() ; + void updateTable(); private: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUISelectedStorage.cpp sumo-0.16.0~dfsg/src/utils/gui/div/GUISelectedStorage.cpp --- sumo-0.15.0~dfsg/src/utils/gui/div/GUISelectedStorage.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUISelectedStorage.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jun 2004 -/// @version $Id: GUISelectedStorage.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUISelectedStorage.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for "selected" objects /****************************************************************************/ @@ -85,7 +85,7 @@ } -const std::set & +const std::set& GUISelectedStorage::SingleTypeSelections::getSelected() const { return mySelected; } @@ -165,13 +165,13 @@ } -const std::set & +const std::set& GUISelectedStorage::getSelected() const { return myAllSelected; } -const std::set & +const std::set& GUISelectedStorage::getSelected(GUIGlObjectType type) { return mySelections[type].getSelected(); } @@ -190,10 +190,12 @@ std::set -GUISelectedStorage::loadIDs(const std::string& filename, std::string& msgOut, GUIGlObjectType type) { +GUISelectedStorage::loadIDs(const std::string& filename, std::string& msgOut, GUIGlObjectType type, int maxErrors) { std::set result; std::ostringstream msg; std::ifstream strm(filename.c_str()); + int numIgnored = 0; + int numMissing = 0; if (!strm.good()) { msgOut = "Could not open '" + filename + "'.\n"; return result; @@ -208,16 +210,25 @@ GUIGlObject* object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(line); if (object) { if (type != GLO_MAX && (object->getType() != type)) { - msg << "Ignoring item '" << line << "' because of invalid type " << toString(object->getType()) << "\n"; + numIgnored++; + if (numIgnored + numMissing <= maxErrors) { + msg << "Ignoring item '" << line << "' because of invalid type " << toString(object->getType()) << "\n"; + } } else { result.insert(object->getGlID()); } } else { - msg << "Item '" + line + "' not found\n"; + numMissing++; + if (numIgnored + numMissing <= maxErrors) { + msg << "Item '" + line + "' not found\n"; + } continue; } } strm.close(); + if (numIgnored + numMissing > maxErrors) { + msg << "...\n" << numIgnored << " objects ignored, " << numMissing << " objects not found\n"; + } msgOut = msg.str(); return result; } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUISelectedStorage.h sumo-0.16.0~dfsg/src/utils/gui/div/GUISelectedStorage.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUISelectedStorage.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUISelectedStorage.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jun 2004 -/// @version $Id: GUISelectedStorage.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUISelectedStorage.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for "selected" objects /****************************************************************************/ @@ -169,7 +169,7 @@ * * @return The set of all selected objects (ids) */ - const std::set &getSelected() const; + const std::set& getSelected() const; /** @brief Returns the set of ids of all selected objects' of a certain type @@ -178,7 +178,7 @@ * @return A set containing the ids of all selected objects of the given type * @see SingleTypeSelections::getSelected */ - const std::set &getSelected(GUIGlObjectType type); + const std::set& getSelected(GUIGlObjectType type); /** @brief Clears the list of selected objects @@ -205,9 +205,10 @@ * @param[in] filename The name of the file to load the list of selected objects from * @param[out] msg Any error messages while loading or the empty string * @param[in] type The type of the objects to load if changed from default + * @param[in] maxErrors The maximum Number of errors to return * @return the set of loaded ids */ - std::set loadIDs(const std::string& filename, std::string& msgOut, GUIGlObjectType type = GLO_MAX); + std::set loadIDs(const std::string& filename, std::string& msgOut, GUIGlObjectType type = GLO_MAX, int maxErrors = 16); /** @brief Saves a selection list @@ -280,7 +281,7 @@ /** @brief Returns the list of selected ids * @return A list containing the ids of all selected objects */ - const std::set &getSelected() const; + const std::set& getSelected() const; private: /// @brief The list of selected ids diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/GUIUserIO.h sumo-0.16.0~dfsg/src/utils/gui/div/GUIUserIO.h --- sumo-0.15.0~dfsg/src/utils/gui/div/GUIUserIO.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/GUIUserIO.h 2012-09-25 22:01:48.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2006 -/// @version $Id: GUIUserIO.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIUserIO.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Some OS-dependant functions to ease cliboard manipulation /****************************************************************************/ @@ -59,7 +59,7 @@ * @param[in] app The application to use * @param[in] text The text to copy */ - static void copyToClipboard(const FXApp& app, const std::string& text) ; + static void copyToClipboard(const FXApp& app, const std::string& text); static std::string clipped; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/div/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/div/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/div/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/div/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -104,6 +104,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -134,6 +135,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -168,6 +170,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -201,7 +204,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/events/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/events/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/events/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/events/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -69,6 +69,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -99,6 +100,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -133,6 +135,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -166,7 +169,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GLIncludes.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GLIncludes.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GLIncludes.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GLIncludes.h 2012-09-25 22:01:50.000000000 +0000 @@ -0,0 +1,43 @@ +/****************************************************************************/ +/// @file GLIncludes.h +/// @author Michael Behrisch +/// @date 2012 +/// @version $Id: GLIncludes.h 12283 2012-04-29 14:01:02Z behrisch $ +/// +// collection of includes for GL usage +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef GLIncludes_h +#define GLIncludes_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#ifdef WIN32 +#define NOMINMAX +#include +#undef NOMINMAX +#endif + +#include +#include + + +#endif diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2012-09-25 22:01:50.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGLObjectPopupMenu.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGLObjectPopupMenu.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // The popup menu of a globject /****************************************************************************/ @@ -63,11 +63,11 @@ * @param[in] o The object of interest */ GUIGLObjectPopupMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent, GUIGlObject& o) ; + GUISUMOAbstractView& parent, GUIGlObject& o); /// @brief Destructor - virtual ~GUIGLObjectPopupMenu() ; + virtual ~GUIGLObjectPopupMenu(); public: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject.cpp sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject.cpp --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject.cpp 2012-10-18 23:02:44.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GUIGlObject.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGlObject.cpp 12857 2012-10-18 11:33:33Z namdre $ /// // Base class for all objects that may be displayed within the openGL-gui /****************************************************************************/ @@ -31,12 +31,6 @@ #include #endif -#ifdef WIN32 -#include -#endif - -#include - #include #include #include @@ -68,9 +62,11 @@ {"tlLogic", GLO_TLLOGIC}, {"detector", GLO_DETECTOR}, {"trigger", GLO_TRIGGER}, - {"shape", GLO_SHAPE}, - {"vehicle", GLO_VEHICLE}, {"additional", GLO_ADDITIONAL}, + {"polygon", GLO_POLYGON}, + {"poi", GLO_POI}, + {"vehicle", GLO_VEHICLE}, + {"person", GLO_PERSON}, {"undefined", GLO_MAX} }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject.h 2012-03-04 00:03:05.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Oct 2002 -/// @version $Id: GUIGlObject.h 12003 2012-03-03 12:19:26Z behrisch $ +/// @version $Id: GUIGlObject.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Base class for all objects that may be displayed within the openGL-gui /****************************************************************************/ @@ -93,7 +93,7 @@ /// @brief Destructor - virtual ~GUIGlObject() ; + virtual ~GUIGlObject(); /// @brief associates object types with strings static StringBijection TypeNames; @@ -188,7 +188,7 @@ void setNode(osg::Node* node) { myOSGNode = node; } - + osg::Node* getNode() const { return myOSGNode; } @@ -200,13 +200,13 @@ /** @brief Lets this object know a parameter window showing the object's values was opened * @param[in] w The opened parameter window */ - void addParameterTable(GUIParameterTableWindow* w) ; + void addParameterTable(GUIParameterTableWindow* w); /** @brief Lets this object know a parameter window showing the object's values was closed * @param[in] w The closed parameter window */ - void removeParameterTable(GUIParameterTableWindow* w) ; + void removeParameterTable(GUIParameterTableWindow* w); /// @} @@ -222,35 +222,35 @@ * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildPopupHeader(GUIGLObjectPopupMenu* ret, GUIMainWindow& app, bool addSeparator = true) ; + void buildPopupHeader(GUIGLObjectPopupMenu* ret, GUIMainWindow& app, bool addSeparator = true); /** @brief Builds an entry which allows to center to the object * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildCenterPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true) ; + void buildCenterPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true); /** @brief Builds entries which allow to copy the name / typed name into the clipboard * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildNameCopyPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true) ; + void buildNameCopyPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true); /** @brief Builds an entry which allows to (de)select the object * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildSelectionPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true) ; + void buildSelectionPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true); /** @brief Builds an entry which allows to open the parameter window * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildShowParamsPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true) ; + void buildShowParamsPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true); /** @brief Builds an entry which allows to copy the cursor position @@ -258,14 +258,14 @@ * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildPositionCopyEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true) ; + void buildPositionCopyEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true); /** @brief Builds an entry which allows to open the manipulator window * @param[in, filled] ret The popup menu to add the entry to * @param[in] addSeparator Whether a separator shall be added, too */ - void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true) ; + void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator = true); //@} protected: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.cpp sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.cpp --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2012-09-25 22:01:50.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGlObjectStorage.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGlObjectStorage.cpp 12652 2012-09-03 11:11:04Z dkrajzew $ /// // A storage for displayed objects via their numerical id /****************************************************************************/ @@ -60,54 +60,47 @@ GUIGlID GUIGlObjectStorage::registerObject(GUIGlObject* object, const std::string& fullName) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); GUIGlID id = myAktID++; myMap[id] = object; myFullNameMap[fullName] = object; - myLock.unlock(); return id; } GUIGlObject* GUIGlObjectStorage::getObjectBlocking(GUIGlID id) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); ObjectMap::iterator i = myMap.find(id); if (i == myMap.end()) { i = myBlocked.find(id); if (i != myBlocked.end()) { GUIGlObject* o = (*i).second; - myLock.unlock(); return o; } - myLock.unlock(); return 0; } GUIGlObject* o = (*i).second; myMap.erase(id); myBlocked[id] = o; - myLock.unlock(); return o; } GUIGlObject* GUIGlObjectStorage::getObjectBlocking(const std::string& fullName) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); if (myFullNameMap.count(fullName)) { GUIGlID id = myFullNameMap[fullName]->getGlID(); - myLock.unlock(); return getObjectBlocking(id); - } else { - myLock.unlock(); - return 0; } + return 0; } bool GUIGlObjectStorage::remove(GUIGlID id) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); ObjectMap::iterator i = myMap.find(id); if (i == myMap.end()) { i = myBlocked.find(id); @@ -116,48 +109,45 @@ myFullNameMap.erase(o->getFullName()); myBlocked.erase(id); my2Delete[id] = o; - myLock.unlock(); return false; - } else { - myFullNameMap.erase(i->second->getFullName()); - myMap.erase(id); - myLock.unlock(); - return true; } + myFullNameMap.erase(i->second->getFullName()); + myMap.erase(id); + return true; } void GUIGlObjectStorage::clear() { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); myMap.clear(); myAktID = 0; - myLock.unlock(); } void GUIGlObjectStorage::unblockObject(GUIGlID id) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); ObjectMap::iterator i = myBlocked.find(id); if (i == myBlocked.end()) { - myLock.unlock(); return; } GUIGlObject* o = (*i).second; myBlocked.erase(id); myMap[id] = o; - myLock.unlock(); } std::set GUIGlObjectStorage::getAllIDs() const { + AbstractMutex::ScopedLocker locker(myLock); std::set result; for (ObjectMap::const_iterator it = myMap.begin(); it != myMap.end(); it++) { result.insert(it->first); } return result; } + + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObjectStorage.h 2012-09-25 22:01:50.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct 2002 -/// @version $Id: GUIGlObjectStorage.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGlObjectStorage.h 12652 2012-09-03 11:11:04Z dkrajzew $ /// // A storage for displayed objects via their numerical id /****************************************************************************/ @@ -60,11 +60,11 @@ class GUIGlObjectStorage { public: /// @brief Constructor - GUIGlObjectStorage() ; + GUIGlObjectStorage(); /// @brief Destructor - ~GUIGlObjectStorage() ; + ~GUIGlObjectStorage(); /** @brief Registers an object @@ -76,7 +76,7 @@ * @param[in] fullName The full name of the object to register * @return the GUIGlObject under which the object has been registered */ - GUIGlID registerObject(GUIGlObject* object, const std::string& fullName) ; + GUIGlID registerObject(GUIGlObject* object, const std::string& fullName); /** @brief Returns the object from the container locking it @@ -87,7 +87,7 @@ * @param[in] id The id of the object to return * @return The object with the given id or 0 if no such object is known */ - GUIGlObject* getObjectBlocking(GUIGlID id) ; + GUIGlObject* getObjectBlocking(GUIGlID id); /** @brief Returns the object from the container locking it @@ -98,7 +98,7 @@ * @param[in] id The id of the object to return * @return The object with the given id or 0 if no such object is known */ - GUIGlObject* getObjectBlocking(const std::string& fullName) ; + GUIGlObject* getObjectBlocking(const std::string& fullName); /** @brief Removes the named object from this container @@ -110,14 +110,14 @@ * @param[in] id The id of the object to remove * @return Whether the object could be removed (and may be deleted) */ - bool remove(GUIGlID id) ; + bool remove(GUIGlID id); /** @brief Clears this container * * The objects are not deleted. */ - void clear() ; + void clear(); /** @brief Marks an object as unblocked @@ -125,7 +125,7 @@ * The object is moved from "myBlocked" to "myMap". * @param[in] id The id of the object to unblock */ - void unblockObject(GUIGlID id) ; + void unblockObject(GUIGlID id); /** @brief Sets the given object as the "network" object @@ -174,7 +174,7 @@ GUIGlID myAktID; /// @brief A lock to avoid parallel access on the storages - MFXMutex myLock; + mutable MFXMutex myLock; /// @brief The network object GUIGlObject* myNetObject; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObjectTypes.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObjectTypes.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObjectTypes.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObjectTypes.h 2012-11-29 13:19:31.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGlObjectTypes.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGlObjectTypes.h 13080 2012-11-29 13:19:30Z behrisch $ /// // A list of object types which may be displayed within the gui // each type has an associated string which will be prefefixed to an object id @@ -59,14 +59,18 @@ GLO_DETECTOR = 16, /// @brief a lane speed trigger, GLO_TRIGGER = 64, - /// @brief a shape - GLO_SHAPE = 128, - /// @brief a vehicles - GLO_VEHICLE = 256, /// @brief compound additional GLO_ADDITIONAL = GLO_DETECTOR | GLO_TRIGGER, + /// @brief a polygon + GLO_POLYGON = 128, + /// @brief a poi + GLO_POI = 256, + /// @brief a vehicles + GLO_VEHICLE = 512, + /// @brief a person + GLO_PERSON = 1024, /// @brief empty max - GLO_MAX = 512 + GLO_MAX = 2048 }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: GUIGlObject_AbstractAdd.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGlObject_AbstractAdd.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Base class for additional objects (detectors etc.) /****************************************************************************/ @@ -82,7 +82,14 @@ } -const std::vector & +void +GUIGlObject_AbstractAdd::remove(GUIGlObject_AbstractAdd* o) { + myObjects.erase(o->getFullName()); + myObjectList.erase(std::remove(myObjectList.begin(), myObjectList.end(), o), myObjectList.end()); +} + + +const std::vector& GUIGlObject_AbstractAdd::getObjectList() { return myObjectList; } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: GUIGlObject_AbstractAdd.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIGlObject_AbstractAdd.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Base class for additional objects (detectors etc.) /****************************************************************************/ @@ -52,7 +52,7 @@ GUIGlObjectType type, const std::string& id); - ~GUIGlObject_AbstractAdd() ; + ~GUIGlObject_AbstractAdd(); /// Clears the dictionary (the objects will not be deleted) static void clearDictionary(); @@ -60,8 +60,11 @@ /// Returns a named object static GUIGlObject_AbstractAdd* get(const std::string& name); + /// Removes an object + static void remove(GUIGlObject_AbstractAdd* o); + /// Returns the list of all additional objects - static const std::vector &getObjectList(); + static const std::vector& getObjectList(); /// Returns the list of gl-ids of all additional objects static std::vector getIDList(); diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.cpp sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.cpp --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2006 -/// @version $Id: GUIPointOfInterest.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIPointOfInterest.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The GUI-version of a point of interest /****************************************************************************/ @@ -30,22 +30,18 @@ #include #endif -#ifdef WIN32 -#include -#endif - -#include - -#include "GUIPointOfInterest.h" #include #include #include #include #include +#include #include #include #include #include +#include +#include "GUIPointOfInterest.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -55,14 +51,13 @@ // =========================================================================== // method definitions // =========================================================================== -GUIPointOfInterest::GUIPointOfInterest(int layer, - const std::string& id, - const std::string& type, - const Position& p, - const RGBColor& c) : - PointOfInterest(id, type, p, c), - GUIGlObject_AbstractAdd("poi", GLO_SHAPE, id), - myLayer(layer) {} +GUIPointOfInterest::GUIPointOfInterest(const std::string& id, const std::string& type, + const RGBColor& color, const Position& pos, + SUMOReal layer, SUMOReal angle, const std::string& imgFile, + SUMOReal width, SUMOReal height) : + PointOfInterest(id, type, color, pos, layer, angle, imgFile, width, height), + GUIGlObject_AbstractAdd("poi", GLO_POI, id) +{} GUIPointOfInterest::~GUIPointOfInterest() {} @@ -96,7 +91,8 @@ GUIPointOfInterest::getCenteringBoundary() const { Boundary b; b.add(x(), y()); - b.grow(10); + b.growWidth(myHalfImgWidth); + b.growHeight(myHalfImgHeight); return b; } @@ -108,22 +104,25 @@ } glPushName(getGlID()); glPushMatrix(); - glColor3d(red(), green(), blue()); + GLHelper::setColor(getColor()); glTranslated(x(), y(), getLayer()); - GLHelper::drawFilledCircle((SUMOReal) 1.3 * s.poiExaggeration, 16); + glRotated(getAngle(), 0, 0, 1); + + if (myImgFile != "") { + int textureID = GUITexturesHelper::getTextureID(myImgFile); + if (textureID > 0) { + GUITexturesHelper::drawTexturedBox(textureID, + -myHalfImgWidth * s.poiExaggeration, -myHalfImgHeight * s.poiExaggeration, + myHalfImgWidth * s.poiExaggeration, myHalfImgHeight * s.poiExaggeration); + } + } else { + // fallback if no image is defined + GLHelper::drawFilledCircle((SUMOReal) 1.3 * s.poiExaggeration, 16); + } glPopMatrix(); drawName(Position(x() + 1.32 * s.poiExaggeration, y() + 1.32 * s.poiExaggeration), s.scale, s.poiName); glPopName(); } - - -int -GUIPointOfInterest::getLayer() const { - return myLayer; -} - - - /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPointOfInterest.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2006 -/// @version $Id: GUIPointOfInterest.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIPointOfInterest.h 13107 2012-12-02 13:57:34Z behrisch $ /// // missing_desc /****************************************************************************/ @@ -52,19 +52,23 @@ class GUIPointOfInterest : public PointOfInterest, public GUIGlObject_AbstractAdd { public: /** @brief Constructor - * @param[in] idStorage The gl-id storage for giving this object an gl-id - * @param[in] layer The layer the PoI will be located in - * @param[in] id The name of the PoI - * @param[in] type The type of the PoI - * @param[in] p The position of the PoI - * @param[in] c The color of the PoI - */ - GUIPointOfInterest(int layer, - const std::string& id, const std::string& type, - const Position& p, const RGBColor& c) ; + * @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] pos The position of the POI + * @param[in] width The width of the POI image + * @param[in] height The height of the POI image + */ + GUIPointOfInterest(const std::string& id, const std::string& type, + const RGBColor& color, const Position& pos, + SUMOReal layer, SUMOReal angle, const std::string& imgFile, + SUMOReal width, SUMOReal height); /// @brief Destructor - virtual ~GUIPointOfInterest() ; + virtual ~GUIPointOfInterest(); @@ -79,7 +83,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -90,7 +94,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -98,27 +102,16 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} - - /// Returns the layer the object is located in - int getLayer() const; - -protected: - /** @brief The layer this object is located in - * - * This value is used for determining which object to choose as being on top under the cursor - */ - int myLayer; - }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPolygon.cpp sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPolygon.cpp --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPolygon.cpp 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPolygon.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date June 2006 -/// @version $Id: GUIPolygon.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIPolygon.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The GUI-version of a polygon /****************************************************************************/ @@ -32,6 +32,7 @@ #include #include "GUIPolygon.h" +#include #include #include #include @@ -43,24 +44,17 @@ #include #endif // CHECK_MEMORY_LEAKS -#ifdef WIN32 -#include -#endif - -#include -#include - // =========================================================================== // method definitions // =========================================================================== -GUIPolygon::GUIPolygon(int layer, - const std::string name, const std::string type, - const RGBColor& color, - const PositionVector& Pos, - bool fill) - : Polygon(name, type, color, Pos, fill), - GUIGlObject_AbstractAdd("poly", GLO_SHAPE, name), myLayer(layer) {} +GUIPolygon::GUIPolygon(const std::string& id, const std::string& type, + const RGBColor& color, const PositionVector& shape, bool fill, + SUMOReal layer, SUMOReal angle, const std::string& imgFile): + Polygon(id, type, color, shape, fill, layer, angle, imgFile), + GUIGlObject_AbstractAdd("poly", GLO_POLYGON, id), + myDisplayList(0) +{} GUIPolygon::~GUIPolygon() {} @@ -116,9 +110,6 @@ } void APIENTRY vertexCallback(GLvoid* vertex) { - const GLdouble* pointer; - - pointer = (GLdouble*) vertex; glVertex3dv((GLdouble*) vertex); } @@ -137,11 +128,19 @@ *dataOut = vertex; } -double glvert[6]; + +SUMOReal POLY_TEX_DIM = 256; +GLfloat xPlane[] = {1.0 / POLY_TEX_DIM, 0.0, 0.0, 0.0}; +GLfloat yPlane[] = {0.0, 1.0 / POLY_TEX_DIM, 0.0, 0.0}; + void GUIPolygon::drawGL(const GUIVisualizationSettings& s) const { UNUSED_PARAMETER(s); - if (fill()) { + AbstractMutex::ScopedLocker locker(myLock); + if (myDisplayList == 0) { + storeTesselation(); + } + if (getFill()) { if (myShape.size() < 3) { return; } @@ -153,9 +152,75 @@ glPushName(getGlID()); glPushMatrix(); glTranslated(0, 0, getLayer()); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + // XXX shape should be rotated around its center when initializing the polygon. do we even need this? + //glRotated(getAngle(), 0, 0, 1); GLHelper::setColor(getColor()); - if (fill()) { + + int textureID = -1; + if (getFill()) { + const std::string& file = getImgFile(); + if (file != "") { + textureID = GUITexturesHelper::getTextureID(file); + } + } + // init generation of texture coordinates + if (textureID >= 0) { + glEnable(GL_TEXTURE_2D); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); // without DEPTH_TEST vehicles may be drawn below roads + glDisable(GL_LIGHTING); + glDisable(GL_COLOR_MATERIAL); + glDisable(GL_ALPHA_TEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glBindTexture(GL_TEXTURE_2D, textureID); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + // http://www.gamedev.net/topic/133564-glutesselation-and-texture-mapping/ + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_GEN_T); + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenfv(GL_S, GL_OBJECT_PLANE, xPlane); + glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenfv(GL_T, GL_OBJECT_PLANE, yPlane); + } + // recall tesselation + glCallList(myDisplayList); + // de-init generation of texture coordinates + if (textureID >= 0) { + glEnable(GL_DEPTH_TEST); + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_TEXTURE_2D); + glDisable(GL_TEXTURE_GEN_S); + glDisable(GL_TEXTURE_GEN_T); + } + glPopName(); + glPopMatrix(); +} + + +void +GUIPolygon::setShape(const PositionVector& shape) { + AbstractMutex::ScopedLocker locker(myLock); + Polygon::setShape(shape); + storeTesselation(); +} + + +void +GUIPolygon::storeTesselation() const { + if (myDisplayList > 0) { + glDeleteLists(myDisplayList, 1); + } + myDisplayList = glGenLists(1); + if (myDisplayList == 0) { + throw ProcessError("GUIPolygon::storeTesselation() could not create display list"); + } + glNewList(myDisplayList, GL_COMPILE); + if (getFill()) { + // draw the tesselated shape double* points = new double[myShape.size() * 3]; GLUtesselator* tobj = gluNewTess(); gluTessCallback(tobj, GLU_TESS_VERTEX, (GLvoid(APIENTRY*)()) &glVertex3dv); @@ -170,35 +235,22 @@ points[3 * i] = myShape[(int) i].x(); points[3 * i + 1] = myShape[(int) i].y(); points[3 * i + 2] = 0; - glvert[0] = myShape[(int) i].x(); - glvert[1] = myShape[(int) i].y(); - glvert[2] = 0; - glvert[3] = 1; - glvert[4] = 1; - glvert[5] = 1; - gluTessVertex(tobj, points + 3 * i, points + 3 * i) ; + gluTessVertex(tobj, points + 3 * i, points + 3 * i); } gluTessEndContour(tobj); gluTessEndPolygon(tobj); gluDeleteTess(tobj); delete[] points; + } else { GLHelper::drawLine(myShape); GLHelper::drawBoxLines(myShape, 1.); } - glPopName(); - glPopMatrix(); -} - - - -int -GUIPolygon::getLayer() const { - return myLayer; + //std::cout << "OpenGL says: '" << gluErrorString(glGetError()) << "'\n"; + glEndList(); } - /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPolygon.h sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPolygon.h --- sumo-0.15.0~dfsg/src/utils/gui/globjects/GUIPolygon.h 2012-01-07 20:14:52.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/GUIPolygon.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2006 -/// @version $Id: GUIPolygon.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIPolygon.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The GUI-version of a polygon /****************************************************************************/ @@ -33,9 +33,11 @@ #endif #include +#include #include #include - +#include +using namespace SUMO; // =========================================================================== // class definitions @@ -47,20 +49,21 @@ class GUIPolygon : public Polygon, public GUIGlObject_AbstractAdd { public: /** @brief Constructor - * @param[in] layer The layer the polygon will be located in - * @param[in] name The name (id) of the polygon - * @param[in] type The type of the polygon + * @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] shape The shape of the polygon * @param[in] fill Whether the polygon shall be filled */ - GUIPolygon(int layer, - const std::string name, const std::string type, - const RGBColor& color, const PositionVector& shape, - bool fill) ; + GUIPolygon(const std::string& id, const std::string& type, + const RGBColor& color, const PositionVector& shape, bool fill, + SUMOReal layer = 0, SUMOReal angle = 0, const std::string& imgFile = ""); /// @brief Destructor - ~GUIPolygon() ; + ~GUIPolygon(); @@ -75,7 +78,7 @@ * @see GUIGlObject::getPopUpMenu */ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns an own parameter window @@ -86,7 +89,7 @@ * @see GUIGlObject::getParameterWindow */ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, - GUISUMOAbstractView& parent) ; + GUISUMOAbstractView& parent); /** @brief Returns the boundary to which the view shall be centered in order to show the object @@ -94,26 +97,30 @@ * @return The boundary the object is within * @see GUIGlObject::getCenteringBoundary */ - Boundary getCenteringBoundary() const ; + 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 ; + void drawGL(const GUIVisualizationSettings& s) const; //@} + /// @brief set a new shape and update the tesselation + virtual void setShape(const PositionVector& shape); - /// Returns the layer the object is located in - int getLayer() const; -protected: - /** @brief The layer this object is located in - * This value is used for determining which object to choose as being on top under the cursor - */ - int myLayer; +private: + /// The mutex used to avoid concurrent updates of the shape + mutable MFXMutex myLock; + + /// @brief id of the display list for the cached tesselation + mutable GLuint myDisplayList; + + /// @brief erform the tesselation and store it in a display list + void storeTesselation() const; }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/Makefile.am sumo-0.16.0~dfsg/src/utils/gui/globjects/Makefile.am --- sumo-0.15.0~dfsg/src/utils/gui/globjects/Makefile.am 2011-06-27 23:02:11.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/Makefile.am 2012-09-25 22:01:50.000000000 +0000 @@ -1,6 +1,6 @@ noinst_LIBRARIES = libguiutilsglobjects.a -libguiutilsglobjects_a_SOURCES = \ +libguiutilsglobjects_a_SOURCES = GLIncludes.h \ GUIGLObjectPopupMenu.cpp GUIGLObjectPopupMenu.h \ GUIGlObject.cpp GUIGlObject.h \ GUIGlObjectStorage.cpp GUIGlObjectStorage.h \ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/globjects/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/globjects/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/globjects/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/globjects/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -103,6 +103,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -133,6 +134,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -167,6 +169,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -200,7 +203,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -221,7 +223,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libguiutilsglobjects.a -libguiutilsglobjects_a_SOURCES = \ +libguiutilsglobjects_a_SOURCES = GLIncludes.h \ GUIGLObjectPopupMenu.cpp GUIGLObjectPopupMenu.h \ GUIGlObject.cpp GUIGlObject.h \ GUIGlObjectStorage.cpp GUIGlObjectStorage.h \ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/images/GUITexturesHelper.cpp sumo-0.16.0~dfsg/src/utils/gui/images/GUITexturesHelper.cpp --- sumo-0.15.0~dfsg/src/utils/gui/images/GUITexturesHelper.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/images/GUITexturesHelper.cpp 2012-10-15 23:02:47.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 08.03.2004 -/// @version $Id: GUITexturesHelper.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITexturesHelper.cpp 12837 2012-10-15 13:55:42Z namdre $ /// // Global storage for textures; manages and draws them /****************************************************************************/ @@ -29,18 +29,15 @@ #include #endif -#include #include #include #include -#include "GUITexturesHelper.h" +#include #include - -#ifdef _WIN32 -#include -#endif - -#include +#include +#include +#include +#include "GUITexturesHelper.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -51,6 +48,7 @@ // definition of static variables // =========================================================================== bool gAllowTextures; +std::map GUITexturesHelper::myTextures; // =========================================================================== @@ -89,7 +87,7 @@ glEnable(GL_TEXTURE_2D); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glDisable(GL_CULL_FACE); - glDisable(GL_DEPTH_TEST); + //glDisable(GL_DEPTH_TEST); // without DEPTH_TEST vehicles may be drawn below roads glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glDisable(GL_TEXTURE_GEN_S); @@ -114,4 +112,30 @@ } + +void +GUITexturesHelper::clearTextures() { + myTextures.clear(); +} + + +int +GUITexturesHelper::getTextureID(const std::string& filename) { + if (myTextures.count(filename) == 0) { + try { + FXImage* i = MFXImageHelper::loadImage(GUIMainWindow::getInstance()->getApp(), filename); + if (MFXImageHelper::scalePower2(i)) { + WRITE_WARNING("Scaling '" + filename + "'."); + } + GUIGlID id = add(i); + delete i; + myTextures[filename] = (int)id; + } catch (InvalidArgument& e) { + WRITE_ERROR("Could not load '" + filename + "'.\n" + e.what()); + myTextures[filename] = -1; + } + } + return myTextures[filename]; +} + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/images/GUITexturesHelper.h sumo-0.16.0~dfsg/src/utils/gui/images/GUITexturesHelper.h --- sumo-0.15.0~dfsg/src/utils/gui/images/GUITexturesHelper.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/images/GUITexturesHelper.h 2012-10-15 23:02:47.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2006 -/// @version $Id: GUITexturesHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUITexturesHelper.h 12837 2012-10-15 13:55:42Z namdre $ /// // Global storage for textures; manages and draws them /****************************************************************************/ @@ -32,6 +32,7 @@ #endif #include +#include // =========================================================================== @@ -58,7 +59,19 @@ SUMOReal sizeX1, SUMOReal sizeY1, SUMOReal sizeX2, SUMOReal sizeY2); /// Adds a texture to use - static unsigned int add(FXImage* i); + static GUIGlID add(FXImage* i); + + /// @brief return texture id for the given filename (initialize on first use) + // @note return -1 on failure + static int getTextureID(const std::string& filename); + + /// @brief clears loaded textures + static void clearTextures(); + +private: + /// @brief mapping from image paths to decals (initialization on first use) + static std::map myTextures; + }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/images/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/images/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/images/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/images/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -101,6 +101,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -131,6 +132,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -165,6 +167,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -198,7 +201,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUIColorScheme.h sumo-0.16.0~dfsg/src/utils/gui/settings/GUIColorScheme.h --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUIColorScheme.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUIColorScheme.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Michael Behrisch /// @author Daniel Krajzewicz /// @date Mon, 20.07.2009 -/// @version $Id: GUIColorScheme.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIColorScheme.h 13107 2012-12-02 13:57:34Z behrisch $ /// // /****************************************************************************/ @@ -134,11 +134,11 @@ return myName; } - const std::vector &getColors() const { + const std::vector& getColors() const { return myColors; } - const std::vector &getThresholds() const { + const std::vector& getThresholds() const { return myThresholds; } @@ -146,7 +146,7 @@ return myIsInterpolated; } - const std::vector &getNames() const { + const std::vector& getNames() const { return myNames; } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUIColorer.h sumo-0.16.0~dfsg/src/utils/gui/settings/GUIColorer.h --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUIColorer.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUIColorer.h 2012-09-25 22:01:48.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Laura Bieker /// @date Mon, 20.07.2009 -/// @version $Id: GUIColorer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIColorer.h 12283 2012-04-29 14:01:02Z behrisch $ /// // /****************************************************************************/ @@ -33,12 +33,6 @@ #include #endif -#ifdef _WIN32 -#include -#endif - -#include - #include #include #include diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.cpp sumo-0.16.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.cpp --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2006-01-09 -/// @version $Id: GUICompleteSchemeStorage.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUICompleteSchemeStorage.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for available visualization settings /****************************************************************************/ @@ -107,7 +107,7 @@ } -const std::vector & +const std::vector& GUICompleteSchemeStorage::getNames() const { return mySortedSchemeNames; } @@ -192,7 +192,7 @@ void GUICompleteSchemeStorage::writeSettings(FXApp* app) { - const std::vector &names = getNames(); + const std::vector& names = getNames(); app->reg().writeIntEntry("VisualizationSettings", "settingNo", (FXint) names.size() - myNumInitialSettings); size_t gidx = 0; for (std::vector::const_iterator i = names.begin() + myNumInitialSettings; i != names.end(); ++i, ++gidx) { diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.h sumo-0.16.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.h --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date :find(mySortedSchemeNames.begin(), mySortedSchemeNames.end(), name)==mySortedSchemeNames.end()) { -/// @version $Id: GUICompleteSchemeStorage.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUICompleteSchemeStorage.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for available visualization settings /****************************************************************************/ @@ -48,73 +48,73 @@ class GUICompleteSchemeStorage { public: /// @brief Constructor - GUICompleteSchemeStorage() ; + GUICompleteSchemeStorage(); /// @brief Destructor - ~GUICompleteSchemeStorage() ; + ~GUICompleteSchemeStorage(); /** @brief Adds a visualization scheme * @param[in] scheme The visualization scheme to add */ - void add(const GUIVisualizationSettings& scheme) ; + void add(const GUIVisualizationSettings& scheme); /** @brief Returns the named scheme * @param[in] name The name of the visualization scheme to return * @return The named visualization scheme */ - GUIVisualizationSettings& get(const std::string& name) ; + GUIVisualizationSettings& get(const std::string& name); /** @brief Returns the default scheme * @return The default visualization scheme */ - GUIVisualizationSettings& getDefault() ; + GUIVisualizationSettings& getDefault(); /** @brief Returns the information whether a setting with the given name is stored * @param[in] name The name of regarded scheme * @return Whether the named scheme is known */ - bool contains(const std::string& name) const ; + bool contains(const std::string& name) const; /** @brief Removes the setting with the given name * @param[in] name The name of the scheme to remove */ - void remove(const std::string& name) ; + void remove(const std::string& name); /** @brief Makes the scheme with the given name the default * @param[in] name The name of the scheme to marks as default */ - void setDefault(const std::string& name) ; + void setDefault(const std::string& name); /** @brief Returns a list of stored settings names * @return The names of known schemes */ - const std::vector &getNames() const ; + const std::vector& getNames() const; /** @brief Returns the number of initial settings * @return The number of default schemes */ - unsigned int getNumInitialSettings() const ; + unsigned int getNumInitialSettings() const; /** @brief Initialises the storage with some default settings * @param[in] app The application */ - void init(FXApp* app) ; + void init(FXApp* app); /** @brief Writes the current scheme into the registry * @param[in] app The application */ - void writeSettings(FXApp* app) ; + void writeSettings(FXApp* app); /** @brief Makes the given viewport the default @@ -122,13 +122,13 @@ * @param[in] y The y-offset * @param[in] zoom The zoom */ - void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal zoom) ; + void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal zoom); /** @brief Sets the default viewport * @param[in] parent the view for which the viewport has to be set */ - void setViewport(GUISUMOAbstractView* view) ; + void setViewport(GUISUMOAbstractView* view); protected: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUISettingsHandler.cpp sumo-0.16.0~dfsg/src/utils/gui/settings/GUISettingsHandler.cpp --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUISettingsHandler.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUISettingsHandler.cpp 2012-11-17 00:02:19.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Jakob Erdmann /// @author Laura Bieker /// @date Fri, 24. Apr 2009 -/// @version $Id: GUISettingsHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUISettingsHandler.cpp 13001 2012-11-16 15:12:43Z behrisch $ /// // The dialog to change the view (gui) settings. /****************************************************************************/ @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "GUISettingsHandler.h" #ifdef CHECK_MEMORY_LEAKS @@ -57,9 +57,8 @@ XMLSubSys::runParser(*this, content); } else { setFileName("registrySettings"); - SAX2XMLReader* reader = XMLSubSys::getSAXReader(*this); - MemBufInputSource memBufIS((const XMLByte*)content.c_str(), content.size(), "registrySettings"); - reader->parse(memBufIS); + SUMOSAXReader* reader = XMLSubSys::getSAXReader(*this); + reader->parseString(content); delete reader; } } @@ -100,29 +99,28 @@ } break; case SUMO_TAG_VIEWSETTINGS_OPENGL: - mySettings.antialiase = TplConvert::_2bool(attrs.getStringSecure("antialiase", toString(mySettings.antialiase)).c_str()); - mySettings.dither = TplConvert::_2bool(attrs.getStringSecure("dither", toString(mySettings.dither)).c_str()); + mySettings.antialiase = TplConvert::_2bool(attrs.getStringSecure("antialiase", toString(mySettings.antialiase)).c_str()); + mySettings.dither = TplConvert::_2bool(attrs.getStringSecure("dither", toString(mySettings.dither)).c_str()); break; case SUMO_TAG_VIEWSETTINGS_BACKGROUND: { bool ok = true; mySettings.backgroundColor = RGBColor::parseColorReporting(attrs.getStringSecure("backgroundColor", toString(mySettings.backgroundColor)), "background", 0, true, ok); - mySettings.showGrid = TplConvert::_2bool(attrs.getStringSecure("showGrid", toString(mySettings.showGrid)).c_str()); - mySettings.gridXSize = TplConvert::_2SUMOReal(attrs.getStringSecure("gridXSize", toString(mySettings.gridXSize)).c_str()); - mySettings.gridYSize = TplConvert::_2SUMOReal(attrs.getStringSecure("gridYSize", toString(mySettings.gridYSize)).c_str()); + mySettings.showGrid = TplConvert::_2bool(attrs.getStringSecure("showGrid", toString(mySettings.showGrid)).c_str()); + mySettings.gridXSize = TplConvert::_2SUMOReal(attrs.getStringSecure("gridXSize", toString(mySettings.gridXSize)).c_str()); + mySettings.gridYSize = TplConvert::_2SUMOReal(attrs.getStringSecure("gridYSize", toString(mySettings.gridYSize)).c_str()); } break; case SUMO_TAG_VIEWSETTINGS_EDGES: { - bool ok = true; - int laneEdgeMode = TplConvert::_2int(attrs.getStringSecure("laneEdgeMode", "0").c_str()); - mySettings.laneShowBorders = TplConvert::_2bool(attrs.getStringSecure("laneShowBorders", toString(mySettings.laneShowBorders)).c_str()); - mySettings.showLinkDecals = TplConvert::_2bool(attrs.getStringSecure("showLinkDecals", toString(mySettings.showLinkDecals)).c_str()); - mySettings.showRails = TplConvert::_2bool(attrs.getStringSecure("showRails", toString(mySettings.showRails)).c_str()); + int laneEdgeMode = TplConvert::_2int(attrs.getStringSecure("laneEdgeMode", "0").c_str()); + mySettings.laneShowBorders = TplConvert::_2bool(attrs.getStringSecure("laneShowBorders", toString(mySettings.laneShowBorders)).c_str()); + mySettings.showLinkDecals = TplConvert::_2bool(attrs.getStringSecure("showLinkDecals", toString(mySettings.showLinkDecals)).c_str()); + mySettings.showRails = TplConvert::_2bool(attrs.getStringSecure("showRails", toString(mySettings.showRails)).c_str()); mySettings.edgeName = parseTextSettings("edgeName", attrs, mySettings.edgeName); mySettings.internalEdgeName = parseTextSettings("internalEdgeName", attrs, mySettings.internalEdgeName); mySettings.streetName = parseTextSettings("streetName", attrs, mySettings.streetName); - mySettings.hideConnectors = TplConvert::_2bool(attrs.getStringSecure("hideConnectors", toString(mySettings.hideConnectors)).c_str()); + mySettings.hideConnectors = TplConvert::_2bool(attrs.getStringSecure("hideConnectors", toString(mySettings.hideConnectors)).c_str()); myCurrentColorer = element; -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL mySettings.edgeColorer.setActive(laneEdgeMode); #endif mySettings.laneColorer.setActive(laneEdgeMode); @@ -132,7 +130,7 @@ myCurrentScheme = 0; if (myCurrentColorer == SUMO_TAG_VIEWSETTINGS_EDGES) { myCurrentScheme = mySettings.laneColorer.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (myCurrentScheme == 0) { myCurrentScheme = mySettings.edgeColorer.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); } @@ -150,8 +148,7 @@ case SUMO_TAG_ENTRY: if (myCurrentScheme) { bool ok = true; - std::string colorStr = attrs.getStringReporting(SUMO_ATTR_COLOR, 0, ok); - RGBColor color = RGBColor::parseColorReporting(colorStr, attrs.getObjectType(), 0, true, ok); + RGBColor color = attrs.getColorReporting(0, ok); if (myCurrentScheme->isFixed()) { myCurrentScheme->setColor(attrs.getStringSecure(SUMO_ATTR_NAME, ""), color); } else { @@ -161,35 +158,35 @@ } break; case SUMO_TAG_VIEWSETTINGS_VEHICLES: - mySettings.vehicleColorer.setActive(TplConvert::_2int(attrs.getStringSecure("vehicleMode", "0").c_str())); - mySettings.vehicleQuality = TplConvert::_2int(attrs.getStringSecure("vehicleQuality", toString(mySettings.vehicleQuality)).c_str()); - mySettings.minVehicleSize = TplConvert::_2SUMOReal(attrs.getStringSecure("minVehicleSize", toString(mySettings.minVehicleSize)).c_str()); - mySettings.vehicleExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("vehicleExaggeration", toString(mySettings.vehicleExaggeration)).c_str()); - mySettings.showBlinker = TplConvert::_2bool(attrs.getStringSecure("showBlinker", toString(mySettings.showBlinker)).c_str()); + mySettings.vehicleColorer.setActive(TplConvert::_2int(attrs.getStringSecure("vehicleMode", "0").c_str())); + mySettings.vehicleQuality = TplConvert::_2int(attrs.getStringSecure("vehicleQuality", toString(mySettings.vehicleQuality)).c_str()); + mySettings.minVehicleSize = TplConvert::_2SUMOReal(attrs.getStringSecure("minVehicleSize", toString(mySettings.minVehicleSize)).c_str()); + mySettings.vehicleExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("vehicleExaggeration", toString(mySettings.vehicleExaggeration)).c_str()); + mySettings.showBlinker = TplConvert::_2bool(attrs.getStringSecure("showBlinker", toString(mySettings.showBlinker)).c_str()); mySettings.vehicleName = parseTextSettings("vehicleName", attrs, mySettings.vehicleName); myCurrentColorer = element; break; case SUMO_TAG_VIEWSETTINGS_JUNCTIONS: - mySettings.junctionMode = TplConvert::_2int(attrs.getStringSecure("junctionMode", toString(mySettings.junctionMode)).c_str()); - mySettings.drawLinkTLIndex = TplConvert::_2bool(attrs.getStringSecure("drawLinkTLIndex", toString(mySettings.drawLinkTLIndex)).c_str()); - mySettings.drawLinkJunctionIndex = TplConvert::_2bool(attrs.getStringSecure("drawLinkJunctionIndex", toString(mySettings.drawLinkJunctionIndex)).c_str()); + mySettings.junctionMode = TplConvert::_2int(attrs.getStringSecure("junctionMode", toString(mySettings.junctionMode)).c_str()); + mySettings.drawLinkTLIndex = TplConvert::_2bool(attrs.getStringSecure("drawLinkTLIndex", toString(mySettings.drawLinkTLIndex)).c_str()); + mySettings.drawLinkJunctionIndex = TplConvert::_2bool(attrs.getStringSecure("drawLinkJunctionIndex", toString(mySettings.drawLinkJunctionIndex)).c_str()); mySettings.junctionName = parseTextSettings("junctionName", attrs, mySettings.junctionName); mySettings.internalJunctionName = parseTextSettings("internalJunctionName", attrs, mySettings.internalJunctionName); - mySettings.showLane2Lane = TplConvert::_2bool(attrs.getStringSecure("showLane2Lane", toString(mySettings.showLane2Lane)).c_str()); + mySettings.showLane2Lane = TplConvert::_2bool(attrs.getStringSecure("showLane2Lane", toString(mySettings.showLane2Lane)).c_str()); break; case SUMO_TAG_VIEWSETTINGS_ADDITIONALS: - mySettings.addMode = TplConvert::_2int(attrs.getStringSecure("addMode", toString(mySettings.addMode)).c_str()); - mySettings.minAddSize = TplConvert::_2SUMOReal(attrs.getStringSecure("minAddSize", toString(mySettings.minAddSize)).c_str()); - mySettings.addExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("addExaggeration", toString(mySettings.addExaggeration)).c_str()); + mySettings.addMode = TplConvert::_2int(attrs.getStringSecure("addMode", toString(mySettings.addMode)).c_str()); + mySettings.minAddSize = TplConvert::_2SUMOReal(attrs.getStringSecure("minAddSize", toString(mySettings.minAddSize)).c_str()); + mySettings.addExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("addExaggeration", toString(mySettings.addExaggeration)).c_str()); mySettings.addName = parseTextSettings("addName", attrs, mySettings.addName); break; case SUMO_TAG_VIEWSETTINGS_POIS: - mySettings.poiExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("poiExaggeration", toString(mySettings.poiExaggeration)).c_str()); - mySettings.minPOISize = TplConvert::_2SUMOReal(attrs.getStringSecure("minPOISize", toString(mySettings.minPOISize)).c_str()); + mySettings.poiExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("poiExaggeration", toString(mySettings.poiExaggeration)).c_str()); + mySettings.minPOISize = TplConvert::_2SUMOReal(attrs.getStringSecure("minPOISize", toString(mySettings.minPOISize)).c_str()); mySettings.poiName = parseTextSettings("poiName", attrs, mySettings.poiName); break; case SUMO_TAG_VIEWSETTINGS_LEGEND: - mySettings.showSizeLegend = TplConvert::_2bool(attrs.getStringSecure("showSizeLegend", toString(mySettings.showSizeLegend)).c_str()); + mySettings.showSizeLegend = TplConvert::_2bool(attrs.getStringSecure("showSizeLegend", toString(mySettings.showSizeLegend)).c_str()); break; case SUMO_TAG_VIEWSETTINGS_DECAL: { GUISUMOAbstractView::Decal d; @@ -197,11 +194,12 @@ if (d.filename != "" && !FileHelpers::isAbsolute(d.filename)) { d.filename = FileHelpers::getConfigurationRelative(getFileName(), d.filename); } - d.centerX = TplConvert::_2SUMOReal(attrs.getStringSecure("centerX", toString(d.centerX)).c_str()); - d.centerY = TplConvert::_2SUMOReal(attrs.getStringSecure("centerY", toString(d.centerY)).c_str()); - d.width = TplConvert::_2SUMOReal(attrs.getStringSecure("width", toString(d.width)).c_str()); - d.height = TplConvert::_2SUMOReal(attrs.getStringSecure("height", toString(d.height)).c_str()); - d.rot = TplConvert::_2SUMOReal(attrs.getStringSecure("rotation", toString(d.rot)).c_str()); + d.centerX = TplConvert::_2SUMOReal(attrs.getStringSecure("centerX", toString(d.centerX)).c_str()); + d.centerY = TplConvert::_2SUMOReal(attrs.getStringSecure("centerY", toString(d.centerY)).c_str()); + d.width = TplConvert::_2SUMOReal(attrs.getStringSecure("width", toString(d.width)).c_str()); + d.height = TplConvert::_2SUMOReal(attrs.getStringSecure("height", toString(d.height)).c_str()); + d.rot = TplConvert::_2SUMOReal(attrs.getStringSecure("rotation", toString(d.rot)).c_str()); + d.layer = TplConvert::_2SUMOReal(attrs.getStringSecure("layer", toString(d.layer)).c_str()); d.initialised = false; myDecals.push_back(d); } @@ -218,8 +216,8 @@ GUIVisualizationTextSettings defaults) { bool ok = true; return GUIVisualizationTextSettings( - TplConvert::_2bool(attrs.getStringSecure(prefix + "_show", toString(defaults.show)).c_str()), - TplConvert::_2SUMOReal(attrs.getStringSecure(prefix + "_size", toString(defaults.size)).c_str()), + TplConvert::_2bool(attrs.getStringSecure(prefix + "_show", toString(defaults.show)).c_str()), + TplConvert::_2SUMOReal(attrs.getStringSecure(prefix + "_size", toString(defaults.size)).c_str()), RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_color", toString(defaults.color)), "edges", 0, true, ok)); } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUISettingsHandler.h sumo-0.16.0~dfsg/src/utils/gui/settings/GUISettingsHandler.h --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUISettingsHandler.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUISettingsHandler.h 2012-09-25 22:01:48.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Fri, 24. Apr 2009 -/// @version $Id: GUISettingsHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUISettingsHandler.h 12502 2012-08-06 05:22:55Z behrisch $ /// // The handler for parsing gui settings from xml. /****************************************************************************/ @@ -48,11 +48,11 @@ /** @brief Constructor * @param[in] file the file to parse */ - GUISettingsHandler(const std::string& content, bool isFile = true) ; + GUISettingsHandler(const std::string& content, bool isFile = true); /// @brief Destructor - ~GUISettingsHandler() ; + ~GUISettingsHandler(); @@ -65,7 +65,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - void myStartElement(int element, const SUMOSAXAttributes& attrs) ; + void myStartElement(int element, const SUMOSAXAttributes& attrs); //@} @@ -73,13 +73,13 @@ /** @brief Adds the parsed settings to the global list of settings * @return the name of the parsed settings */ - std::string addSettings(GUISUMOAbstractView* view = 0) const ; + std::string addSettings(GUISUMOAbstractView* view = 0) const; /** @brief Sets the viewport which has been parsed * @param[in] parent the view for which the viewport has to be set */ - void setViewport(GUISUMOAbstractView* view) const ; + void setViewport(GUISUMOAbstractView* view) const; /** @brief Sets the viewport which has been parsed @@ -87,32 +87,32 @@ * @param[out] xoff Variable to store the loaded x-offset into * @param[out] yoff Variable to store the loaded y-offset into */ - void setViewport(SUMOReal& zoom, SUMOReal& xoff, SUMOReal& yoff) const ; + void setViewport(SUMOReal& zoom, SUMOReal& xoff, SUMOReal& yoff) const; /** @brief Makes a snapshot if it has been parsed * @param[in] parent the view which needs to be shot * @todo Please describe why the snapshots are only set if no other existed before (see code) */ - void setSnapshots(GUISUMOAbstractView* view) const ; + void setSnapshots(GUISUMOAbstractView* view) const; /** @brief Returns whether any decals have been parsed * @return whether decals have been parsed */ - bool hasDecals() const ; + bool hasDecals() const; /** @brief Returns the parsed decals * @return the parsed decals */ - const std::vector& getDecals() const ; + const std::vector& getDecals() const; /** @brief Returns the parsed delay * @return the parsed delay */ - SUMOReal getDelay() const ; + SUMOReal getDelay() const; private: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.cpp sumo-0.16.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.cpp --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.cpp 2012-03-07 00:02:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.cpp 2012-10-25 23:02:23.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVisualizationSettings.cpp 12017 2012-03-06 07:21:24Z namdre $ +/// @version $Id: GUIVisualizationSettings.cpp 12887 2012-10-25 11:58:17Z behrisch $ /// // Stores the information about how to visualize structures /****************************************************************************/ @@ -42,7 +42,7 @@ // =========================================================================== // static members // =========================================================================== -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL bool GUIVisualizationSettings::UseMesoSim = false; #endif @@ -57,7 +57,7 @@ edgeName(false, 50, RGBColor(1, .5, 0)), internalEdgeName(false, 40, RGBColor(.5, .25, 0)), streetName(false, 55, RGBColor(1, 1, 0)), - hideConnectors(false), vehicleQuality(0), + hideConnectors(false), laneWidthExaggeration(1), vehicleQuality(0), minVehicleSize(1), vehicleExaggeration(1), showBlinker(true), drawLaneChangePreference(false), drawMinGap(false), vehicleName(false, 50, RGBColor(.8, .6, 0)), @@ -66,8 +66,8 @@ internalJunctionName(false, 50, RGBColor(0, .8, .5)), showLane2Lane(false), addMode(0), minAddSize(1), addExaggeration(1), addName(false, 50, RGBColor(1., 0, .5)), - poiName(false, 50, RGBColor(1., 0, .5)), minPOISize(0), poiExaggeration(1), + poiName(false, 50, RGBColor(1., 0, .5)), showSizeLegend(true), gaming(false), selectionScale(1) { @@ -128,6 +128,7 @@ /// add vehicle coloring schemes + vehicleColorer.addScheme(GUIColorScheme("given vehicle/type/route color", RGBColor(1, 1, 0), "", true)); vehicleColorer.addScheme(GUIColorScheme("uniform", RGBColor(1, 1, 0), "", true)); vehicleColorer.addScheme(GUIColorScheme("given/assigned vehicle color", RGBColor(1, 1, 0), "", true)); vehicleColorer.addScheme(GUIColorScheme("given/assigned type color", RGBColor(1, 1, 0), "", true)); @@ -175,7 +176,7 @@ vehicleColorer.addScheme(scheme); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /// add edge coloring schemes edgeColorer.addScheme(GUIColorScheme("uniform (streetwise)", RGBColor(0, 0, 0), "", true)); scheme = GUIColorScheme("by selection (streetwise)", RGBColor(0.7f, 0.7f, 0.7f), "unselected", true); @@ -206,7 +207,7 @@ size_t GUIVisualizationSettings::getLaneEdgeMode() const { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (UseMesoSim) { return edgeColorer.getActive(); } @@ -217,7 +218,7 @@ GUIColorScheme& GUIVisualizationSettings::getLaneEdgeScheme() { -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (UseMesoSim) { return edgeColorer.getScheme(); } @@ -243,7 +244,7 @@ << " " << internalEdgeName.print("internalEdgeName") << "\n" << " " << streetName.print("streetName") << ">\n"; laneColorer.save(dev); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL edgeColorer.save(dev); #endif dev << " \n"; @@ -306,7 +307,7 @@ return false; } -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (!(edgeColorer == v2.edgeColorer)) { return false; } @@ -335,7 +336,9 @@ if (hideConnectors != v2.hideConnectors) { return false; } - + if (laneWidthExaggeration != v2.laneWidthExaggeration) { + return false; + } if (!(vehicleColorer == v2.vehicleColorer)) { return false; } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.h sumo-0.16.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.h --- sumo-0.15.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/GUIVisualizationSettings.h 2012-09-25 22:01:48.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVisualizationSettings.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIVisualizationSettings.h 12502 2012-08-06 05:22:55Z behrisch $ /// // Stores the information about how to visualize structures /****************************************************************************/ @@ -85,7 +85,7 @@ public: /// @brief constructor - GUIVisualizationSettings() ; + GUIVisualizationSettings(); /// @brief The name of this setting std::string name; @@ -112,7 +112,7 @@ /// @name lane visualization settings //@{ -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL /// @brief The mesoscopic edge colorer GUIColorer edgeColorer; @@ -131,6 +131,8 @@ GUIVisualizationTextSettings edgeName, internalEdgeName, streetName; bool hideConnectors; + /// @brief The lane exaggeration (upscale thickness) + float laneWidthExaggeration; //@} diff -Nru sumo-0.15.0~dfsg/src/utils/gui/settings/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/settings/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/settings/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/settings/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.cpp sumo-0.16.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.cpp --- sumo-0.15.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIParameterTracker.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIParameterTracker.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A window which displays the time line of one (or more) value(s) /****************************************************************************/ @@ -44,12 +44,7 @@ #include #include #include "GUIParameterTracker.h" - -#ifdef _WIN32 -#include -#endif - -#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -133,7 +128,7 @@ void -GUIParameterTracker::addTracked(GUIGlObject& o, ValueSource *src, +GUIParameterTracker::addTracked(GUIGlObject& o, ValueSource* src, TrackerValueDesc* newTracked) { myTracked.push_back(newTracked); // build connection (is automatically set into an execution map) @@ -239,7 +234,7 @@ } dev.close(); } catch (IOError& e) { - FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); + FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); } return 1; } @@ -325,7 +320,7 @@ glVertex2d(2.0, ypos); glEnd(); } - const std::vector &values = desc.getAggregatedValues(); + const std::vector& values = desc.getAggregatedValues(); SUMOReal latest = 0; if (values.size() < 2) { glPopMatrix(); diff -Nru sumo-0.15.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.h sumo-0.16.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.h --- sumo-0.15.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/tracker/GUIParameterTracker.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIParameterTracker.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIParameterTracker.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A window which displays the time line of one (or more) value(s) /****************************************************************************/ @@ -64,11 +64,11 @@ * @param[in] app The main application window * @param[in] name The title of the tracker */ - GUIParameterTracker(GUIMainWindow& app, const std::string& name) ; + GUIParameterTracker(GUIMainWindow& app, const std::string& name); /// @brief Destructor - ~GUIParameterTracker() ; + ~GUIParameterTracker(); /// @brief Creates the window @@ -80,8 +80,8 @@ * @param[in] src The value source of the object * @param[in] newTracked The description of the tracked value */ - void addTracked(GUIGlObject& o, ValueSource *src, - TrackerValueDesc* newTracked) ; + void addTracked(GUIGlObject& o, ValueSource* src, + TrackerValueDesc* newTracked); /// @name FOX-callbacks @@ -120,10 +120,10 @@ * @param[in] parent The parent tracker window this view belongs to */ GUIParameterTrackerPanel(FXComposite* c, GUIMainWindow& app, - GUIParameterTracker& parent) ; + GUIParameterTracker& parent); /// @brief Destructor - ~GUIParameterTrackerPanel() ; + ~GUIParameterTrackerPanel(); /// @brief needed to update friend class GUIParameterTracker; @@ -146,13 +146,13 @@ private: /** @brief Draws all values */ - void drawValues() ; + void drawValues(); /** @brief Draws a single value * @param[in] desc The tracked values to draw * @param[in] namePos Position to display the name at (currently unused) */ - void drawValue(TrackerValueDesc& desc, SUMOReal namePos) ; + void drawValue(TrackerValueDesc& desc, SUMOReal namePos); private: @@ -176,7 +176,7 @@ private: /// @brief Builds the tool bar - void buildToolBar() ; + void buildToolBar(); protected: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/tracker/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/tracker/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/tracker/Makefile.in 2012-03-14 00:11:53.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/tracker/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -101,6 +101,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -131,6 +132,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -165,6 +167,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -198,7 +201,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.cpp sumo-0.16.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.cpp --- sumo-0.15.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: TrackerValueDesc.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TrackerValueDesc.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for a tracked value /****************************************************************************/ @@ -69,7 +69,7 @@ myMin = value < myMin ? value : myMin; myMax = value > myMax ? value : myMax; } - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); myValues.push_back(value); if (value != myInvalidValue) { myTmpLastAggValue += value; @@ -85,7 +85,6 @@ myTmpLastAggValue = 0; myValidNo = 0; } - myLock.unlock(); } @@ -119,14 +118,14 @@ } -const std::vector & +const std::vector& TrackerValueDesc::getValues() { myLock.lock(); return myValues; } -const std::vector & +const std::vector& TrackerValueDesc::getAggregatedValues() { myLock.lock(); return myAggregatedValues; @@ -146,7 +145,7 @@ void TrackerValueDesc::setAggregationSpan(SUMOTime as) { - myLock.lock(); + AbstractMutex::ScopedLocker locker(myLock); if (myAggregationInterval != as / DELTA_T) { myAggregationInterval = as / DELTA_T; // ok, the aggregation has changed, @@ -169,7 +168,6 @@ } } } - myLock.unlock(); } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.h sumo-0.16.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.h --- sumo-0.15.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/tracker/TrackerValueDesc.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: TrackerValueDesc.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: TrackerValueDesc.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Representation of a timeline of floats with their names and moments /****************************************************************************/ @@ -75,12 +75,12 @@ /** @brief returns the vector of collected values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called */ - const std::vector &getValues(); + const std::vector& getValues(); /** @brief returns the vector of aggregated values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called */ - const std::vector &getAggregatedValues(); + const std::vector& getAggregatedValues(); /// Returns the name of the value const std::string& getName() const; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIAppEnum.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIAppEnum.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIAppEnum.h 2012-03-06 00:02:12.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIAppEnum.h 2012-11-17 00:02:19.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Mon, 08.03.2004 -/// @version $Id: GUIAppEnum.h 12011 2012-03-05 09:41:30Z namdre $ +/// @version $Id: GUIAppEnum.h 12996 2012-11-16 11:42:35Z namdre $ /// // Message and object IDs used by the FOX-version of the gui /****************************************************************************/ @@ -163,8 +163,10 @@ MID_LOCATETLS, /// Locate addtional structure - button MID_LOCATEADD, - /// Locate shape - button - MID_LOCATESHAPE, + /// Locate poi - button + MID_LOCATEPOI, + /// Locate polygons - button + MID_LOCATEPOLY, /// Open viewport editor - button MID_EDITVIEWPORT, /// Open view editor - button @@ -363,6 +365,7 @@ /// processing menu messages MID_GNE_COMPUTE_JUNCTIONS, + MID_GNE_CLEAN_JUNCTIONS, MID_GNE_JOIN_JUNCTIONS, MID_GNE_OPTIONS, @@ -386,12 +389,14 @@ MID_GNE_NEW_NETWORK, MID_GNE_OPEN_FOREIGN, MID_GNE_VIS_HEIGHT, + MID_GNE_LOAD_POIS, // MID_GNE_WIZARD, /** save network*/ MID_GNE_SAVE_NETWORK, MID_GNE_SAVE_AS_NETWORK, MID_GNE_SAVE_PLAIN_XML, MID_GNE_SAVE_JOINED, + MID_GNE_SAVE_POIS, /** insert contents of another network */ MID_GNE_INSERT_NETWORK, /** attribute edited */ @@ -400,6 +405,10 @@ MID_GNE_OPEN_ATTRIBUTE_EDITOR, /** split an edge */ MID_GNE_SPLIT_EDGE, + /** set non-default geometry endpoint */ + MID_GNE_SET_EDGE_ENDPOINT, + /** restore geometry endpoint to node position */ + MID_GNE_RESET_EDGE_ENDPOINT, /** set object as template*/ MID_GNE_SET_TEMPLATE, /** copy template*/ @@ -410,6 +419,8 @@ MID_GNE_SELECT_DEAD_STARTS, /** select lanes that are connected from concurrent lanes */ MID_GNE_SELECT_CONFLICTS, + /** select lanes with connections that have the pass attribute set to 'true' */ + MID_GNE_SELECT_PASS, /** changes the visual scaling of selected items */ MID_GNE_SELECT_SCALE, diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2012-09-25 22:01:50.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDanielPerspectiveChanger.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDanielPerspectiveChanger.cpp 12402 2012-06-20 06:47:55Z dkrajzew $ /// // A class that allows to steer the visual output in dependence to /****************************************************************************/ @@ -82,11 +82,13 @@ void -GUIDanielPerspectiveChanger::rotate(int diff) { - if (false) {//myCallback.allowRotation()) { +GUIDanielPerspectiveChanger::rotate(int /* diff */) { + /* + if (myCallback.allowRotation()) { myRotation += (SUMOReal) diff / (SUMOReal) 10.0; myCallback.update(); } + */ } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2012-09-25 22:01:50.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDanielPerspectiveChanger.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDanielPerspectiveChanger.h 12402 2012-06-20 06:47:55Z dkrajzew $ /// // A class that allows to steer the visual output in dependence to /****************************************************************************/ @@ -139,6 +139,15 @@ /// avoid flicker FXTime myDragDelay; FXTime myMouseDownTime; + + +private: + /// @brief Invalidated copy constructor. + GUIDanielPerspectiveChanger(const GUIDanielPerspectiveChanger&); + + /// @brief Invalidated assignment operator. + GUIDanielPerspectiveChanger& operator=(const GUIDanielPerspectiveChanger&); + }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.cpp sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.cpp --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2012-01-15 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2012-09-25 22:01:50.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Laura Bieker /// @date Mon, 25.04.2005 -/// @version $Id: GUIDialog_EditViewport.cpp 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUIDialog_EditViewport.cpp 12286 2012-05-01 20:36:24Z behrisch $ /// // A dialog to change the viewport /****************************************************************************/ @@ -182,7 +182,7 @@ dev << "\n"; dev.close(); } catch (IOError& e) { - FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); + FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); } return 1; } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_EditViewport.h 2012-09-25 22:01:50.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-05-04 -/// @version $Id: GUIDialog_EditViewport.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_EditViewport.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A dialog to change the viewport /****************************************************************************/ @@ -72,11 +72,11 @@ * @param[in] y y-position to show the dialog at */ GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name, - SUMOReal zoom, SUMOReal xoff, SUMOReal yoff, int x, int y) ; + SUMOReal zoom, SUMOReal xoff, SUMOReal yoff, int x, int y); /// @brief Destructor - ~GUIDialog_EditViewport() ; + ~GUIDialog_EditViewport(); @@ -106,7 +106,7 @@ * @param[in] xoff Current view's x-offset * @param[in] yoff Current view's y-offset */ - void setValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff) ; + void setValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff); /** @brief Resets old values @@ -114,13 +114,13 @@ * @param[in] xoff Current view's x-offset * @param[in] yoff Current view's y-offset */ - void setOldValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff) ; + void setOldValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff); /** @brief Returns the information whether one of the spin dialers is grabbed * @return Whether the spin dialers are currently used */ - bool haveGrabbed() const ; + bool haveGrabbed() const; protected: diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2012-02-14 00:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDialog_GLObjChooser.cpp 11887 2012-02-13 16:22:24Z namdre $ +/// @version $Id: GUIDialog_GLObjChooser.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ @@ -43,12 +43,6 @@ #include #include "GUIDialog_GLObjChooser.h" -#ifdef _WIN32 -#include -#endif - -#include - #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -77,7 +71,7 @@ FXIcon* icon, const FXString& title, GUIGlObjectType type, - const std::vector &ids, + const std::vector& ids, GUIGlObjectStorage& glStorage): FXMainWindow(parent->getApp(), title, icon, NULL, DECOR_ALL, 20, 20, 300, 300), myObjectType(type), @@ -194,7 +188,7 @@ } } myList->clearItems(); - const int numSelected = selectedGlIDs.size(); + const int numSelected = (const int)selectedGlIDs.size(); for (int i = 0; i < numSelected; i++) { myList->appendItem(selectedMicrosimIDs[i], flag, (void*) & (*myIDs.find(selectedGlIDs[i]))); } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2012-02-14 00:02:09.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDialog_GLObjChooser.h 11887 2012-02-13 16:22:24Z namdre $ +/// @version $Id: GUIDialog_GLObjChooser.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ @@ -70,12 +70,12 @@ */ GUIDialog_GLObjChooser(GUIGlChildWindow* parent, FXIcon* icon, const FXString& title, GUIGlObjectType type, - const std::vector &ids, + const std::vector& ids, GUIGlObjectStorage& glStorage); /// @brief Destructor - ~GUIDialog_GLObjChooser() ; + ~GUIDialog_GLObjChooser(); /** @brief Returns the chosen (selected) object diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.cpp sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.cpp --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Wed, 21. Dec 2005 -/// @version $Id: GUIDialog_ViewSettings.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_ViewSettings.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The dialog to change the view (gui) settings. /****************************************************************************/ @@ -81,18 +81,22 @@ FXIMPLEMENT(GUIDialog_ViewSettings, FXDialogBox, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap)) +// =========================================================================== +// static members +// =========================================================================== +unsigned int GUIDialog_ViewSettings::myCustomSchemes = 0; + // =========================================================================== // method definitions // =========================================================================== -GUIDialog_ViewSettings::GUIDialog_ViewSettings( - GUISUMOAbstractView* parent, - GUIVisualizationSettings* settings, - std::vector *decals, - MFXMutex* decalsLock) - : FXDialogBox(parent, "View Settings", DECOR_TITLE | DECOR_BORDER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - myParent(parent), mySettings(settings), - myDecals(decals), myDecalsLock(decalsLock), myDecalsTable(0) { +GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent, + GUIVisualizationSettings* settings, + std::vector* decals, + MFXMutex* decalsLock) : + FXDialogBox(parent, "View Settings", DECOR_TITLE | DECOR_BORDER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), + myParent(parent), mySettings(settings), + myDecals(decals), myDecalsLock(decalsLock), myDecalsTable(0) { myBackup = (*mySettings); FXVerticalFrame* contentFrame = @@ -103,7 +107,7 @@ FXHorizontalFrame* frame0 = new FXHorizontalFrame(contentFrame, FRAME_THICK, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); mySchemeName = new FXComboBox(frame0, 20, this, MID_SIMPLE_VIEW_NAMECHANGE, COMBOBOX_INSERT_LAST | FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_CENTER_Y | COMBOBOX_STATIC); - const std::vector &names = gSchemeStorage.getNames(); + const std::vector& names = gSchemeStorage.getNames(); for (std::vector::const_iterator i = names.begin(); i != names.end(); ++i) { size_t index = mySchemeName->appendItem((*i).c_str()); if ((*i) == mySettings->name) { @@ -200,13 +204,13 @@ myLaneColorSettingFrame = new FXVerticalFrame(genScroll, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); //we should insert a FXScrollWindow around the frame2 -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (GUIVisualizationSettings::UseMesoSim) { mySettings->edgeColorer.fill(*myLaneEdgeColorMode); } else { #endif mySettings->laneColorer.fill(*myLaneEdgeColorMode); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif @@ -226,6 +230,13 @@ myHideMacroConnectors = new FXCheckButton(m22, "Hide macro connectors", this, MID_SIMPLE_VIEW_COLORCHANGE); myHideMacroConnectors->setCheck(mySettings->hideConnectors); new FXLabel(m22, " ", 0, LAYOUT_CENTER_Y); + new FXLabel(m22, "Exaggerate width by", 0, LAYOUT_CENTER_Y); + myLaneWidthUpscaleDialer = + new FXRealSpinDial(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, + LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); + myLaneWidthUpscaleDialer->setRange(0, 10000); + myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration); + // edge name myEdgeNamePanel = new NamePanel(m22, this, "Show edge name", mySettings->edgeName); myStreetNamePanel = new NamePanel(m22, this, "Show street name", mySettings->streetName); @@ -244,7 +255,8 @@ myVehicleShapeDetail->appendItem("'triangles'"); myVehicleShapeDetail->appendItem("'boxes'"); myVehicleShapeDetail->appendItem("'simple shapes'"); - myVehicleShapeDetail->setNumVisible(3); + myVehicleShapeDetail->appendItem("'raster images'"); + myVehicleShapeDetail->setNumVisible(4); myVehicleShapeDetail->setCurrentItem(settings->vehicleQuality); new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X); @@ -306,7 +318,7 @@ myVehicleUpscaleDialer = new FXRealSpinDial(m342, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myVehicleUpscaleDialer->setRange(1, 100); + myVehicleUpscaleDialer->setRange(0, 10000); myVehicleUpscaleDialer->setValue(mySettings->vehicleExaggeration); } { new FXTabItem(tabbook, "Nodes", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); @@ -356,7 +368,7 @@ myDetectorUpscaleDialer = new FXRealSpinDial(m522, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myDetectorUpscaleDialer->setRange(1, 100); + myDetectorUpscaleDialer->setRange(0, 10000); myDetectorUpscaleDialer->setValue(mySettings->addExaggeration); @@ -396,7 +408,7 @@ myPOIUpscaleDialer = new FXRealSpinDial(m622, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myPOIUpscaleDialer->setRange(1, 1000); + myPOIUpscaleDialer->setRange(0, 10000); myPOIUpscaleDialer->setValue(mySettings->addExaggeration); @@ -497,6 +509,7 @@ myInternalEdgeNamePanel->update(mySettings->internalEdgeName); myStreetNamePanel->update(mySettings->streetName); myHideMacroConnectors->setCheck(mySettings->hideConnectors); + myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration); myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive()); myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality); @@ -547,13 +560,13 @@ tmpSettings.gridXSize = (SUMOReal) myGridXSizeDialer->getValue(); tmpSettings.gridYSize = (SUMOReal) myGridYSizeDialer->getValue(); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL if (GUIVisualizationSettings::UseMesoSim) { tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem()); } else { #endif tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem()); -#ifdef HAVE_MESOSIM +#ifdef HAVE_INTERNAL } #endif tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE); @@ -563,6 +576,7 @@ tmpSettings.internalEdgeName = myInternalEdgeNamePanel->getSettings(); tmpSettings.streetName = myStreetNamePanel->getSettings(); tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE); + tmpSettings.laneWidthExaggeration = (SUMOReal) myLaneWidthUpscaleDialer->getValue(); tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem()); tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem(); @@ -710,24 +724,25 @@ return 1; } - if (tmpSettings.name[0] != '*') { - tmpSettings.name = '*' + tmpSettings.name; - } - gSchemeStorage.add(tmpSettings); int index = mySchemeName->getCurrentItem(); if (index < (int) gSchemeStorage.getNumInitialSettings()) { + // one of the initial settings is modified + // every time this happens we create a new scheme + ++myCustomSchemes; // 1-based counting for the masses + tmpSettings.name = "custom_" + toString(myCustomSchemes); + // the newly created settings must be entered in several places: + // - the comboBox mySchemeName of this dialog + // - the comboBox of the parent view (set as active) + // - the comboBox of all other views (only append) XXX @todo index = mySchemeName->appendItem(tmpSettings.name.c_str()); - gSchemeStorage.add(tmpSettings); mySchemeName->setCurrentItem(index); myParent->getColoringSchemesCombo().appendItem(tmpSettings.name.c_str()); - myParent->getColoringSchemesCombo().setCurrentItem(index); - myParent->setColorScheme(tmpSettings.name); - } else { - mySchemeName->setItemText(index, tmpSettings.name.c_str()); - myParent->getColoringSchemesCombo().setItemText(index, tmpSettings.name.c_str()); - myParent->setColorScheme(tmpSettings.name); } + myParent->getColoringSchemesCombo().setCurrentItem( + myParent->getColoringSchemesCombo().findItem(tmpSettings.name.c_str())); + gSchemeStorage.add(tmpSettings); // overwrites existing mySettings = &gSchemeStorage.get(tmpSettings.name); + myParent->setColorScheme(tmpSettings.name); if (doRebuildColorMatrices) { rebuildColorMatrices(true); @@ -764,12 +779,13 @@ << "\" width=\"" << d.width << "\" height=\"" << d.height << "\" rotation=\"" << d.rot + << "\" layer=\"" << d.layer << "\"/>\n"; } dev << "\n"; dev.close(); } catch (IOError& e) { - FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", e.what()); + FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what()); } } @@ -794,7 +810,8 @@ return 1; } // get the name - while (true) { + std::string name = ""; + while (name.length() == 0) { FXDialogBox dialog(this, "Enter a name", DECOR_TITLE | DECOR_BORDER); FXVerticalFrame* content = new FXVerticalFrame(&dialog, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10); new FXLabel(content, "Please enter an alphanumeric name: ", NULL, LAYOUT_FILL_X | JUSTIFY_LEFT); @@ -805,34 +822,27 @@ new FXButton(buttons, "&Cancel", NULL, &dialog, FXDialogBox::ID_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT, 0, 0, 0, 0, 20, 20); dialog.create(); text->setFocus(); - if (dialog.execute()) { - std::string name = text->getText().text(); - bool isAlphaNum = true; - for (size_t i = 0; i < name.length(); ++i) { - if (name[i] == '_' || (name[i] >= 'a' && name[i] <= 'z') || (name[i] >= 'A' && name[i] <= 'Z') || (name[i] >= '0' && name[i] <= '9')) { - continue; - } - isAlphaNum = false; - } - isAlphaNum = isAlphaNum & (name.length() > 0); - if (isAlphaNum) { - GUIVisualizationSettings tmpSettings = *mySettings; - gSchemeStorage.remove(mySettings->name); - tmpSettings.name = name; - gSchemeStorage.add(tmpSettings); - mySchemeName->setItemText(index, tmpSettings.name.c_str()); - myParent->getColoringSchemesCombo().setItemText(index, tmpSettings.name.c_str()); - myParent->setColorScheme(tmpSettings.name); - mySettings = &gSchemeStorage.get(name); - myBackup = *mySettings; - gSchemeStorage.writeSettings(getApp()); - return 1; - } - } else { + if (!dialog.execute()) { return 1; } + name = text->getText().text(); + for (size_t i = 0; i < name.length(); ++i) { + if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) { + name = ""; + break; + } + } } - // save + GUIVisualizationSettings tmpSettings = *mySettings; + gSchemeStorage.remove(mySettings->name); + tmpSettings.name = name; + gSchemeStorage.add(tmpSettings); + mySchemeName->setItemText(index, tmpSettings.name.c_str()); + myParent->getColoringSchemesCombo().setItemText(index, tmpSettings.name.c_str()); + myParent->setColorScheme(tmpSettings.name); + mySettings = &gSchemeStorage.get(name); + myBackup = *mySettings; + gSchemeStorage.writeSettings(getApp()); return 1; } @@ -889,7 +899,7 @@ mySettings->save(dev); dev.close(); } catch (IOError& e) { - FXMessageBox::error(this, MBOX_OK, "Storing failed!", e.what()); + FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); } return 1; } @@ -984,17 +994,18 @@ GUIDialog_ViewSettings::rebuildList() { myDecalsTable->clearItems(); // set table attributes - myDecalsTable->setTableSize(10, 6); + myDecalsTable->setTableSize(10, 7); myDecalsTable->setColumnText(0, "picture file"); myDecalsTable->setColumnText(1, "center x"); myDecalsTable->setColumnText(2, "center y"); myDecalsTable->setColumnText(3, "width"); myDecalsTable->setColumnText(4, "height"); myDecalsTable->setColumnText(5, "rotation"); + myDecalsTable->setColumnText(6, "layer"); FXHeader* header = myDecalsTable->getColumnHeader(); header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent()); int k; - for (k = 0; k < 6; k++) { + for (k = 0; k < 7; k++) { header->setItemJustify(k, JUSTIFY_CENTER_X | JUSTIFY_TOP); header->setItemSize(k, 60); } @@ -1010,10 +1021,11 @@ myDecalsTable->setItemText(row, 3, toString(d.width).c_str()); myDecalsTable->setItemText(row, 4, toString(d.height).c_str()); myDecalsTable->setItemText(row, 5, toString(d.rot).c_str()); + myDecalsTable->setItemText(row, 6, toString(d.layer).c_str()); row++; } // insert dummy last field - for (k = 0; k < 6; k++) { + for (k = 0; k < 7; k++) { myDecalsTable->setItemText(row, k, " "); } } @@ -1026,16 +1038,14 @@ myDecalsTable = new MFXAddEditTypedTable(myDecalsFrame, this, MID_TABLE, LAYOUT_FILL_Y | LAYOUT_FIX_WIDTH/*|LAYOUT_FIX_HEIGHT*/, 0, 0, 470, 0); myDecalsTable->setVisibleRows(5); - myDecalsTable->setVisibleColumns(6); - myDecalsTable->setTableSize(5, 6); + myDecalsTable->setVisibleColumns(7); + myDecalsTable->setTableSize(5, 7); myDecalsTable->setBackColor(FXRGB(255, 255, 255)); myDecalsTable->getRowHeader()->setWidth(0); - for (int i = 1; i < 5; ++i) { + for (int i = 1; i <= 5; ++i) { myDecalsTable->setCellType(i, CT_REAL); myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f"); } - myDecalsTable->setCellType(5, CT_REAL); - myDecalsTable->setNumberCellParams(5, -10000000, 10000000, .1, 1, 10, "%.2f"); rebuildList(); if (doCreate) { myDecalsTable->create(); @@ -1051,7 +1061,7 @@ myLaneButtons.clear(); GUIColorScheme& scheme = mySettings->getLaneEdgeScheme(); const bool fixed = scheme.isFixed(); - const std::vector &colors = scheme.getColors(); + const std::vector& colors = scheme.getColors(); std::vector::const_iterator colIt = colors.begin(); std::vector::const_iterator threshIt = scheme.getThresholds().begin(); std::vector::const_iterator nameIt = scheme.getNames().begin(); @@ -1107,7 +1117,7 @@ myVehicleThresholds.clear(); myVehicleButtons.clear(); const bool fixed = mySettings->vehicleColorer.getScheme().isFixed(); - const std::vector &colors = mySettings->vehicleColorer.getScheme().getColors(); + const std::vector& colors = mySettings->vehicleColorer.getScheme().getColors(); std::vector::const_iterator colIt = colors.begin(); std::vector::const_iterator threshIt = mySettings->vehicleColorer.getScheme().getThresholds().begin(); std::vector::const_iterator nameIt = mySettings->vehicleColorer.getScheme().getNames().begin(); @@ -1178,6 +1188,7 @@ d.height = SUMOReal(myParent->getGridHeight()); d.initialised = false; d.rot = 0; + d.layer = 0; myDecalsLock->lock(); myDecals->push_back(d); myDecalsLock->unlock(); @@ -1197,42 +1208,50 @@ break; case 1: try { - d.centerX = TplConvert::_2SUMOReal(value.c_str()); + d.centerX = TplConvert::_2SUMOReal(value.c_str()); } catch (NumberFormatException&) { std::string msg = "The value must be a float, is:" + value; - FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); } break; case 2: try { - d.centerY = TplConvert::_2SUMOReal(value.c_str()); + d.centerY = TplConvert::_2SUMOReal(value.c_str()); } catch (NumberFormatException&) { std::string msg = "The value must be a float, is:" + value; - FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); } break; case 3: try { - d.width = TplConvert::_2SUMOReal(value.c_str()); + d.width = TplConvert::_2SUMOReal(value.c_str()); } catch (NumberFormatException&) { std::string msg = "The value must be a float, is:" + value; - FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); } break; case 4: try { - d.height = TplConvert::_2SUMOReal(value.c_str()); + d.height = TplConvert::_2SUMOReal(value.c_str()); } catch (NumberFormatException&) { std::string msg = "The value must be a float, is:" + value; - FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); } break; case 5: try { - d.rot = TplConvert::_2SUMOReal(value.c_str()); + d.rot = TplConvert::_2SUMOReal(value.c_str()); + } catch (NumberFormatException&) { + std::string msg = "The value must be a float, is:" + value; + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); + } + break; + case 6: + try { + d.layer = TplConvert::_2SUMOReal(value.c_str()); } catch (NumberFormatException&) { std::string msg = "The value must be a float, is:" + value; - FXMessageBox::error(this, MBOX_OK, "Number format error", msg.c_str()); + FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str()); } break; default: @@ -1284,7 +1303,7 @@ mySizeDial->setValue(settings.size); FXMatrix* m2 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - FXLabel(m2, "Color", 0, LAYOUT_CENTER_Y); + new FXLabel(m2, "Color", 0, LAYOUT_CENTER_Y); myColorWell = new FXColorWell(m2, convert(settings.color), target, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | LAYOUT_SIDE_TOP | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT, diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 21. Dec 2005 -/// @version $Id: GUIDialog_ViewSettings.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIDialog_ViewSettings.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The dialog to change the view (gui) settings. /****************************************************************************/ @@ -82,18 +82,18 @@ */ GUIDialog_ViewSettings(GUISUMOAbstractView* parent, GUIVisualizationSettings* settings, - std::vector *decals, - MFXMutex* decalsLock) ; + std::vector* decals, + MFXMutex* decalsLock); /// @brief Destructor - ~GUIDialog_ViewSettings() ; + ~GUIDialog_ViewSettings(); /** @brief Sets current settings (called if reopened) * @param[in, out] settings The current settings that can be changed */ - void setCurrent(GUIVisualizationSettings* settings) ; + void setCurrent(GUIVisualizationSettings* settings); @@ -146,13 +146,13 @@ /** @brief Returns the name of the currently chosen scheme * @return The name of the edited (chosen) scheme) */ - std::string getCurrentScheme() const ; + std::string getCurrentScheme() const; /** @brief Sets the named scheme as the current * @param[in] The name of the scheme that shall be set as current */ - void setCurrentScheme(const std::string&) ; + void setCurrentScheme(const std::string&); /** @brief Converts a FOX-color into a RGBColor @@ -174,32 +174,35 @@ /** @brief Rebuilds color changing dialogs after choosing another coloring scheme * @param[in] doCreate Whether "create" shall be called (only if built the first time) */ - void rebuildColorMatrices(bool doCreate = false) ; + void rebuildColorMatrices(bool doCreate = false); /** @brief Rebuilds the decals table */ - void rebuildList() ; + void rebuildList(); /** @brief Loads a scheme from a file * @param[in] file The name of the file to read the settings from */ - void loadSettings(const std::string& file) ; + void loadSettings(const std::string& file); /** @brief Writes the currently used decals into a file * @param[in] file The name of the file to write the decals into */ - void saveDecals(const std::string& file) const ; + void saveDecals(const std::string& file) const; /** @brief Loads decals from a file * @param[in] file The name of the file to read the decals from */ - void loadDecals(const std::string& file) ; + void loadDecals(const std::string& file); private: + /// @brief the number of newly created custom schemes + static unsigned int myCustomSchemes; + /// @brief The parent view (which settings are changed) GUISUMOAbstractView* myParent; @@ -210,12 +213,11 @@ GUIVisualizationSettings myBackup; /// @brief The parent's decals - std::vector *myDecals; + std::vector* myDecals; /// @brief Lock used when changing the decals MFXMutex* myDecalsLock; - /// @name Dialog elements /// @{ FXComboBox* mySchemeName; @@ -235,6 +237,7 @@ FXCheckButton* myShowLaneBorders, *myShowLaneDecals, *myShowRails, *myHideMacroConnectors; + FXRealSpinDial* myLaneWidthUpscaleDialer; FXComboBox* myVehicleColorMode, *myVehicleShapeDetail; FXVerticalFrame* myVehicleColorSettingFrame; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIMainWindow.cpp sumo-0.16.0~dfsg/src/utils/gui/windows/GUIMainWindow.cpp --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIMainWindow.cpp 2012-01-15 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIMainWindow.cpp 2012-10-15 23:02:47.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: GUIMainWindow.cpp 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUIMainWindow.cpp 12837 2012-10-15 13:55:42Z namdre $ /// // /****************************************************************************/ @@ -31,11 +31,15 @@ #endif #include -#include "GUIMainWindow.h" #include -#include "GUIAppEnum.h" +#include #include +#include +#include #include +#include +#include "GUIAppEnum.h" +#include "GUIMainWindow.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -43,11 +47,16 @@ // =========================================================================== +// static member definitions +// =========================================================================== +GUIMainWindow* GUIMainWindow::myInstance = 0; + +// =========================================================================== // member method definitions // =========================================================================== GUIMainWindow::GUIMainWindow(FXApp* a) : FXMainWindow(a, "SUMO-gui main window", NULL, NULL, DECOR_ALL, 20, 20, 600, 400), - myGLVisual(new FXGLVisual(a, VISUAL_DOUBLEBUFFER | VISUAL_STEREO)), + myGLVisual(new FXGLVisual(a, VISUAL_DOUBLEBUFFER)), myAmGaming(false), myListInternal(false) { FXFontDesc fdesc; @@ -59,6 +68,10 @@ myBottomDock = new FXDockSite(this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X); myLeftDock = new FXDockSite(this, LAYOUT_SIDE_LEFT | LAYOUT_FILL_Y); myRightDock = new FXDockSite(this, LAYOUT_SIDE_RIGHT | LAYOUT_FILL_Y); + if (myInstance != 0) { + throw ProcessError("MainWindow initialized twice"); + } + myInstance = this; } @@ -161,5 +174,15 @@ return *myGeoCoordinate; } + +GUIMainWindow* +GUIMainWindow::getInstance() { + if (myInstance != 0) { + return myInstance; + } + throw ProcessError("A GUIMainWindow instance was not yet constructed."); +} + + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIMainWindow.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIMainWindow.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIMainWindow.h 2012-01-15 00:02:16.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIMainWindow.h 2012-10-15 23:02:47.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GUIMainWindow.h 11719 2012-01-14 21:45:05Z behrisch $ +/// @version $Id: GUIMainWindow.h 12837 2012-10-15 13:55:42Z namdre $ /// // /****************************************************************************/ @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -54,8 +55,8 @@ void removeChild(FXMDIChild* child); void removeChild(FXMainWindow* child); - std::vector getViewIDs() const ; - FXMDIChild* getViewByID(const std::string& id) const ; + std::vector getViewIDs() const; + FXMDIChild* getViewByID(const std::string& id) const; void updateChildren(); @@ -82,6 +83,8 @@ return myListInternal; } + static GUIMainWindow* getInstance(); + protected: std::vector mySubWindows; std::vector myTrackerWindows; @@ -113,6 +116,9 @@ /// information whether the locator should list internal structures bool myListInternal; + /// the singleton window instance + static GUIMainWindow* myInstance; + protected: GUIMainWindow() { } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUIPerspectiveChanger.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUIPerspectiveChanger.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUIPerspectiveChanger.h 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUIPerspectiveChanger.h 2012-09-25 22:01:50.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIPerspectiveChanger.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUIPerspectiveChanger.h 12402 2012-06-20 06:47:55Z dkrajzew $ /// // A virtual class that allows to steer the visual output in dependence to /****************************************************************************/ @@ -139,9 +139,20 @@ /// @brief the intended viewport Boundary myViewPort; + private: // patched viewPort with the same aspect ratio as the canvas Boundary patchedViewPort(); + + +private: + /// @brief Invalidated copy constructor. + GUIPerspectiveChanger(const GUIPerspectiveChanger&); + + /// @brief Invalidated assignment operator. + GUIPerspectiveChanger& operator=(const GUIPerspectiveChanger&); + + }; diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.cpp sumo-0.16.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.cpp --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.cpp 2012-01-07 20:14:55.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Laura Bieker /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOAbstractView.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GUISUMOAbstractView.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // The base class for a view /****************************************************************************/ @@ -32,17 +32,12 @@ #include #endif -#ifdef _WIN32 -#include -#endif - #include #include #include #include +#include #include -#include -#include #include #include #include @@ -59,13 +54,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include "GUISUMOAbstractView.h" #include "GUIMainWindow.h" @@ -74,7 +69,6 @@ #include "GUIDialog_EditViewport.h" #ifdef WIN32 -#include #endif #ifdef CHECK_MEMORY_LEAKS @@ -147,6 +141,10 @@ delete myChanger; delete myViewportChooser; delete myVisualizationChanger; + // cleanup decals + for (std::vector::iterator it = myDecals.begin(); it != myDecals.end(); ++it) { + delete it->image; + } } @@ -263,7 +261,7 @@ const std::vector ids = getObjectsInBoundary(selection); // Interpret results unsigned int idMax = 0; - int prevLayer = -1000; + SUMOReal maxLayer = std::numeric_limits::min(); for (std::vector::const_iterator it = ids.begin(); it != ids.end(); it++) { GUIGlID id = *it; GUIGlObject* o = GUIGlObjectStorage::gIDStorage.getObjectBlocking(id); @@ -276,32 +274,17 @@ //std::cout << "point selection hit " << o->getMicrosimID() << "\n"; GUIGlObjectType type = o->getType(); if (type != 0) { - int clayer = (int) type; + SUMOReal layer = (SUMOReal)type; // determine an "abstract" layer for shapes // this "layer" resembles the layer of the shape // taking into account the stac of other objects - if (type == GLO_SHAPE) { - if (dynamic_cast(o) != 0) { - if (dynamic_cast(o)->getLayer() > 0) { - clayer = GLO_MAX + dynamic_cast(o)->getLayer(); - } - if (dynamic_cast(o)->getLayer() < 0) { - clayer = dynamic_cast(o)->getLayer(); - } - } - if (dynamic_cast(o) != 0) { - if (dynamic_cast(o)->getLayer() > 0) { - clayer = GLO_MAX + dynamic_cast(o)->getLayer(); - } - if (dynamic_cast(o)->getLayer() < 0) { - clayer = dynamic_cast(o)->getLayer(); - } - } + if (type == GLO_POI || type == GLO_POLYGON) { + layer = dynamic_cast(o)->getLayer(); } // check whether the current object is above a previous one - if (prevLayer == -1000 || prevLayer < clayer) { + if (layer > maxLayer) { idMax = id; - prevLayer = clayer; + maxLayer = layer; } } GUIGlObjectStorage::gIDStorage.unblockObject(id); @@ -393,17 +376,14 @@ size_t length = 1; const std::string text("10000000000"); size_t noDigits = 1; - size_t pixelSize = 0; - while (true) { - pixelSize = (size_t) m2p((SUMOReal) length); - if (pixelSize > 20) { - break; - } + size_t pixelSize = (size_t) m2p((SUMOReal) length); + while (pixelSize <= 20) { length *= 10; noDigits++; if (noDigits > text.length()) { return; } + pixelSize = (size_t) m2p((SUMOReal) length); } SUMOReal lineWidth = 1.0; glLineWidth((SUMOReal) lineWidth); @@ -486,6 +466,7 @@ } else { myChanger->centerTo(o->getCenteringBoundary().getCenter(), zoomDist, applyZoom); } + update(); } GUIGlObjectStorage::gIDStorage.unblockObject(id); } @@ -931,7 +912,7 @@ void GUISUMOAbstractView::drawDecals() { - glTranslated(0, 0, .99); + glPushName(0); myDecalsLock.lock(); for (std::vector::iterator l = myDecals.begin(); l != myDecals.end();) { GUISUMOAbstractView::Decal& d = *l; @@ -943,6 +924,7 @@ } d.glID = GUITexturesHelper::add(i); d.initialised = true; + d.image = i; } catch (InvalidArgument& e) { WRITE_ERROR("Could not load '" + d.filename + "'.\n" + e.what()); l = myDecals.erase(l); @@ -950,7 +932,7 @@ } } glPushMatrix(); - glTranslated(d.centerX, d.centerY, 0); + glTranslated(d.centerX, d.centerY, d.layer); glRotated(d.rot, 0, 0, 1); glColor3d(1, 1, 1); SUMOReal halfWidth((d.width / 2.)); @@ -960,7 +942,7 @@ ++l; } myDecalsLock.unlock(); - glTranslated(0, 0, -.99); + glPopName(); } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.h sumo-0.16.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.h --- sumo-0.15.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.h 2012-01-21 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/GUISUMOAbstractView.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOAbstractView.h 11751 2012-01-20 10:05:00Z dkrajzew $ +/// @version $Id: GUISUMOAbstractView.h 13107 2012-12-02 13:57:34Z behrisch $ /// // The base class for a view /****************************************************************************/ @@ -37,7 +37,15 @@ #include #include #include +// fx3d includes windows.h so we need to guard against macro pollution +#ifdef WIN32 +#define NOMINMAX +#endif #include +#ifdef WIN32 +#undef NOMINMAX +#endif + #include #include #include @@ -86,7 +94,7 @@ virtual void buildViewToolBars(GUIGlChildWindow&) { } /// recenters the view - void recenterView(); + virtual void recenterView(); /** @brief centers to the chosen artifact * @param[in] id The id of the artifact to center to @@ -230,15 +238,6 @@ public: - /** - * JunctionColoringScheme - * This enumeration holds the possible vehicle colouring schemes - */ - enum JunctionColoringScheme { - /// colouring by vehicle speed - VCS_BY_TYPE = 0 - }; - /** @struct Decal * @brief A decal (an image) that can be shown @@ -247,8 +246,8 @@ /// @brief Constructor Decal() : filename(), centerX(0), centerY(0), - width(1000), height(1000), rot(0), - initialised(false), glID(-1) { } + width(1000), height(1000), rot(0), layer(0), + initialised(false), glID(-1), image(0) { } /// @brief The path to the file the image is located at std::string filename; @@ -262,10 +261,14 @@ SUMOReal height; /// @brief The rotation of the image (in degrees) SUMOReal rot; + /// @brief The layer of the image + SUMOReal layer; /// @brief Whether this image was initialised (inserted as a texture) bool initialised; /// @brief The gl-id of the texture that holds this image int glID; + /// @brief The image pointer for later cleanup + FXImage* image; }; @@ -278,7 +281,7 @@ */ Position getPositionInformation() const; - void addDecals(const std::vector &decals) { + void addDecals(const std::vector& decals) { myDecals.insert(myDecals.end(), decals.begin(), decals.end()); } diff -Nru sumo-0.15.0~dfsg/src/utils/gui/windows/Makefile.in sumo-0.16.0~dfsg/src/utils/gui/windows/Makefile.in --- sumo-0.15.0~dfsg/src/utils/gui/windows/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/gui/windows/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -105,6 +105,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -135,6 +136,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -169,6 +171,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -202,7 +205,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/importio/LineReader.cpp sumo-0.16.0~dfsg/src/utils/importio/LineReader.cpp --- sumo-0.15.0~dfsg/src/utils/importio/LineReader.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/importio/LineReader.cpp 2012-09-25 22:01:47.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: LineReader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: LineReader.cpp 12640 2012-08-31 19:48:20Z behrisch $ /// // Retrieves a file linewise and reports the lines to a handler. /****************************************************************************/ @@ -131,7 +131,6 @@ std::string LineReader::readLine() { std::string toReport; - bool moreAvailable = true; while (toReport.length() == 0 && myStrm.good()) { size_t idx = myStrBuffer.find('\n'); if (idx == 0) { @@ -156,7 +155,6 @@ } else { toReport = myStrBuffer; myRread += 1024; - moreAvailable = false; if (toReport == "") { return toReport; } diff -Nru sumo-0.15.0~dfsg/src/utils/importio/LineReader.h sumo-0.16.0~dfsg/src/utils/importio/LineReader.h --- sumo-0.15.0~dfsg/src/utils/importio/LineReader.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/importio/LineReader.h 2012-09-25 22:01:47.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: LineReader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: LineReader.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // Retrieves a file linewise and reports the lines to a handler. /****************************************************************************/ @@ -58,7 +58,7 @@ class LineReader { public: /// @brief Constructor - LineReader() ; + LineReader(); /** @brief Constructor @@ -68,17 +68,17 @@ * @param[in] file The name of the file to open * @see setFile */ - LineReader(const std::string& file) ; + LineReader(const std::string& file); /// @brief Destructor - ~LineReader() ; + ~LineReader(); /** @brief Returns whether another line may be read (the file was not read completely) * @return Whether further reading is possible */ - bool hasMore() const ; + bool hasMore() const; /** @brief Reads the whole file linewise, reporting every line to the given LineHandler @@ -87,7 +87,7 @@ * * @param[in] lh The LineHandler to report read lines to */ - void readAll(LineHandler& lh) ; + void readAll(LineHandler& lh); /** @brief Reads a single (the next) line from the file and reports it to the given LineHandler @@ -97,24 +97,24 @@ * @param[in] lh The LineHandler to report read lines to * @return Whether a further line exists */ - bool readLine(LineHandler& lh) ; + bool readLine(LineHandler& lh); /** @brief Reads a single (the next) line from the file and returns it * * @return The next line in the file */ - std::string readLine() ; + std::string readLine(); /// @brief Closes the reading - void close() ; + void close(); /** @brief Returns the name of the used file * @return The name of the opened file */ - std::string getFileName() const ; + std::string getFileName() const; /** @brief Reinitialises the reader for reading from the given file @@ -124,30 +124,30 @@ * @param[in] file The name of the file to open * @return Whether the file could be opened */ - bool setFile(const std::string& file) ; + bool setFile(const std::string& file); /** @brief Returns the current position within the file * @return The current position within the opened file */ - unsigned long getPosition() ; + unsigned long getPosition(); /// @brief Reinitialises the reading (of the previous file) - void reinit() ; + void reinit(); /** @brief Sets the current position within the file to the given value * * @param[in] pos The new position within the file */ - void setPos(unsigned long pos) ; + void setPos(unsigned long pos); /** @brief Returns the information whether the stream is readable * @return Whether the file is usable (good()) */ - bool good() const ; + bool good() const; private: diff -Nru sumo-0.15.0~dfsg/src/utils/importio/Makefile.in sumo-0.16.0~dfsg/src/utils/importio/Makefile.in --- sumo-0.15.0~dfsg/src/utils/importio/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/importio/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -101,6 +101,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -131,6 +132,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -165,6 +167,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -198,7 +201,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/importio/NamedColumnsParser.h sumo-0.16.0~dfsg/src/utils/importio/NamedColumnsParser.h --- sumo-0.15.0~dfsg/src/utils/importio/NamedColumnsParser.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/importio/NamedColumnsParser.h 2012-09-25 22:01:47.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NamedColumnsParser.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: NamedColumnsParser.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // A parser to retrieve information from a table with known columns /****************************************************************************/ @@ -61,7 +61,7 @@ * * Does nothing, a later call to reinit is necessary */ - NamedColumnsParser() ; + NamedColumnsParser(); /** @brief Constructor @@ -78,11 +78,11 @@ */ NamedColumnsParser(const std::string& def, const std::string& defDelim = ";", const std::string& lineDelim = ";", bool chomp = false, - bool ignoreCase = true) ; + bool ignoreCase = true); /// @brief Destructor - ~NamedColumnsParser() ; + ~NamedColumnsParser(); /** @brief Reinitialises the parser @@ -98,7 +98,7 @@ */ void reinit(const std::string& def, const std::string& defDelim = ";", const std::string& lineDelim = ";", bool chomp = false, - bool ignoreCase = true) ; + bool ignoreCase = true); /** @brief Parses the contents of the line @@ -109,7 +109,7 @@ * * @param[in] line The line to parse */ - void parseLine(const std::string& line) ; + void parseLine(const std::string& line); /** @brief Returns the named information @@ -135,14 +135,14 @@ * @param[in] name The name of the value to check * @return Whether the named value is stored in the parsed line */ - bool know(const std::string& name) const ; + bool know(const std::string& name) const; /** @brief Returns whether the number of named columns matches the actual number * * @return Whether the number of named columns matches the actual number */ - bool hasFullDefinition() const ; + bool hasFullDefinition() const; private: @@ -159,7 +159,7 @@ * @param[in] chomp Whether the tokens shall be prunned */ void reinitMap(std::string def, const std::string& delim = ";", - bool chomp = false) ; + bool chomp = false); /** @brief Prunes the given string if it shall be done @@ -170,7 +170,7 @@ * @param[in, out] str The string to prune (optionally) * @param[in] prune Whether the string shall be prunned */ - void checkPrune(std::string& str, bool prune) const ; + void checkPrune(std::string& str, bool prune) const; private: diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/BinaryFormatter.cpp sumo-0.16.0~dfsg/src/utils/iodevices/BinaryFormatter.cpp --- sumo-0.15.0~dfsg/src/utils/iodevices/BinaryFormatter.cpp 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/BinaryFormatter.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file BinaryFormatter.cpp /// @author Michael Behrisch /// @date 2012 -/// @version $Id: BinaryFormatter.cpp 11852 2012-02-08 09:24:17Z behrisch $ +/// @version $Id: BinaryFormatter.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ @@ -32,6 +32,7 @@ #include #endif +#include #include #include #include @@ -54,7 +55,7 @@ void BinaryFormatter::writeStringList(std::ostream& into, const std::vector& list) { FileHelpers::writeByte(into, BF_LIST); - FileHelpers::writeInt(into, list.size()); + 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); @@ -64,9 +65,9 @@ bool BinaryFormatter::writeXMLHeader(std::ostream& into, const std::string& rootElement, - const std::string xmlParams, - const std::string& attrs, - const std::string& comment) { + const std::string /* xmlParams */, + const std::string& /* attrs */, + const std::string& /* comment */) { if (myXMLStack.empty()) { FileHelpers::writeByte(into, BF_BYTE); FileHelpers::writeByte(into, 1); @@ -76,8 +77,11 @@ writeStringList(into, SUMOXMLDefinitions::Attrs.getStrings()); writeStringList(into, SUMOXMLDefinitions::NodeTypes.getStrings()); writeStringList(into, SUMOXMLDefinitions::EdgeFunctions.getStrings()); + writeStringList(into, std::vector()); + writeStringList(into, std::vector()); + if (SUMOXMLDefinitions::Tags.hasString(rootElement)) { - openTag(into, (const SumoXMLTag)(SUMOXMLDefinitions::Tags.get(rootElement))); + openTag(into, rootElement); return true; } } @@ -97,20 +101,20 @@ BinaryFormatter::openTag(std::ostream& into, const SumoXMLTag& xmlElement) { myXMLStack.push_back(xmlElement); FileHelpers::writeByte(into, BF_XML_TAG_START); - FileHelpers::writeInt(into, xmlElement); + FileHelpers::writeByte(into, xmlElement); } void -BinaryFormatter::closeOpener(std::ostream& into) { +BinaryFormatter::closeOpener(std::ostream& /* into */) { } bool -BinaryFormatter::closeTag(std::ostream& into, bool abbreviated) { +BinaryFormatter::closeTag(std::ostream& into, bool /* abbreviated */) { if (!myXMLStack.empty()) { FileHelpers::writeByte(into, BF_XML_TAG_END); - FileHelpers::writeInt(into, myXMLStack.back()); + FileHelpers::writeByte(into, myXMLStack.back()); myXMLStack.pop_back(); return true; } @@ -126,9 +130,20 @@ } +void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const bool& val) { + BinaryFormatter::writeAttrHeader(into, attr, BF_BYTE); + FileHelpers::writeByte(into, val); +} + + void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SUMOReal& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_FLOAT); - FileHelpers::writeFloat(into, 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); + } } @@ -138,60 +153,85 @@ } +void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const unsigned int& val) { + BinaryFormatter::writeAttrHeader(into, attr, BF_INTEGER); + FileHelpers::writeInt(into, val); +} + + void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SumoXMLNodeType& val) { BinaryFormatter::writeAttrHeader(into, attr, BF_NODE_TYPE); - FileHelpers::writeByte(into, val); + FileHelpers::writeByte(into, (unsigned char) val); } void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SumoXMLEdgeFunc& val) { BinaryFormatter::writeAttrHeader(into, attr, BF_EDGE_FUNCTION); - FileHelpers::writeByte(into, val); + FileHelpers::writeByte(into, (unsigned char) val); } -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Position& val) { +void BinaryFormatter::writePosition(std::ostream& into, const Position& val) { if (val.z() != 0.) { - BinaryFormatter::writeAttrHeader(into, attr, BF_POSITION_3D); - FileHelpers::writeFloat(into, val.x()); - FileHelpers::writeFloat(into, val.y()); - FileHelpers::writeFloat(into, val.z()); + 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 { - BinaryFormatter::writeAttrHeader(into, attr, BF_POSITION_2D); - FileHelpers::writeFloat(into, val.x()); - FileHelpers::writeFloat(into, val.y()); + 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()); + } } } +void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Position& val) { + FileHelpers::writeByte(into, static_cast(BF_XML_ATTRIBUTE)); + FileHelpers::writeByte(into, attr); + writePosition(into, val); +} + + void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const PositionVector& val) { BinaryFormatter::writeAttrHeader(into, attr, BF_LIST); - FileHelpers::writeInt(into, val.size()); + FileHelpers::writeInt(into, (int)val.size()); for (PositionVector::ContType::const_iterator pos = val.begin(); pos != val.end(); ++pos) { - if (pos->z() != 0.) { - FileHelpers::writeByte(into, BF_POSITION_3D); - FileHelpers::writeFloat(into, pos->x()); - FileHelpers::writeFloat(into, pos->y()); - FileHelpers::writeFloat(into, pos->z()); - } else { - FileHelpers::writeByte(into, BF_POSITION_2D); - FileHelpers::writeFloat(into, pos->x()); - FileHelpers::writeFloat(into, pos->y()); - } + writePosition(into, *pos); } } void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Boundary& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_LIST); - FileHelpers::writeInt(into, 2); - FileHelpers::writeByte(into, BF_POSITION_2D); + BinaryFormatter::writeAttrHeader(into, attr, BF_BOUNDARY); FileHelpers::writeFloat(into, val.xmin()); FileHelpers::writeFloat(into, val.ymin()); - FileHelpers::writeByte(into, BF_POSITION_2D); FileHelpers::writeFloat(into, val.xmax()); FileHelpers::writeFloat(into, val.ymax()); } -/****************************************************************************/ +void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const RGBColor& val) { + BinaryFormatter::writeAttrHeader(into, attr, BF_COLOR); + FileHelpers::writeByte(into, char(val.red() * 255 + .5)); + FileHelpers::writeByte(into, char(val.green() * 255 + .5)); + FileHelpers::writeByte(into, char(val.blue() * 255 + .5)); + FileHelpers::writeByte(into, 0); +} + + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/BinaryFormatter.h sumo-0.16.0~dfsg/src/utils/iodevices/BinaryFormatter.h --- sumo-0.15.0~dfsg/src/utils/iodevices/BinaryFormatter.h 2012-03-02 00:03:39.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/BinaryFormatter.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file BinaryFormatter.h /// @author Michael Behrisch /// @date 2012 -/// @version $Id: BinaryFormatter.h 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: BinaryFormatter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Output formatter for plain XML output /****************************************************************************/ @@ -30,7 +30,13 @@ #include #endif +#ifdef HAVE_VERSION_H +#include +#endif + +#include #include +#include #include "OutputFormatter.h" @@ -40,6 +46,8 @@ class Position; class PositionVector; class Boundary; +class RGBColor; +class ROEdge; // =========================================================================== @@ -55,7 +63,7 @@ public: /// @brief data types in binary output enum DataType { - /// @brief + /// @brief BF_BYTE, /// @brief BF_INTEGER, @@ -80,11 +88,21 @@ /// @brief BF_POSITION_3D, /// @brief + BF_BOUNDARY, + /// @brief BF_COLOR, /// @brief BF_NODE_TYPE, /// @brief - BF_EDGE_FUNCTION + BF_EDGE_FUNCTION, + /// @brief + BF_ROUTE, + /// @brief + BF_SCALED2INT, + /// @brief + BF_SCALED2INT_POSITION_2D, + /// @brief + BF_SCALED2INT_POSITION_3D }; /// @brief Constructor @@ -114,6 +132,18 @@ const std::string& comment = ""); + /** @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 @@ -153,7 +183,7 @@ * @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, bool abbreviated=false); + bool closeTag(std::ostream& into, bool abbreviated = false); /** @brief writes an arbitrary attribute @@ -171,8 +201,17 @@ * @param[in] attr The attribute (name) * @param[in] val The attribute value */ - template - static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const T& val); + template + static void writeAttr(S& into, const SumoXMLAttr attr, const T& val); + + + /** @brief writes a named boolean attribute + * + * @param[in] into The output stream to use + * @param[in] attr The attribute (name) + * @param[in] val The attribute value + */ + static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const bool& val); /** @brief writes a named float attribute @@ -193,6 +232,15 @@ static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const int& val); + /** @brief writes a named unsigned integer attribute + * + * @param[in] into The output stream to use + * @param[in] attr The attribute (name) + * @param[in] val The attribute value + */ + static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const unsigned int& val); + + /** @brief writes a node type attribute * * @param[in] into The output stream to use @@ -238,6 +286,25 @@ static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const Boundary& val); + /** @brief writes a color attribute + * + * @param[in] into The output stream to use + * @param[in] attr The attribute (name) + * @param[in] val The attribute value + */ + static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const RGBColor& val); + + + /** @brief writes an edge vector 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(S& into, const SumoXMLAttr attr, const std::vector& val); + + private: /** @brief writes the header for an arbitrary attribute * @@ -247,7 +314,7 @@ */ static inline void writeAttrHeader(std::ostream& into, const SumoXMLAttr attr, const DataType type) { FileHelpers::writeByte(into, static_cast(BF_XML_ATTRIBUTE)); - FileHelpers::writeInt(into, attr); + FileHelpers::writeByte(into, static_cast(attr)); FileHelpers::writeByte(into, static_cast(type)); } @@ -257,7 +324,15 @@ * @param[in] into The output stream to use * @param[in] list the list to write */ - void writeStringList(std::ostream& into, const std::vector& list); + 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: @@ -268,13 +343,57 @@ }; -template -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const T& val) { +template +bool BinaryFormatter::writeHeader(std::ostream& into, const SumoXMLTag& rootElement) { + if (myXMLStack.empty()) { + FileHelpers::writeByte(into, BF_BYTE); + FileHelpers::writeByte(into, 1); + 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()); + + const unsigned int numEdges = (const unsigned int)E::dictSize(); + FileHelpers::writeByte(into, BF_LIST); + FileHelpers::writeInt(into, numEdges); + for (unsigned int i = 0; i < numEdges; i++) { + FileHelpers::writeByte(into, BF_STRING); + FileHelpers::writeString(into, E::dictionary(i)->getID()); + } + FileHelpers::writeByte(into, BF_LIST); + FileHelpers::writeInt(into, numEdges); + for (unsigned int i = 0; i < numEdges; i++) { + E* e = E::dictionary(i); + FileHelpers::writeByte(into, BF_LIST); + FileHelpers::writeInt(into, e->getNoFollowing()); + for (unsigned int j = 0; j < e->getNoFollowing(); j++) { + FileHelpers::writeByte(into, BF_INTEGER); + FileHelpers::writeInt(into, e->getFollower(j)->getNumericalID()); + } + } + openTag(into, rootElement); + return true; + } + return false; +} + + +template +void BinaryFormatter::writeAttr(S& into, const SumoXMLAttr attr, const T& val) { BinaryFormatter::writeAttrHeader(into, attr, BF_STRING); FileHelpers::writeString(into, toString(val, into.precision())); } +template +void BinaryFormatter::writeAttr(S& into, const SumoXMLAttr attr, const std::vector& val) { + BinaryFormatter::writeAttrHeader(into, attr, BF_ROUTE); + FileHelpers::writeEdgeVector(into, val); +} + + #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/BinaryInputDevice.cpp sumo-0.16.0~dfsg/src/utils/iodevices/BinaryInputDevice.cpp --- sumo-0.15.0~dfsg/src/utils/iodevices/BinaryInputDevice.cpp 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/BinaryInputDevice.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: BinaryInputDevice.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: BinaryInputDevice.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Encapsulates binary reading operations on a file /****************************************************************************/ @@ -30,6 +30,8 @@ #endif #include +#include +#include "BinaryFormatter.h" #include "BinaryInputDevice.h" #ifdef CHECK_MEMORY_LEAKS @@ -45,8 +47,10 @@ // =========================================================================== // method definitions // =========================================================================== -BinaryInputDevice::BinaryInputDevice(const std::string& name) - : myStream(name.c_str(), std::fstream::in | std::fstream::binary) {} +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() {} @@ -58,8 +62,61 @@ } +int +BinaryInputDevice::peek() { + return myStream.peek(); +} + + +std::string +BinaryInputDevice::read(int numBytes) { + if (numBytes > BUF_MAX) { + throw ProcessError("Buffer to small."); + } + 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; } @@ -67,6 +124,7 @@ BinaryInputDevice& operator>>(BinaryInputDevice& os, unsigned int& i) { + os.checkType(BinaryFormatter::BF_INTEGER); os.myStream.read((char*) &i, sizeof(unsigned int)); return os; } @@ -74,14 +132,22 @@ BinaryInputDevice& operator>>(BinaryInputDevice& os, SUMOReal& f) { - os.myStream.read((char*) &f, sizeof(SUMOReal)); + 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(SUMOReal)); + } return os; } BinaryInputDevice& operator>>(BinaryInputDevice& os, bool& b) { - b = 0; + os.checkType(BinaryFormatter::BF_BYTE); + b = false; os.myStream.read((char*) &b, sizeof(char)); return os; } @@ -89,25 +155,88 @@ BinaryInputDevice& operator>>(BinaryInputDevice& os, std::string& s) { + os.checkType(BinaryFormatter::BF_STRING); unsigned int size; - os >> size; + os.myStream.read((char*) &size, sizeof(unsigned int)); if (size < BUF_MAX) { os.myStream.read((char*) &os.myBuffer, sizeof(char)*size); os.myBuffer[size] = 0; s = std::string(os.myBuffer); - return os; } return os; } BinaryInputDevice& -operator>>(BinaryInputDevice& os, long& l) { - os.myStream.read((char*) &l, sizeof(long)); +operator>>(BinaryInputDevice& os, std::vector& v) { + os.checkType(BinaryFormatter::BF_LIST); + unsigned int size; + os.myStream.read((char*) &size, sizeof(unsigned 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); + unsigned int size; + os.myStream.read((char*) &size, sizeof(unsigned int)); + while (size > 0) { + unsigned 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); + unsigned int size; + os.myStream.read((char*) &size, sizeof(unsigned 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); + SUMOReal 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(SUMOReal)); + os.myStream.read((char*) &y, sizeof(SUMOReal)); + if (t == BinaryFormatter::BF_POSITION_3D) { + os.myStream.read((char*) &z, sizeof(SUMOReal)); + } + } + p.set(x, y, z); + return os; +} + + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/BinaryInputDevice.h sumo-0.16.0~dfsg/src/utils/iodevices/BinaryInputDevice.h --- sumo-0.15.0~dfsg/src/utils/iodevices/BinaryInputDevice.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/BinaryInputDevice.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: BinaryInputDevice.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: BinaryInputDevice.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Encapsulates binary reading operations on a file /****************************************************************************/ @@ -32,7 +32,15 @@ #endif #include +#include #include +#include "BinaryFormatter.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class BinaryInputDevice; // =========================================================================== @@ -59,18 +67,62 @@ * * @param[in] name The name of the file to open for reading */ - BinaryInputDevice(const std::string& name) ; + BinaryInputDevice(const std::string& name, const bool isTyped = false, const bool doValidate = false); /// @brief Destructor - ~BinaryInputDevice() ; + ~BinaryInputDevice(); /** @brief Returns whether the file can be used (is good()) * * @return Whether the file is good */ - bool good() const ; + 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 Returns the associated istream + std::istream& getIStream() { + return myStream; + } + + /** @brief Returns the next character to be read by an actual parse. + * + * @return the next character which will be returned + */ + std::string read(int numBytes); + + + /** @brief Returns the next character to be read by an actual parse. + * + * @return the next character which will be returned + */ + 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) @@ -79,7 +131,7 @@ * @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) ; + friend BinaryInputDevice& operator>>(BinaryInputDevice& os, int& i); /** @brief Reads an unsigned int from the file (input operator) @@ -88,7 +140,7 @@ * @param[in] i The unsigned int to store the read value into * @return The used BinaryInputDevice for further processing */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, unsigned int& i) ; + friend BinaryInputDevice& operator>>(BinaryInputDevice& os, unsigned int& i); /** @brief Reads a SUMOReal from the file (input operator) @@ -97,7 +149,7 @@ * @param[in] i The SUMOReal to store the read value into * @return The used BinaryInputDevice for further processing */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, SUMOReal& f) ; + friend BinaryInputDevice& operator>>(BinaryInputDevice& os, SUMOReal& f); /** @brief Reads a bool from the file (input operator) @@ -106,7 +158,7 @@ * @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) ; + friend BinaryInputDevice& operator>>(BinaryInputDevice& os, bool& b); /** @brief Reads a string from the file (input operator) @@ -117,26 +169,78 @@ * will cause an error. * * @param[in, out] os The BinaryInputDevice to read the string from - * @param[in] i The string to store the read value into + * @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) ; + friend BinaryInputDevice& operator>>(BinaryInputDevice& os, std::string& s); - /** @brief Reads a long from the file (input operator) + /** @brief Reads a string vector from the file (input operator) * - * @param[in, out] os The BinaryInputDevice to read the long from - * @param[in] i The int to store the read value into + * Reads the length of the vector as an unsigned 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 unsigned 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 unsigned 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, long& l) ; + 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[1000]; diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/Makefile.in sumo-0.16.0~dfsg/src/utils/iodevices/Makefile.in --- sumo-0.15.0~dfsg/src/utils/iodevices/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -104,6 +104,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -134,6 +135,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -168,6 +170,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -201,7 +204,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice.cpp sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice.cpp --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice.cpp 2012-02-16 15:57:56.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice.cpp 11915 2012-02-16 15:38:12Z behrisch $ +/// @version $Id: OutputDevice.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ @@ -35,7 +35,6 @@ #include #include #include -#include #include "OutputDevice.h" #include "OutputDevice_File.h" #include "OutputDevice_COUT.h" @@ -82,7 +81,7 @@ dev = OutputDevice_CERR::getDevice(); } else if (FileHelpers::isSocket(internalName)) { try { - int port = TplConvert::_2int(internalName.substr(internalName.find(":") + 1).c_str()); + int port = TplConvert::_2int(internalName.substr(internalName.find(":") + 1).c_str()); dev = new OutputDevice_Network(internalName.substr(0, internalName.find(":")), port); } catch (NumberFormatException&) { throw IOError("Given port number '" + internalName.substr(internalName.find(":") + 1) + "' is not numeric."); @@ -90,7 +89,9 @@ throw IOError("No port number given."); } } else { - dev = new OutputDevice_File(FileHelpers::checkForRelativity(internalName, base), internalName.find(".sbx") != std::string::npos); + const size_t len = internalName.length(); + dev = new OutputDevice_File(FileHelpers::checkForRelativity(internalName, base), + len > 4 && internalName.substr(len - 4) == ".sbx"); } dev->setPrecision(); dev->getOStream() << std::setiosflags(std::ios::fixed); @@ -196,37 +197,37 @@ bool OutputDevice::writeXMLHeader(const std::string& rootElement, const std::string xmlParams, const std::string& attrs, const std::string& comment) { - return myFormatter->writeXMLHeader(getOStream(), rootElement, xmlParams, attrs, comment); + return myFormatter->writeXMLHeader(getOStream(), rootElement, xmlParams, attrs, comment); } OutputDevice& OutputDevice::openTag(const std::string& xmlElement) { - myFormatter->openTag(getOStream(), xmlElement); + myFormatter->openTag(getOStream(), xmlElement); return *this; } OutputDevice& OutputDevice::openTag(const SumoXMLTag& xmlElement) { - myFormatter->openTag(getOStream(), xmlElement); + myFormatter->openTag(getOStream(), xmlElement); return *this; } void OutputDevice::closeOpener() { - myFormatter->closeOpener(getOStream()); + myFormatter->closeOpener(getOStream()); } bool OutputDevice::closeTag(bool abbreviated) { - if (myFormatter->closeTag(getOStream(), abbreviated)) { - postWriteHook(); - return true; - } - return false; + if (myFormatter->closeTag(getOStream(), abbreviated)) { + postWriteHook(); + return true; + } + return false; } @@ -245,9 +246,9 @@ } -OutputDevice& +OutputDevice& OutputDevice::writeAttr(std::string attr, std::string val) { - myFormatter->writeAttr(getOStream(), attr, val); + myFormatter->writeAttr(getOStream(), attr, val); return *this; } diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice.h 2012-03-02 00:03:39.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice.h 11986 2012-03-01 13:57:37Z behrisch $ +/// @version $Id: OutputDevice.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ @@ -125,17 +125,17 @@ /** Closes all registered devices */ - static void closeAll() ; + static void closeAll(); /// @} /** @brief Helper method for string formatting * * @param[in] v The floating point value to be formatted - * @param[in] precision the precision to achieve + * @param[in] precision the precision to achieve * @return The formatted string */ - static std::string realString(const SUMOReal v, const int precision=OUTPUT_ACCURACY); + static std::string realString(const SUMOReal v, const int precision = OUTPUT_ACCURACY); public: @@ -143,7 +143,7 @@ /// @{ /// @brief Constructor - OutputDevice(const bool binary=false, const unsigned int defaultIndentation=0); + OutputDevice(const bool binary = false, const unsigned int defaultIndentation = 0); /// @brief Destructor @@ -153,18 +153,18 @@ /** @brief returns the information whether one can write into the device * @return Whether the device can be used (stream is good) */ - virtual bool ok() ; + virtual bool ok(); /** @brief Closes the device and removes it from the dictionary */ - void close() ; + void close(); /** @brief Sets the precison or resets it to default * @param[in] precision The accuracy (number of digits behind '.') to set */ - void setPrecision(unsigned int precision=OUTPUT_ACCURACY); + void setPrecision(unsigned int precision = OUTPUT_ACCURACY); /** @brief Writes an XML header with optional configuration @@ -186,6 +186,18 @@ const std::string& comment = ""); + template + bool writeHeader(const SumoXMLTag& rootElement) { + if (myAmBinary) { + return static_cast(myFormatter)->writeHeader(getOStream(), rootElement); + } + if (rootElement == SUMO_TAG_ROUTES) { + return myFormatter->writeXMLHeader(getOStream(), "routes", "", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/routes_file.xsd\""); + } + return myFormatter->writeXMLHeader(getOStream(), toString(rootElement)); + } + + /** @brief Opens an XML tag * * An indentation, depending on the current xml-element-stack size, is written followed @@ -224,7 +236,7 @@ * @return 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(bool abbreviated=false); + bool closeTag(bool abbreviated = false); /** @brief writes an arbitrary attribute * @@ -275,7 +287,7 @@ * * @param[in] msg The msg to write to the device */ - void inform(const std::string& msg, const char progress=0); + void inform(const std::string& msg, const char progress = 0); /** @brief Abstract output operator @@ -297,7 +309,7 @@ * * Default implementation does nothing. */ - virtual void postWriteHook() ; + virtual void postWriteHook(); private: @@ -311,10 +323,12 @@ const bool myAmBinary; -private: +public: /// @brief Invalidated copy constructor. OutputDevice(const OutputDevice&); +private: + /// @brief Invalidated assignment operator. OutputDevice& operator=(const OutputDevice&); diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_CERR.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_CERR.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_CERR.h 2012-02-18 00:03:56.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_CERR.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_CERR.h 11922 2012-02-17 08:01:11Z bieker $ +/// @version $Id: OutputDevice_CERR.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An output device that encapsulates cerr /****************************************************************************/ @@ -45,7 +45,7 @@ public: /** @brief Returns the single cerr instance * - * Creates and returns the cerr device. + * Creates and returns the cerr device. */ static OutputDevice* getDevice(); @@ -57,14 +57,14 @@ /** @brief Returns the associated ostream * @return cerr */ - std::ostream& getOStream() ; + std::ostream& getOStream(); /** @brief Called after every write access. * * Calls flush on stderr. */ - virtual void postWriteHook() ; + virtual void postWriteHook(); /// @} @@ -76,7 +76,7 @@ /// @brief Destructor - ~OutputDevice_CERR() ; + ~OutputDevice_CERR(); private: diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_COUT.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_COUT.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_COUT.h 2012-02-16 15:57:56.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_COUT.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_COUT.h 11915 2012-02-16 15:38:12Z behrisch $ +/// @version $Id: OutputDevice_COUT.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An output device that encapsulates cout /****************************************************************************/ @@ -45,7 +45,7 @@ public: /** @brief Returns the single cout instance * - * Creates and returns the cout device. + * Creates and returns the cout device. */ static OutputDevice* getDevice(); @@ -57,14 +57,14 @@ /** @brief Returns the associated ostream * @return cout */ - std::ostream& getOStream() ; + std::ostream& getOStream(); /** @brief Called after every write access. * * Calls flush on stdout. */ - virtual void postWriteHook() ; + virtual void postWriteHook(); /// @} diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_File.cpp sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_File.cpp --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_File.cpp 2012-02-07 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_File.cpp 2012-09-25 22:01:53.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_File.cpp 11831 2012-02-06 07:49:31Z behrisch $ +/// @version $Id: OutputDevice_File.cpp 12150 2012-03-21 07:13:12Z namdre $ /// // An output device that encapsulates an ofstream /****************************************************************************/ @@ -50,7 +50,7 @@ myFileStream = new std::ofstream("/dev/null"); #endif } else { - myFileStream = new std::ofstream(fullName.c_str()); + myFileStream = new std::ofstream(fullName.c_str(), binary ? std::ios::binary : std::ios_base::out); } if (!myFileStream->good()) { delete myFileStream; diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_File.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_File.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_File.h 2012-02-07 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_File.h 2012-09-25 22:01:53.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_File.h 11831 2012-02-06 07:49:31Z behrisch $ +/// @version $Id: OutputDevice_File.h 12128 2012-03-19 11:54:26Z dkrajzew $ /// // An output device that encapsulates an ofstream /****************************************************************************/ @@ -55,7 +55,7 @@ /// @brief Destructor - ~OutputDevice_File() ; + ~OutputDevice_File(); protected: @@ -65,7 +65,7 @@ /** @brief Returns the associated ostream * @return The used stream */ - std::ostream& getOStream() ; + std::ostream& getOStream(); /// @} diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_Network.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_Network.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_Network.h 2012-01-07 20:14:51.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_Network.h 2012-10-10 23:02:25.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Daniel Krajzewicz /// @author Felix Brack /// @date 2006 -/// @version $Id: OutputDevice_Network.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: OutputDevice_Network.h 12818 2012-10-10 08:33:30Z namdre $ /// // An output device for TCP/IP Network connections /****************************************************************************/ @@ -60,14 +60,14 @@ * * @param[in] host The host to connect * @param[in] port The port to connect - * @exception IOError If the connection could not been established + * @exception IOError If the connection could not be established */ OutputDevice_Network(const std::string& host, const int port); /// @brief Destructor - ~OutputDevice_Network() ; + ~OutputDevice_Network(); protected: @@ -82,7 +82,7 @@ * @return The used stream * @see postWriteHook */ - std::ostream& getOStream() ; + std::ostream& getOStream(); /** @brief Sends the data which was written to the string stream over the socket. @@ -90,7 +90,7 @@ * Converts the stored message into a vector of chars and sends them via to * the socket implementation. Resets the message, afterwards. */ - virtual void postWriteHook() ; + virtual void postWriteHook(); /// @} private: diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_String.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_String.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputDevice_String.h 2012-02-08 00:02:17.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputDevice_String.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file OutputDevice_String.h /// @author Michael Behrisch /// @date 2009 -/// @version $Id: OutputDevice_String.h 11840 2012-02-07 08:22:50Z behrisch $ +/// @version $Id: OutputDevice_String.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An output device that encapsulates a stringstream /****************************************************************************/ @@ -49,17 +49,17 @@ /** @brief Constructor * @exception IOError Should not be thrown by this implementation */ - OutputDevice_String(const bool binary=false, const unsigned int defaultIndentation=0); + OutputDevice_String(const bool binary = false, const unsigned int defaultIndentation = 0); /// @brief Destructor - ~OutputDevice_String() ; + ~OutputDevice_String(); /** @brief Returns the current content as a string * @return The content as string */ - std::string getString() ; + std::string getString(); protected: /// @name Methods that override/implement OutputDevice-methods @@ -68,7 +68,7 @@ /** @brief Returns the associated ostream * @return The used stream */ - std::ostream& getOStream() ; + std::ostream& getOStream(); /// @} diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/OutputFormatter.h sumo-0.16.0~dfsg/src/utils/iodevices/OutputFormatter.h --- sumo-0.15.0~dfsg/src/utils/iodevices/OutputFormatter.h 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/OutputFormatter.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file OutputFormatter.h /// @author Michael Behrisch /// @date 2012 -/// @version $Id: OutputFormatter.h 11852 2012-02-08 09:24:17Z behrisch $ +/// @version $Id: OutputFormatter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Abstract base class for output formatters /****************************************************************************/ @@ -75,9 +75,9 @@ * @todo Describe what is saved */ virtual bool writeXMLHeader(std::ostream& into, const std::string& rootElement, - const std::string xmlParams = "", - const std::string& attrs = "", - const std::string& comment = "") = 0; + const std::string xmlParams = "", + const std::string& attrs = "", + const std::string& comment = "") = 0; /** @brief Opens an XML tag @@ -119,7 +119,7 @@ * @return Whether a further element existed in the stack and could be closed * @todo it is not verified that the topmost element was closed */ - virtual bool closeTag(std::ostream& into, bool abbreviated=false) = 0; + virtual bool closeTag(std::ostream& into, bool abbreviated = false) = 0; /** @brief writes an arbitrary attribute diff -Nru sumo-0.15.0~dfsg/src/utils/iodevices/PlainXMLFormatter.h sumo-0.16.0~dfsg/src/utils/iodevices/PlainXMLFormatter.h --- sumo-0.15.0~dfsg/src/utils/iodevices/PlainXMLFormatter.h 2012-02-09 00:02:15.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/iodevices/PlainXMLFormatter.h 2012-12-02 13:57:49.000000000 +0000 @@ -2,7 +2,7 @@ /// @file PlainXMLFormatter.h /// @author Michael Behrisch /// @date 2012 -/// @version $Id: PlainXMLFormatter.h 11852 2012-02-08 09:24:17Z behrisch $ +/// @version $Id: PlainXMLFormatter.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Output formatter for plain XML output /****************************************************************************/ @@ -45,7 +45,7 @@ class PlainXMLFormatter : public OutputFormatter { public: /// @brief Constructor - PlainXMLFormatter(const unsigned int defaultIndentation=0); + PlainXMLFormatter(const unsigned int defaultIndentation = 0); /// @brief Destructor @@ -110,7 +110,7 @@ * @return 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, bool abbreviated=false); + bool closeTag(std::ostream& into, bool abbreviated = false); /** @brief writes an arbitrary attribute @@ -122,7 +122,7 @@ void writeAttr(std::ostream& into, const std::string& attr, const std::string& val); - /** @brief writes a named attribute + /** @brief writes a named attribute * * @param[in] into The output stream to use * @param[in] attr The attribute (name) @@ -130,8 +130,8 @@ */ template static void writeAttr(std::ostream& into, const SumoXMLAttr attr, const T& val) { - into << " " << toString(attr) << "=\"" << toString(val, into.precision()) << "\""; - } + into << " " << toString(attr) << "=\"" << toString(val, into.precision()) << "\""; + } private: diff -Nru sumo-0.15.0~dfsg/src/utils/options/Makefile.in sumo-0.16.0~dfsg/src/utils/options/Makefile.in --- sumo-0.15.0~dfsg/src/utils/options/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/src/utils/options/Option.cpp sumo-0.16.0~dfsg/src/utils/options/Option.cpp --- sumo-0.15.0~dfsg/src/utils/options/Option.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/Option.cpp 2012-09-25 22:01:53.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: Option.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Option.cpp 12692 2012-09-07 11:50:12Z namdre $ /// // A class representing a single program option /****************************************************************************/ @@ -30,7 +30,6 @@ #include #endif -#include #include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -121,6 +121,13 @@ } +void +Option::unSet() { + myAmSet = false; + myAmWritable = true; +} + + bool Option::isBool() const { return false; @@ -215,11 +222,11 @@ bool Option_Integer::set(const std::string& v) { try { - myValue = TplConvert::_2int(v.c_str()); + myValue = TplConvert::_2int(v.c_str()); return markSet(); } catch (...) { - std::string s = "'" + v + "' is not a valid integer (should be)."; - throw InvalidArgument(s); + std::string s = "'" + v + "' is not a valid integer."; + throw ProcessError(s); } } @@ -332,11 +339,10 @@ bool Option_Float::set(const std::string& v) { try { - myValue = TplConvert::_2SUMOReal(v.c_str()); + myValue = TplConvert::_2SUMOReal(v.c_str()); return markSet(); } catch (...) { - std::string s = "'" + v + "' is not a valid float (should be)."; - throw InvalidArgument(s); + throw ProcessError("'" + v + "' is not a valid float."); } } @@ -393,16 +399,12 @@ bool Option_Bool::set(const std::string& v) { - std::string value = v; - std::transform(value.begin(), value.end(), value.begin(), tolower); - if (value == "1" || value == "yes" || value == "true" || value == "on" || value == "x") { - myValue = true; - } else if (value == "0" || value == "no" || value == "false" || value == "off") { - myValue = false; - } else { - throw ProcessError("Invalid boolean value for option."); + try { + myValue = TplConvert::_2bool(v.c_str()); + return markSet(); + } catch (...) { + throw ProcessError("'" + v + "' is not a valid bool."); } - return markSet(); } @@ -503,27 +505,20 @@ } StringTokenizer st(v, ";,", true); while (st.hasNext()) { - myValue.push_back(TplConvert::_2int(st.next().c_str())); + myValue.push_back(TplConvert::_2int(st.next().c_str())); } return markSet(); } catch (EmptyData&) { - throw InvalidArgument("Empty element occured in " + v); + throw ProcessError("Empty element occured in " + v); } catch (...) { - throw InvalidArgument("'" + v + "' is not a valid integer vector."); + throw ProcessError("'" + v + "' is not a valid integer vector."); } } std::string Option_IntVector::getValueString() const { - std::ostringstream s; - for (IntVector::const_iterator i = myValue.begin(); i != myValue.end(); i++) { - if (i != myValue.begin()) { - s << ','; - } - s << (*i); - } - return s.str(); + return joinToString(myValue, ','); } diff -Nru sumo-0.15.0~dfsg/src/utils/options/Option.h sumo-0.16.0~dfsg/src/utils/options/Option.h --- sumo-0.15.0~dfsg/src/utils/options/Option.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/Option.h 2012-09-25 22:01:53.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: Option.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Option.h 12593 2012-08-24 11:22:44Z namdre $ /// // Classes representing a single program option (with different types) /****************************************************************************/ @@ -87,6 +87,11 @@ bool isSet() const; + /** @brief marks this option as unset + */ + void unSet(); + + /** @brief Returns the stored SUMOReal value * * Option_Float returns the stored real number in this method's reimplementation. diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsCont.cpp sumo-0.16.0~dfsg/src/utils/options/OptionsCont.cpp --- sumo-0.15.0~dfsg/src/utils/options/OptionsCont.cpp 2012-01-27 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsCont.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsCont.cpp 11795 2012-01-26 21:48:41Z behrisch $ +/// @version $Id: OptionsCont.cpp 13127 2012-12-03 21:19:00Z behrisch $ /// // A storage for options (typed value containers) /****************************************************************************/ @@ -149,6 +149,20 @@ } +void +OptionsCont::unSet(const std::string& name, bool failOnNonExistant) const { + KnownContType::const_iterator i = myValues.find(name); + if (i == myValues.end()) { + if (failOnNonExistant) { + throw ProcessError("Internal request for unknown option '" + name + "'!"); + } else { + return; + } + } + (*i).second->unSet(); +} + + bool OptionsCont::isDefault(const std::string& name) const { KnownContType::const_iterator i = myValues.find(name); @@ -631,7 +645,7 @@ size_t tooLarge = 40; size_t maxSize = 0; for (i = mySubTopics.begin(); i != mySubTopics.end(); ++i) { - const std::vector &entries = mySubTopicEntries[*i]; + const std::vector& entries = mySubTopicEntries[*i]; for (j = entries.begin(); j != entries.end(); ++j) { Option* o = getSecure(*j); // name, two leading spaces and "--" @@ -655,7 +669,7 @@ for (i = mySubTopics.begin(); i != mySubTopics.end(); ++i) { os << *i << " Options:" << std::endl; - const std::vector &entries = mySubTopicEntries[*i]; + const std::vector& entries = mySubTopicEntries[*i]; for (j = entries.begin(); j != entries.end(); ++j) { // start length computation size_t csize = (*j).length() + 2; @@ -693,7 +707,7 @@ // print usage examples, calc size first if (myCallExamples.size() != 0) { os << "Examples:" << std::endl; - for (std::vector >::const_iterator e = myCallExamples.begin(); e != myCallExamples.end(); ++e) { + for (std::vector >::const_iterator e = myCallExamples.begin(); e != myCallExamples.end(); ++e) { os << " " << myAppName << ' ' << e->first << std::endl; os << " " << e->second << std::endl; } @@ -706,7 +720,7 @@ void OptionsCont::writeConfiguration(std::ostream& os, bool filled, - bool complete, bool addComments) { + bool complete, bool addComments) const { os << "\n\n"; os << "" << std::endl << std::endl; for (std::vector::const_iterator i = mySubTopics.begin(); i != mySubTopics.end(); ++i) { @@ -716,7 +730,7 @@ } std::replace(subtopic.begin(), subtopic.end(), ' ', '_'); std::transform(subtopic.begin(), subtopic.end(), subtopic.begin(), tolower); - const std::vector &entries = mySubTopicEntries[*i]; + const std::vector& entries = mySubTopicEntries.find(*i)->second; bool hadOne = false; for (std::vector::const_iterator j = entries.begin(); j != entries.end(); ++j) { Option* o = getSecure(*j); @@ -729,7 +743,7 @@ } // add the comment if wished if (addComments) { - os << " " << std::endl; + os << " " << std::endl; } // write the option and the value (if given) os << " <" << *j << " value=\""; @@ -749,7 +763,7 @@ } os << "\" type=\"" << o->getTypeName(); if (!addComments) { - os << "\" help=\"" << o->getDescription(); + os << "\" help=\"" << StringUtils::escapeXML(o->getDescription()); } } os << "\"/>" << std::endl; @@ -768,12 +782,13 @@ void -OptionsCont::writeSchema(std::ostream& os, bool addComments) { +OptionsCont::writeSchema(std::ostream& os, bool /* addComments */) { os << "\n\n"; os << "\n\n"; + os << " \n"; os << " \n\n"; os << " \n"; - os << " \n"; + os << " \n"; for (std::vector::const_iterator i = mySubTopics.begin(); i != mySubTopics.end(); ++i) { std::string subtopic = *i; if (subtopic == "Configuration") { @@ -781,9 +796,9 @@ } std::replace(subtopic.begin(), subtopic.end(), ' ', '_'); std::transform(subtopic.begin(), subtopic.end(), subtopic.begin(), tolower); - os << " \n"; + os << " \n"; } - os << " \n"; + os << " \n"; os << " \n\n"; for (std::vector::const_iterator i = mySubTopics.begin(); i != mySubTopics.end(); ++i) { std::string subtopic = *i; @@ -793,34 +808,19 @@ std::replace(subtopic.begin(), subtopic.end(), ' ', '_'); std::transform(subtopic.begin(), subtopic.end(), subtopic.begin(), tolower); os << " \n"; - os << " \n"; - const std::vector &entries = mySubTopicEntries[*i]; - for (std::vector::const_iterator j = entries.begin(); j != entries.end(); ++j) { - os << " \n"; - } - os << " \n"; - os << " \n\n"; + os << " \n"; + const std::vector& entries = mySubTopicEntries[*i]; for (std::vector::const_iterator j = entries.begin(); j != entries.end(); ++j) { Option* o = getSecure(*j); std::string type = o->getTypeName(); std::transform(type.begin(), type.end(), type.begin(), tolower); - if (type == "bool") { - type = "boolean"; - } else { - if (type != "int" && type != "float") { - type = "string"; - } + if (type == "int[]") { + type = "intArray"; } - os << " \n"; - if (addComments) { - os << " \n"; - } - os << " \n"; - os << " \n"; - os << " \n"; - os << " \n"; - os << " \n\n"; + os << " \n"; } + os << " \n"; + os << " \n\n"; } os << "\n"; } diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsCont.h sumo-0.16.0~dfsg/src/utils/options/OptionsCont.h --- sumo-0.15.0~dfsg/src/utils/options/OptionsCont.h 2012-01-27 00:02:14.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsCont.h 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsCont.h 11795 2012-01-26 21:48:41Z behrisch $ +/// @version $Id: OptionsCont.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A storage for options (typed value containers) /****************************************************************************/ @@ -194,7 +194,7 @@ * @param[in] addComments Whether comments (option descriptions) shall be written */ void writeConfiguration(std::ostream& os, bool filled, - bool complete, bool addComments); + bool complete, bool addComments) const; /** @brief Writes the xml schema for the configuration @@ -311,6 +311,13 @@ bool isSet(const std::string& name, bool failOnNonExistant = true) const; + /** @brief Marks the option as unset + * @param[in] name The name of the option to check + * @param[in] failOnNonExistant Whether asking for an unregistered option should trigger an exception + */ + void unSet(const std::string& name, bool failOnNonExistant = true) const; + + /** @brief Returns the information whether the named option has still the default value * * The named option is tried to be retrieved from the container. If @@ -587,11 +594,11 @@ * @return Whether the application shall stop * @exception ProcessError If the configuration file could not be saved */ - bool processMetaOptions(bool missingOptions) ; + bool processMetaOptions(bool missingOptions); /// @brief return the list of subtopics - const std::vector & getSubTopics() const { + const std::vector& getSubTopics() const { return mySubTopics; } @@ -611,6 +618,11 @@ return getSecure(name)->getTypeName(); } + + inline const std::string& getFullName() const { + return myFullName; + } + private: /** @brief Returns the named option * diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsIO.cpp sumo-0.16.0~dfsg/src/utils/options/OptionsIO.cpp --- sumo-0.15.0~dfsg/src/utils/options/OptionsIO.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsIO.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsIO.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: OptionsIO.cpp 13109 2012-12-02 14:49:47Z behrisch $ /// // Helper for parsing command line arguments and reading configuration files /****************************************************************************/ @@ -97,8 +97,8 @@ } PROGRESS_BEGIN_MESSAGE("Loading configuration"); // build parser - SAXParser parser; - parser.setValidationScheme(SAXParser::Val_Auto); + XERCES_CPP_NAMESPACE::SAXParser parser; + parser.setValidationScheme(XERCES_CPP_NAMESPACE::SAXParser::Val_Auto); parser.setDoNamespaces(false); parser.setDoSchema(false); // start the parsing @@ -110,8 +110,8 @@ if (handler.errorOccured()) { throw ProcessError("Could not load configuration '" + path + "'."); } - } catch (const XMLException& e) { - throw ProcessError("Could not load configuration '" + path + "':\n " + TplConvert::_2str(e.getMessage())); + } catch (const XERCES_CPP_NAMESPACE::XMLException& e) { + throw ProcessError("Could not load configuration '" + path + "':\n " + TplConvert::_2str(e.getMessage())); } oc.relocateFiles(path); PROGRESS_DONE_MESSAGE(); diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsIO.h sumo-0.16.0~dfsg/src/utils/options/OptionsIO.h --- sumo-0.15.0~dfsg/src/utils/options/OptionsIO.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsIO.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsIO.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: OptionsIO.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Helper for parsing command line arguments and reading configuration files /****************************************************************************/ @@ -71,7 +71,7 @@ * @param[in] argv arguments given at the command line */ static void getOptions(bool loadConfig, - int argc=0, char** argv=0) ; + int argc = 0, char** argv = 0); /** @brief Loads and parses the configuration @@ -80,7 +80,7 @@ * OptionsCont ("configuration-file" is used as the name of the option to get * the name of the configuration). */ - static void loadConfiguration() ; + static void loadConfiguration(); private: static int myArgC; diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsLoader.cpp sumo-0.16.0~dfsg/src/utils/options/OptionsLoader.cpp --- sumo-0.15.0~dfsg/src/utils/options/OptionsLoader.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsLoader.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsLoader.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: OptionsLoader.cpp 13109 2012-12-02 14:49:47Z behrisch $ /// // A SAX-Handler for loading options /****************************************************************************/ @@ -58,11 +58,11 @@ void OptionsLoader::startElement(const XMLCh* const name, - AttributeList& attributes) { - myItem = TplConvert::_2str(name); + XERCES_CPP_NAMESPACE::AttributeList& attributes) { + myItem = TplConvert::_2str(name); for (int i = 0; i < (int) attributes.getLength(); i++) { - std::string key = TplConvert::_2str(attributes.getName(i)); - std::string value = TplConvert::_2str(attributes.getValue(i)); + std::string key = TplConvert::_2str(attributes.getName(i)); + std::string value = TplConvert::_2str(attributes.getValue(i)); if (key == "value" || key == "v") { setValue(myItem, value); } @@ -90,7 +90,7 @@ void OptionsLoader::characters(const XMLCh* const chars, const XERCES3_SIZE_t length) { - myValue = myValue + TplConvert::_2str(chars, (unsigned int) length); + myValue = myValue + TplConvert::_2str(chars, (unsigned int) length); } @@ -120,8 +120,8 @@ void -OptionsLoader::warning(const SAXParseException& exception) { - WRITE_WARNING(TplConvert::_2str(exception.getMessage())); +OptionsLoader::warning(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { + WRITE_WARNING(TplConvert::_2str(exception.getMessage())); WRITE_WARNING(" (At line/column " \ + toString(exception.getLineNumber() + 1) + '/' \ + toString(exception.getColumnNumber()) + ")."); @@ -130,9 +130,9 @@ void -OptionsLoader::error(const SAXParseException& exception) { +OptionsLoader::error(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { WRITE_ERROR( - TplConvert::_2str(exception.getMessage())); + TplConvert::_2str(exception.getMessage())); WRITE_ERROR( " (At line/column " + toString(exception.getLineNumber() + 1) + '/' @@ -142,9 +142,9 @@ void -OptionsLoader::fatalError(const SAXParseException& exception) { +OptionsLoader::fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { WRITE_ERROR( - TplConvert::_2str(exception.getMessage())); + TplConvert::_2str(exception.getMessage())); WRITE_ERROR( " (At line/column " + toString(exception.getLineNumber() + 1) + '/' diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsLoader.h sumo-0.16.0~dfsg/src/utils/options/OptionsLoader.h --- sumo-0.15.0~dfsg/src/utils/options/OptionsLoader.h 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsLoader.h 2012-12-03 00:02:27.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsLoader.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: OptionsLoader.h 13109 2012-12-02 14:49:47Z behrisch $ /// // A SAX-Handler for loading options /****************************************************************************/ @@ -39,14 +39,6 @@ // =========================================================================== -// xerces 2.2 compatibility -// =========================================================================== -#if defined(XERCES_HAS_CPP_NAMESPACE) -using namespace XERCES_CPP_NAMESPACE; -#endif - - -// =========================================================================== // class declarations // =========================================================================== class OptionsCont; @@ -59,7 +51,7 @@ * @class OptionsLoader * @brief A SAX-Handler for loading options */ -class OptionsLoader : public HandlerBase { +class OptionsLoader : public XERCES_CPP_NAMESPACE::HandlerBase { public: /** @brief Constructor */ @@ -80,7 +72,7 @@ * Sets the name of the last item */ virtual void startElement(const XMLCh* const name, - AttributeList& attributes); + XERCES_CPP_NAMESPACE::AttributeList& attributes); /** @brief Called on the occurence of character data @@ -110,21 +102,21 @@ * * The warning is reported to the the warning-instance of MsgHandler */ - void warning(const SAXParseException& exception); + void warning(const XERCES_CPP_NAMESPACE::SAXParseException& exception); /** @brief Called on an XML-error * * The warning is reported to the the error-instance of MsgHandler */ - void error(const SAXParseException& exception); + void error(const XERCES_CPP_NAMESPACE::SAXParseException& exception); /** @brief Called on an XML-fatal error * * The warning is reported to the the error-instance of MsgHandler */ - void fatalError(const SAXParseException& exception); + void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& exception); /// @} diff -Nru sumo-0.15.0~dfsg/src/utils/options/OptionsParser.cpp sumo-0.16.0~dfsg/src/utils/options/OptionsParser.cpp --- sumo-0.15.0~dfsg/src/utils/options/OptionsParser.cpp 2012-01-07 20:14:50.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/options/OptionsParser.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsParser.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: OptionsParser.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Parses the command line arguments /****************************************************************************/ @@ -49,11 +49,11 @@ bool OptionsParser::parse(int argc, char** argv) { bool ok = true; - if (argc == 2 && argv[1][0] != '-') { - // special case only one parameter is handled like config + if (argc == 2 && argv[1][0] != '-') { + // special case only one parameter is handled like config check("-c", argv[1], ok); - return ok; - } + return ok; + } for (int i = 1; i < argc;) { try { int add; @@ -103,7 +103,7 @@ } // go through the abbreviated switches for (int i = 1; arg1[i] != 0; i++) { - // set boolean switches + // set boolean switches if (oc.isBool(convert(arg1[i]))) { if (arg2 == 0 || arg2[0] == '-' || arg1[i + 1] != 0) { ok &= oc.set(convert(arg1[i]), "true"); @@ -116,14 +116,14 @@ // check whether the parameter comes directly after the switch // and process if so if (arg2 == 0 || arg1[i + 1] != 0) { - ok &= processNonBooleanSingleSwitch(oc, arg1 + i); + ok &= processNonBooleanSingleSwitch(oc, arg1 + i); return 1; - // process parameter following after a space + // process parameter following after a space } else { ok &= oc.set(convert(arg1[i]), convert(arg2)); // option name and attribute were in two arguments return 2; - } + } } } // all switches within the current argument were boolean switches diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/Makefile.am sumo-0.16.0~dfsg/src/utils/shapes/Makefile.am --- sumo-0.15.0~dfsg/src/utils/shapes/Makefile.am 2011-05-25 23:02:19.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/Makefile.am 2012-10-18 23:02:44.000000000 +0000 @@ -1,5 +1,6 @@ noinst_LIBRARIES = libshapes.a libshapes_a_SOURCES = PointOfInterest.h \ +Shape.cpp Shape.h \ Polygon.cpp Polygon.h \ ShapeContainer.cpp ShapeContainer.h diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/Makefile.in sumo-0.16.0~dfsg/src/utils/shapes/Makefile.in --- sumo-0.15.0~dfsg/src/utils/shapes/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/Makefile.in 2012-12-04 00:13:20.000000000 +0000 @@ -49,7 +49,8 @@ ARFLAGS = cru libshapes_a_AR = $(AR) $(ARFLAGS) libshapes_a_LIBADD = -am_libshapes_a_OBJECTS = Polygon.$(OBJEXT) ShapeContainer.$(OBJEXT) +am_libshapes_a_OBJECTS = Shape.$(OBJEXT) Polygon.$(OBJEXT) \ + ShapeContainer.$(OBJEXT) libshapes_a_OBJECTS = $(am_libshapes_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -100,6 +101,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -130,6 +132,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -164,6 +167,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -197,7 +201,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -219,6 +222,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libshapes.a libshapes_a_SOURCES = PointOfInterest.h \ +Shape.cpp Shape.h \ Polygon.cpp Polygon.h \ ShapeContainer.cpp ShapeContainer.h @@ -271,6 +275,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShapeContainer.Po@am__quote@ .cpp.o: diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/PointOfInterest.h sumo-0.16.0~dfsg/src/utils/shapes/PointOfInterest.h --- sumo-0.15.0~dfsg/src/utils/shapes/PointOfInterest.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/PointOfInterest.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: PointOfInterest.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: PointOfInterest.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A point-of-interest (2D) /****************************************************************************/ @@ -32,10 +32,8 @@ #include #endif -#include -#include #include -#include +#include "Shape.h" // =========================================================================== @@ -45,43 +43,69 @@ * @class PointOfInterest * @brief A point-of-interest */ -class PointOfInterest : public RGBColor, public Position, public Named { +class PointOfInterest : public Shape, public Position { public: - /** @brief Constrcutor - * @param[in] id The id of the POI - * @param[in] type The (abstract) type of the poi - * @param[in] p The position of the poi - * @param[in] c The color of the poi + /** @brief Constructor + * @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] pos The position of the POI + * @param[in] width The width of the POI image + * @param[in] height The height of the POI image */ PointOfInterest(const std::string& id, const std::string& type, - const Position& p, const RGBColor& c) - : RGBColor(c), Position(p), Named(id), myType(type) { } - + const RGBColor& color, const Position& pos, + SUMOReal layer = DEFAULT_LAYER, + SUMOReal angle = DEFAULT_ANGLE, + const std::string& imgFile = DEFAULT_IMG_FILE, + SUMOReal width = DEFAULT_IMG_WIDTH, + SUMOReal height = DEFAULT_IMG_HEIGHT) : + Shape(id, type, color, layer, angle, imgFile), + Position(pos), + myHalfImgWidth(width / 2.0), + myHalfImgHeight(height / 2.0) + {} /// @brief Destructor virtual ~PointOfInterest() { } + /// @name Getter + /// @{ + /// @brief Returns whether the image width of the POI + inline SUMOReal getWidth() const { + return myHalfImgWidth * 2.0; + } - - /** @brief Returns the (abstract) type of the poi - * @return The polygon's (abstract) type - */ - const std::string& getType() const { - return myType; + /// @brief Returns whether the image hidth of the POI + inline SUMOReal getHeight() const { + return myHalfImgHeight * 2.0; } + /// @} - /** @brief Sets a new type - * @param[in] type The new type to use - */ - void setType(const std::string& type) { - myType = type; + /// @name Setter + /// @{ + /// @brief set the image width of the POI + inline void setWidth(SUMOReal width) { + myHalfImgWidth = width / 2.0; + } + + /// @brief set the image height of the POI + inline void setHeight(SUMOReal height) { + myHalfImgHeight = height / 2.0; } + /// @} protected: - /// @brief the type of the poi - std::string myType; + ///@brief The half width of the image when rendering this POI + SUMOReal myHalfImgWidth; + + ///@brief The half height of the image when rendering this POI + SUMOReal myHalfImgHeight; }; diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/Polygon.cpp sumo-0.16.0~dfsg/src/utils/shapes/Polygon.cpp --- sumo-0.15.0~dfsg/src/utils/shapes/Polygon.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/Polygon.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Jun 2004 -/// @version $Id: Polygon.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Polygon.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // A 2D-polygon /****************************************************************************/ @@ -30,7 +30,7 @@ #endif #include "Polygon.h" -#include +using namespace SUMO; #ifdef CHECK_MEMORY_LEAKS #include @@ -40,10 +40,13 @@ // =========================================================================== // member definitions // =========================================================================== -Polygon::Polygon(const std::string& name, const std::string& type, - const RGBColor& color, const PositionVector& shape, - bool fill) - : myName(name), myType(type), myColor(color), myShape(shape), myFill(fill) {} +Polygon::Polygon(const std::string& id, const std::string& type, + const RGBColor& color, const PositionVector& shape, bool fill, + SUMOReal layer, SUMOReal angle, const std::string& imgFile) : + Shape(id, type, color, layer, angle, imgFile), + myShape(shape), + myFill(fill) +{} Polygon::~Polygon() {} diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/Polygon.h sumo-0.16.0~dfsg/src/utils/shapes/Polygon.h --- sumo-0.15.0~dfsg/src/utils/shapes/Polygon.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/Polygon.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Jun 2004 -/// @version $Id: Polygon.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: Polygon.h 13107 2012-12-02 13:57:34Z behrisch $ /// // A 2D- or 3D-polygon /****************************************************************************/ @@ -31,13 +31,11 @@ #include #endif -#include -#include #include -#include -#include -#include +#include "Shape.h" +// we need to put this into a namespace to avoid clashing with wingdi.h::Polygon function +namespace SUMO { // =========================================================================== // class definitions @@ -46,63 +44,41 @@ * @class Polygon * @brief A 2D- or 3D-polygon */ -class Polygon { +class Polygon : public Shape { public: /** @brief Constructor - * @param[in] name The name of the polygon + * @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] shape The shape of the poslygon + * @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] shape The shape of the polygon * @param[in] fill Whether the polygon shall be filled */ - Polygon(const std::string& name, const std::string& type, - const RGBColor& color, const PositionVector& shape, bool fill) ; - + Polygon(const std::string& id, const std::string& type, + const RGBColor& color, const PositionVector& shape, bool fill, + SUMOReal layer = DEFAULT_LAYER, + SUMOReal angle = DEFAULT_ANGLE, + const std::string& imgFile = DEFAULT_IMG_FILE); /// @brief Destructor - virtual ~Polygon() ; - + virtual ~Polygon(); /// @name Getter /// @{ - - /** @brief Returns the name of the polygon - * @return The polygon's id + /** @brief Returns whether the shape of the polygon + * @return The shape of the polygon */ - const std::string& getID() const { - return myName; - } - - - /** @brief Returns the (abstract) type of the polygon - * @return The polygon's (abstract) type - */ - const std::string& getType() const { - return myType; - } - - - /** @brief Returns the color of the polygon - * @return The polygon's color - */ - const RGBColor& getColor() const { - return myColor; - } - - - /** @brief Returns the shape of the polygon - * @return The polygon's shape - */ - const PositionVector& getShape() const { + inline const PositionVector& getShape() const { return myShape; } - /** @brief Returns whether the polygon is filled * @return Whether the polygon is filled */ - bool fill() const { + inline bool getFill() const { return myFill; } /// @} @@ -111,50 +87,24 @@ /// @name Setter /// @{ - - /** @brief Sets a new type - * @param[in] type The new type to use - */ - void setType(const std::string& type) { - myType = type; - } - - - /** @brief Sets a new color - * @param[in] col The new color to use + /** @brief Sets whether the polygon shall be filled + * @param[in] fill Whether the polygon shall be filled */ - void setColor(const RGBColor& col) { - myColor = col; + inline void setFill(bool fill) { + myFill = fill; } - /** @brief Sets a new shape - * @param[in] shape The new shape to use + /** @brief Sets the shape of the polygon + * @param[in] shape The new shape of the polygon */ - void setShape(const PositionVector& shape) { + inline virtual void setShape(const PositionVector& shape) { myShape = shape; } - - - /** @brief Sets whether the polygon shall be filled - * @param[in] fill Whether the polygon shall be filled - */ - void setFill(bool fill) { - myFill = fill; - } /// @} protected: - /// @brief The name of the polygon - std::string myName; - - /// @brief The type of the polygon - std::string myType; - - /// @brief The color of the polygon - RGBColor myColor; - /// @brief The positions of the polygon PositionVector myShape; @@ -163,6 +113,7 @@ }; +} #endif diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/Shape.cpp sumo-0.16.0~dfsg/src/utils/shapes/Shape.cpp --- sumo-0.15.0~dfsg/src/utils/shapes/Shape.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/Shape.cpp 2012-12-02 13:45:18.000000000 +0000 @@ -0,0 +1,65 @@ +/****************************************************************************/ +/// @file Shape.cpp +/// @author Jakob Erdmann +/// @date Oct 2012 +/// @version $Id: Shape.cpp 13106 2012-12-02 13:44:57Z behrisch $ +/// +// A 2D- or 3D-Shape +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "Shape.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +// =========================================================================== +// static member definitions +// =========================================================================== +const SUMOReal Shape::DEFAULT_LAYER = 128; +const SUMOReal Shape::DEFAULT_ANGLE = 0; +const std::string Shape::DEFAULT_IMG_FILE = ""; +const SUMOReal Shape::DEFAULT_IMG_WIDTH = 1; +const SUMOReal Shape::DEFAULT_IMG_HEIGHT = 1; + +// =========================================================================== +// member definitions +// =========================================================================== +Shape::Shape(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, + SUMOReal angle, const std::string& imgFile) : + Named(id), + myType(type), + myColor(color), + myLayer(layer), + myAngle(angle), + myImgFile(imgFile) +{} + + +Shape::~Shape() {} + + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/Shape.h sumo-0.16.0~dfsg/src/utils/shapes/Shape.h --- sumo-0.15.0~dfsg/src/utils/shapes/Shape.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/Shape.h 2012-12-02 13:45:18.000000000 +0000 @@ -0,0 +1,175 @@ +/****************************************************************************/ +/// @file Shape.h +/// @author Jakob Erdmann +/// @date Oct 2012 +/// @version $Id: Shape.h 13106 2012-12-02 13:44:57Z behrisch $ +/// +// A 2D- or 3D-Shape +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef Shape_h +#define Shape_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class Shape + * @brief A 2D- or 3D-Shape + */ +class Shape : public Named { +public: + /** @brief Constructor + * @param[in] id The name of the shape + * @param[in] type The (abstract) type of the shape + * @param[in] color The color of the shape + * @param[in] layer The layer of the shape + * @param[in] angle The rotation of the shape + * @param[in] imgFile The raster image of the shape + */ + Shape(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, + SUMOReal angle, const std::string& imgFile); + + + /// @brief Destructor + virtual ~Shape(); + + + /// @name Getter + /// @{ + + /** @brief Returns the (abstract) type of the Shape + * @return The Shape's (abstract) type + */ + inline const std::string& getType() const { + return myType; + } + + + /** @brief Returns the color of the Shape + * @return The Shape's color + */ + inline const RGBColor& getColor() const { + return myColor; + } + + + /** @brief Returns the layer of the Shape + * @return The Shape's layer + */ + inline SUMOReal getLayer() const { + return myLayer; + } + + /** @brief Returns the angle of the Shape + * @return The Shape's rotation angle + */ + inline SUMOReal getAngle() const { + return myAngle; + } + + /** @brief Returns the imgFile of the Shape + * @return The Shape's rotation imgFile + */ + inline const std::string& getImgFile() const { + return myImgFile; + } + /// @} + + + /// @name Setter + /// @{ + + /** @brief Sets a new type + * @param[in] type The new type to use + */ + inline void setType(const std::string& type) { + myType = type; + } + + + /** @brief Sets a new color + * @param[in] col The new color to use + */ + inline void setColor(const RGBColor& col) { + myColor = col; + } + + + /** @brief Sets a new layer + * @param[in] layer The new layer to use + */ + inline void setLayer(const SUMOReal layer) { + myLayer = layer; + } + + + /** @brief Sets a new angle + * @param[in] layer The new angle to use + */ + inline void setAngle(const SUMOReal angle) { + myAngle = angle; + } + + /** @brief Sets a new imgFile + * @param[in] imgFile The new imgFile to use + */ + inline void setImgFile(const std::string& imgFile) { + myImgFile = imgFile; + } + /// @} + + static const SUMOReal DEFAULT_LAYER; + static const SUMOReal DEFAULT_ANGLE; + static const std::string DEFAULT_IMG_FILE; + static const SUMOReal DEFAULT_IMG_WIDTH; + static const SUMOReal DEFAULT_IMG_HEIGHT; + +protected: + /// @brief The type of the Shape + std::string myType; + + /// @brief The color of the Shape + RGBColor myColor; + + /// @brief The layer of the Shape + SUMOReal myLayer; + + /// @brief The angle of the Shape + SUMOReal myAngle; + + /// @brief The angle of the Shape + std::string myImgFile; +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/ShapeContainer.cpp sumo-0.16.0~dfsg/src/utils/shapes/ShapeContainer.cpp --- sumo-0.15.0~dfsg/src/utils/shapes/ShapeContainer.cpp 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/ShapeContainer.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ShapeContainer.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ShapeContainer.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for geometrical objects, sorted by the layers they are in /****************************************************************************/ @@ -53,18 +53,17 @@ // =========================================================================== // method definitions // =========================================================================== -ShapeContainer::ShapeContainer() - : myMinLayer(100), myMaxLayer(-100) {} - +ShapeContainer::ShapeContainer() {} ShapeContainer::~ShapeContainer() {} - bool -ShapeContainer::addPoI(const std::string& name, int layer, const std::string& type, const RGBColor& c, - const Position& pos) { - PointOfInterest* p = new PointOfInterest(name, type, pos, c); - if (!add(layer, p)) { +ShapeContainer::addPolygon(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, + SUMOReal angle, const std::string& imgFile, + const PositionVector& shape, bool fill) { + Polygon* p = new Polygon(id, type, color, shape, fill, layer, angle, imgFile); + if (!myPolygons.add(id, p)) { delete p; return false; } @@ -73,10 +72,11 @@ bool -ShapeContainer::addPolygon(const std::string& name, int layer, const std::string& type, const RGBColor& c, - bool filled, const PositionVector& shape) { - Polygon* p = new Polygon(name, type, c, shape, filled); - if (!add(layer, p)) { +ShapeContainer::addPOI(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile, + const Position& pos, SUMOReal width, SUMOReal height) { + PointOfInterest* p = new PointOfInterest(id, type, color, pos, layer, angle, imgFile, width, height); + if (!myPOIs.add(id, p)) { delete p; return false; } @@ -84,94 +84,35 @@ } - bool -ShapeContainer::removePolygon(int layer, const std::string& id) { - if (myPolygonLayers.find(layer) == myPolygonLayers.end()) { - return false; - } - return myPolygonLayers.find(layer)->second.remove(id); +ShapeContainer::removePolygon(const std::string& id) { + return myPolygons.remove(id); } bool -ShapeContainer::removePoI(int layer, const std::string& id) { - if (myPOILayers.find(layer) == myPOILayers.end()) { - return false; - } - return myPOILayers.find(layer)->second.remove(id); +ShapeContainer::removePOI(const std::string& id) { + return myPOIs.remove(id); } void -ShapeContainer::movePoI(int layer, const std::string& id, const Position& pos) { - if (myPOILayers.find(layer) != myPOILayers.end()) { - PointOfInterest* p = myPOILayers.find(layer)->second.get(id); - if (p != 0) { - static_cast(p)->set(pos); - } +ShapeContainer::movePOI(const std::string& id, const Position& pos) { + PointOfInterest* p = myPOIs.get(id); + if (p != 0) { + static_cast(p)->set(pos); } } void -ShapeContainer::reshapePolygon(int layer, const std::string& id, const PositionVector& shape) { - if (myPolygonLayers.find(layer) != myPolygonLayers.end()) { - Polygon* p = myPolygonLayers.find(layer)->second.get(id); - if (p != 0) { - p->setShape(shape); - } +ShapeContainer::reshapePolygon(const std::string& id, const PositionVector& shape) { + Polygon* p = myPolygons.get(id); + if (p != 0) { + p->setShape(shape); } } - - -const NamedObjectCont & -ShapeContainer::getPolygonCont(int layer) const { - if (myPolygonLayers.find(layer) == myPolygonLayers.end()) { - myPolygonLayers[layer] = NamedObjectCont(); - myMinLayer = MIN2(layer, myMinLayer); - myMaxLayer = MAX2(layer, myMaxLayer); - } - return myPolygonLayers[layer]; -} - - -const NamedObjectCont & -ShapeContainer::getPOICont(int layer) const { - if (myPOILayers.find(layer) == myPOILayers.end()) { - myPOILayers[layer] = NamedObjectCont(); - myMinLayer = MIN2(layer, myMinLayer); - myMaxLayer = MAX2(layer, myMaxLayer); - } - return myPOILayers[layer]; -} - - - -bool -ShapeContainer::add(int layer, Polygon* p) { - if (myPolygonLayers.find(layer) == myPolygonLayers.end()) { - myPolygonLayers[layer] = NamedObjectCont(); - myMinLayer = MIN2(layer, myMinLayer); - myMaxLayer = MAX2(layer, myMaxLayer); - } - return myPolygonLayers[layer].add(p->getID(), p); -} - - -bool -ShapeContainer::add(int layer, PointOfInterest* p) { - if (myPOILayers.find(layer) == myPOILayers.end()) { - myPOILayers[layer] = NamedObjectCont(); - myMinLayer = MIN2(layer, myMinLayer); - myMaxLayer = MAX2(layer, myMaxLayer); - } - return myPOILayers[layer].add(p->getID(), p); -} - - - /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/shapes/ShapeContainer.h sumo-0.16.0~dfsg/src/utils/shapes/ShapeContainer.h --- sumo-0.15.0~dfsg/src/utils/shapes/ShapeContainer.h 2012-01-07 20:14:57.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/shapes/ShapeContainer.h 2012-12-02 13:57:49.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: ShapeContainer.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: ShapeContainer.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Storage for geometrical objects, sorted by the layers they are in /****************************************************************************/ @@ -33,13 +33,13 @@ #include #include - +#include "PointOfInterest.h" +#include "Polygon.h" +using namespace SUMO; // =========================================================================== // class declarations // =========================================================================== -class Polygon; -class PointOfInterest; class Position; class PositionVector; class RGBColor; @@ -50,140 +50,103 @@ // =========================================================================== /** * @class ShapeContainer - * @brief Storage for geometrical objects, sorted by the layers they are in + * @brief Storage for geometrical objects */ class ShapeContainer { public: /// @brief Constructor - ShapeContainer() ; + ShapeContainer(); /// @brief Destructor - virtual ~ShapeContainer() ; - + virtual ~ShapeContainer(); + typedef NamedObjectCont Polygons; + typedef NamedObjectCont< PointOfInterest*> POIs; - /** @brief Builds a PoI using the given values and adds it to the according layer - * @param[in] name The name of the PoI to add - * @param[in] layer The layer to add the PoI to - * @param[in] type The type of the PoI to add - * @param[in] c The color of the PoI to add - * @param[in] pos The position of the PoI to add - * @return Whether the PoI could be added (no other with same id exists in the layer) - * @see ShapeContainer::addPoI - */ - virtual bool addPoI(const std::string& name, int layer, const std::string& type, - const RGBColor& c, const Position& pos) ; - - - /** @brief Builds a polygon using the given values and adds it to the according layer - * @param[in] name The name of the polygon to add - * @param[in] layer The layer to add the polygon to - * @param[in] type The type of the polygon to add - * @param[in] c The color of the polygon to add - * @param[in] shape The shape of the polygon to add - * @return Whether the polygon could be added (no other with same id exists in the layer) - * @see ShapeContainer::addPolygon - */ - virtual bool addPolygon(const std::string& name, int layer, - const std::string& type, const RGBColor& c, bool filled, const PositionVector& shape) ; + /** @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] shape The shape of the polygon + * @param[in] fill Whether the polygon shall be filled + * @return whether the polygon could be added + */ + virtual bool addPolygon(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, + SUMOReal angle, const std::string& imgFile, + const PositionVector& shape, bool fill); + + + /** @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] 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] pos The position of the POI + * @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 + */ + virtual bool addPOI(const std::string& id, const std::string& type, + const RGBColor& color, SUMOReal layer, SUMOReal angle, const std::string& imgFile, + const Position& pos, SUMOReal width, SUMOReal height); /** @brief Removes a polygon from the container - * @param[in] layer The layer the polygon is located in * @param[in] id The id of the polygon * @return Whether the polygon could be removed */ - virtual bool removePolygon(int layer, const std::string& id) ; + virtual bool removePolygon(const std::string& id); /** @brief Removes a PoI from the container - * @param[in] layer The layer the PoI is located in * @param[in] id The id of the PoI * @return Whether the poi could be removed */ - virtual bool removePoI(int layer, const std::string& id) ; + virtual bool removePOI(const std::string& id); /** @brief Assigns a new position to the named PoI - * @param[in] layer The layer the PoI is located in * @param[in] id The id of the PoI to move * @param[in] pos The PoI's new position */ - virtual void movePoI(int layer, const std::string& id, const Position& pos) ; + virtual void movePOI(const std::string& id, const Position& pos); /** @brief Assigns a shape to the named polygon - * @param[in] layer The layer the polygon is located in * @param[in] id The id of the polygon to reshape * @param[in] shape The polygon's new shape */ - virtual void reshapePolygon(int layer, const std::string& id, const PositionVector& shape) ; - - - - /** @brief Returns the polygons located at the given layer - * @param[in] layer The layer of polygons to return - * @return The polygons at this layer - * @see NamedObjectCont - */ - const NamedObjectCont &getPolygonCont(int layer) const ; - - - /** @brief Returns the polygons located at the given layer - * @param[in] layer The layer of polygons to return - * @return The polygons at this layer - * @see NamedObjectCont - */ - const NamedObjectCont &getPOICont(int layer) const ; + virtual void reshapePolygon(const std::string& id, const PositionVector& shape); - /** @brief Returns the lowest layer - * @return The lowest layer - */ - int getMinLayer() const { - return myMinLayer; + /// @brief Returns all polygons + inline const Polygons& getPolygons() const { + return myPolygons; } - /** @brief Returns the highest layer - * @return The highest layer - */ - int getMaxLayer() const { - return myMaxLayer; + /// @brief Returns all pois + inline const POIs& getPOIs() const { + return myPOIs; } protected: - /** @brief Adds a polygon to the container - * @param[in] layer The layer the polygon is located in - * @param[in] p The polygon to add - * @return Whether the polygon could be added (no other with same name existed before) - */ - bool add(int layer, Polygon* p) ; - - - /** @brief Adds a PoI to the container - * @param[in] layer The layer the poi is located in - * @param[in] p The PoI to add - * @return Whether the PoI could be added (no other with same name existed before) - */ - bool add(int layer, PointOfInterest* p) ; - - -protected: - typedef std::map PolyMap; - /// @brief Polygon layers - mutable std::map > myPolygonLayers; - - /// @brief POI layers - mutable std::map > myPOILayers; + /// @brief stored Polygons + Polygons myPolygons; - /// @brief The minimum and the maximum layers - mutable int myMinLayer, myMaxLayer; + /// @brief stored POIs + POIs myPOIs; }; diff -Nru sumo-0.15.0~dfsg/src/utils/traci/Makefile.am sumo-0.16.0~dfsg/src/utils/traci/Makefile.am --- sumo-0.15.0~dfsg/src/utils/traci/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/traci/Makefile.am 2012-09-25 22:01:47.000000000 +0000 @@ -0,0 +1,3 @@ +noinst_LIBRARIES = libtraci.a + +libtraci_a_SOURCES = TraCIAPI.cpp TraCIAPI.h diff -Nru sumo-0.15.0~dfsg/src/utils/traci/Makefile.in sumo-0.16.0~dfsg/src/utils/traci/Makefile.in --- sumo-0.15.0~dfsg/src/utils/traci/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/traci/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -0,0 +1,501 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src/utils/traci +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libtraci_a_AR = $(AR) $(ARFLAGS) +libtraci_a_LIBADD = +am_libtraci_a_OBJECTS = TraCIAPI.$(OBJEXT) +libtraci_a_OBJECTS = $(am_libtraci_a_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libtraci_a_SOURCES) +DIST_SOURCES = $(libtraci_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_CPPFLAGS = @AM_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FOX_LDFLAGS = @FOX_LDFLAGS@ +GDAL_LDFLAGS = @GDAL_LDFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_FOX = @LIB_FOX@ +LIB_GDAL = @LIB_GDAL@ +LIB_GTEST = @LIB_GTEST@ +LIB_PROJ = @LIB_PROJ@ +LIB_XERCES = @LIB_XERCES@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OSG_LIBS = @OSG_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJ_LDFLAGS = @PROJ_LDFLAGS@ +PYTHON_LIBS = @PYTHON_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XERCES_CFLAGS = @XERCES_CFLAGS@ +XERCES_LDFLAGS = @XERCES_LDFLAGS@ +XERCES_LIBS = @XERCES_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LIBRARIES = libtraci.a +libtraci_a_SOURCES = TraCIAPI.cpp TraCIAPI.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/utils/traci/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/utils/traci/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libtraci.a: $(libtraci_a_OBJECTS) $(libtraci_a_DEPENDENCIES) + -rm -f libtraci.a + $(libtraci_a_AR) libtraci.a $(libtraci_a_OBJECTS) $(libtraci_a_LIBADD) + $(RANLIB) libtraci.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIAPI.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru sumo-0.15.0~dfsg/src/utils/traci/TraCIAPI.cpp sumo-0.16.0~dfsg/src/utils/traci/TraCIAPI.cpp --- sumo-0.15.0~dfsg/src/utils/traci/TraCIAPI.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/traci/TraCIAPI.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,1513 @@ +/****************************************************************************/ +/// @file TraCIAPI.h +/// @author Daniel Krajzewicz +/// @date 30.05.2012 +/// @version $Id: TraCIAPI.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// C++ TraCI client API implementation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "TraCIAPI.h" +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// member definitions +// =========================================================================== +// --------------------------------------------------------------------------- +// TraCIAPI-methods +// --------------------------------------------------------------------------- +#pragma warning ( disable : 4355) +TraCIAPI::TraCIAPI() + : edge(*this), gui(*this), inductionloop(*this), + junction(*this), lane(*this), multientryexit(*this), poi(*this), + polygon(*this), route(*this), simulation(*this), trafficlights(*this), + vehicletype(*this), + mySocket(0) {} +#pragma warning ( default : 4355 ) + + +TraCIAPI::~TraCIAPI() { + delete mySocket; +} + + +void +TraCIAPI::connect(const std::string& host, int port) { + mySocket = new tcpip::Socket(host, port); + try { + mySocket->connect(); + } catch (tcpip::SocketException&) { + delete mySocket; + mySocket = 0; + throw; + } +} + + +void +TraCIAPI::close() { + if (mySocket == 0) { + return; + } + mySocket->close(); + delete mySocket; + mySocket = 0; +} + + +void +TraCIAPI::send_commandSimulationStep(SUMOTime time) const { + tcpip::Storage outMsg; + // command length + outMsg.writeUnsignedByte(1 + 1 + 4); + // command id + outMsg.writeUnsignedByte(CMD_SIMSTEP2); + outMsg.writeInt(time); + // send request message + mySocket->sendExact(outMsg); +} + + +void +TraCIAPI::send_commandClose() const { + tcpip::Storage outMsg; + // command length + outMsg.writeUnsignedByte(1 + 1); + // command id + outMsg.writeUnsignedByte(CMD_CLOSE); + mySocket->sendExact(outMsg); +} + + +void +TraCIAPI::send_commandGetVariable(int domID, int varID, const std::string& objID, tcpip::Storage* add) const { + if (mySocket == 0) { + throw tcpip::SocketException("Socket is not initialised"); + } + tcpip::Storage outMsg; + // command length + unsigned int length = 1 + 1 + 1 + 4 + (int) objID.length(); + if (add != 0) { + length += (int)add->size(); + } + outMsg.writeUnsignedByte(length); + // command id + outMsg.writeUnsignedByte(domID); + // variable id + outMsg.writeUnsignedByte(varID); + // object id + outMsg.writeString(objID); + // additional values + if (add != 0) { + outMsg.writeStorage(*add); + } + // send request message + mySocket->sendExact(outMsg); +} + + +void +TraCIAPI::send_commandSetValue(int domID, int varID, const std::string& objID, tcpip::Storage& content) const { + if (mySocket == 0) { + throw tcpip::SocketException("Socket is not initialised"); + } + tcpip::Storage outMsg; + // command length (domID, varID, objID, dataType, data) + outMsg.writeUnsignedByte(1 + 1 + 1 + 4 + (int) objID.length() + (int)content.size()); + // command id + outMsg.writeUnsignedByte(domID); + // variable id + outMsg.writeUnsignedByte(varID); + // object id + outMsg.writeString(objID); + // data type + outMsg.writeStorage(content); + // send message + mySocket->sendExact(outMsg); +} + + +void +TraCIAPI::send_commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, + const std::vector& vars) const { + if (mySocket == 0) { + throw tcpip::SocketException("Socket is not initialised"); + } + tcpip::Storage outMsg; + // command length (domID, objID, beginTime, endTime, length, vars) + int varNo = (int) vars.size(); + outMsg.writeUnsignedByte(0); + outMsg.writeInt(5 + 1 + 4 + 4 + 4 + (int) objID.length() + 1 + varNo); + // command id + outMsg.writeUnsignedByte(domID); + // time + outMsg.writeInt(beginTime); + outMsg.writeInt(endTime); + // object id + outMsg.writeString(objID); + // command id + outMsg.writeUnsignedByte((int)vars.size()); + for (int i = 0; i < varNo; ++i) { + outMsg.writeUnsignedByte(vars[i]); + } + // send message + mySocket->sendExact(outMsg); +} + + +void +TraCIAPI::send_commandSubscribeObjectContext(int domID, const std::string& objID, int beginTime, int endTime, + int domain, SUMOReal range, const std::vector& vars) const { + if (mySocket == 0) { + throw tcpip::SocketException("Socket is not initialised"); + } + tcpip::Storage outMsg; + // command length (domID, objID, beginTime, endTime, length, vars) + int varNo = (int) vars.size(); + outMsg.writeUnsignedByte(0); + outMsg.writeInt(5 + 1 + 4 + 4 + 4 + (int) objID.length() + 1 + 8 + 1 + varNo); + // command id + outMsg.writeUnsignedByte(domID); + // time + outMsg.writeInt(beginTime); + outMsg.writeInt(endTime); + // object id + outMsg.writeString(objID); + // domain and range + outMsg.writeUnsignedByte(domain); + outMsg.writeDouble(range); + // command id + outMsg.writeUnsignedByte((int)vars.size()); + for (int i = 0; i < varNo; ++i) { + outMsg.writeUnsignedByte(vars[i]); + } + // send message + mySocket->sendExact(outMsg); +} + + + + +void +TraCIAPI::check_resultState(tcpip::Storage& inMsg, int command, bool ignoreCommandId, std::string* acknowledgement) const { + mySocket->receiveExact(inMsg); + int cmdLength; + int cmdId; + int resultType; + int cmdStart; + std::string msg; + try { + cmdStart = inMsg.position(); + cmdLength = inMsg.readUnsignedByte(); + cmdId = inMsg.readUnsignedByte(); + if (command != cmdId && !ignoreCommandId) { + throw tcpip::SocketException("#Error: received status response to command: " + toString(cmdId) + " but expected: " + toString(command)); + } + resultType = inMsg.readUnsignedByte(); + msg = inMsg.readString(); + } catch (std::invalid_argument&) { + throw tcpip::SocketException("#Error: an exception was thrown while reading result state message"); + } + switch (resultType) { + case RTYPE_ERR: + throw tcpip::SocketException(".. Answered with error to command (" + toString(command) + "), [description: " + msg + "]"); + case RTYPE_NOTIMPLEMENTED: + throw tcpip::SocketException(".. Sent command is not implemented (" + toString(command) + "), [description: " + msg + "]"); + case RTYPE_OK: + if (acknowledgement != 0) { + (*acknowledgement) = ".. Command acknowledged (" + toString(command) + "), [description: " + msg + "]"; + } + break; + default: + throw tcpip::SocketException(".. Answered with unknown result code(" + toString(resultType) + ") to command(" + toString(command) + "), [description: " + msg + "]"); + } + if ((cmdStart + cmdLength) != (int) inMsg.position()) { + throw tcpip::SocketException("#Error: command at position " + toString(cmdStart) + " has wrong length"); + } +} + + +void +TraCIAPI::check_commandGetResult(tcpip::Storage& inMsg, int command, int expectedType, bool ignoreCommandId) const { + inMsg.position(); // respStart + int length = inMsg.readUnsignedByte(); + if (length == 0) { + length = inMsg.readInt(); + } + int cmdId = inMsg.readUnsignedByte(); + if (!ignoreCommandId && cmdId != (command + 0x10)) { + throw tcpip::SocketException("#Error: received response with command id: " + toString(cmdId) + "but expected: " + toString(command + 0x10)); + } + if (expectedType >= 0) { + int valueDataType = inMsg.readUnsignedByte(); + if (valueDataType != expectedType) { + throw tcpip::SocketException("Expected " + toString(expectedType) + " but got " + toString(valueDataType)); + } + } +} + + +void +TraCIAPI::processGET(tcpip::Storage& inMsg, int command, int expectedType, bool ignoreCommandId) const { + check_resultState(inMsg, command, ignoreCommandId); + check_commandGetResult(inMsg, command, expectedType, ignoreCommandId); +} + + + + +SUMOTime +TraCIAPI::getSUMOTime(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_INTEGER); + return inMsg.readInt(); +} + + +int +TraCIAPI::getUnsignedByte(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_UBYTE); + return inMsg.readUnsignedByte(); +} + + +int +TraCIAPI::getByte(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_BYTE); + return inMsg.readByte(); +} + + +int +TraCIAPI::getInt(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_INTEGER); + return inMsg.readInt(); +} + + +SUMOReal +TraCIAPI::getFloat(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_FLOAT); + return inMsg.readFloat(); +} + + +SUMOReal +TraCIAPI::getDouble(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_DOUBLE); + return inMsg.readDouble(); +} + + +TraCIAPI::TraCIBoundary +TraCIAPI::getBoundingBox(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_BOUNDINGBOX); + TraCIBoundary b; + b.xMin = inMsg.readDouble(); + b.yMin = inMsg.readDouble(); + b.zMin = 0; + b.xMax = inMsg.readDouble(); + b.yMax = inMsg.readDouble(); + b.zMax = 0; + return b; +} + + +TraCIAPI::TraCIPositionVector +TraCIAPI::getPolygon(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_POLYGON); + unsigned int size = inMsg.readInt(); + TraCIPositionVector ret; + for (unsigned int i = 0; i < size; ++i) { + TraCIPosition p; + p.x = inMsg.readDouble(); + p.y = inMsg.readDouble(); + p.z = 0; + ret.push_back(p); + } + return ret; +} + + +TraCIAPI::TraCIPosition +TraCIAPI::getPosition(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, POSITION_2D); + TraCIPosition p; + p.x = inMsg.readDouble(); + p.y = inMsg.readDouble(); + p.z = 0; + return p; +} + + +std::string +TraCIAPI::getString(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_STRING); + return inMsg.readString(); +} + + +std::vector +TraCIAPI::getStringVector(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_STRINGLIST); + unsigned int size = inMsg.readInt(); + std::vector r; + for (unsigned int i = 0; i < size; ++i) { + r.push_back(inMsg.readString()); + } + return r; +} + + +TraCIAPI::TraCIColor +TraCIAPI::getColor(int cmd, int var, const std::string& id, tcpip::Storage* add) { + tcpip::Storage inMsg; + send_commandGetVariable(cmd, var, id, add); + processGET(inMsg, cmd, TYPE_COLOR); + TraCIColor c; + c.r = inMsg.readInt(); + c.g = inMsg.readInt(); + c.b = inMsg.readInt(); + c.a = inMsg.readInt(); + return c; +} + + + +// --------------------------------------------------------------------------- +// TraCIAPI::EdgeScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::EdgeScope::getIDList() const { + return myParent.getStringVector(CMD_GET_EDGE_VARIABLE, ID_LIST, ""); +} + +unsigned int +TraCIAPI::EdgeScope::getIDCount() const { + return myParent.getInt(CMD_GET_EDGE_VARIABLE, ID_COUNT, ""); +} + +SUMOReal +TraCIAPI::EdgeScope::getAdaptedTraveltime(const std::string& edgeID, SUMOTime time) const { + tcpip::Storage content; + content.writeInt(time); + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_CO2EMISSION, edgeID, &content); +} + +SUMOReal +TraCIAPI::EdgeScope::getEffort(const std::string& edgeID, SUMOTime time) const { + tcpip::Storage content; + content.writeInt(time); + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_CO2EMISSION, edgeID, &content); +} + +SUMOReal +TraCIAPI::EdgeScope::getCO2Emission(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_CO2EMISSION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getCOEmission(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_COEMISSION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getHCEmission(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_HCEMISSION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getPMxEmission(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_PMXEMISSION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getNOxEmission(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_NOXEMISSION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getFuelConsumption(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_FUELCONSUMPTION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getNoiseEmission(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_NOISEEMISSION, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getLastStepMeanSpeed(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, LAST_STEP_MEAN_SPEED, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getLastStepOccupancy(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, LAST_STEP_OCCUPANCY, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getLastStepLength(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, LAST_STEP_LENGTH, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getTraveltime(const std::string& edgeID) const { + return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_CURRENT_TRAVELTIME, edgeID); +} + +unsigned int +TraCIAPI::EdgeScope::getLastStepVehicleNumber(const std::string& edgeID) const { + return myParent.getInt(CMD_GET_EDGE_VARIABLE, LAST_STEP_VEHICLE_NUMBER, edgeID); +} + +SUMOReal +TraCIAPI::EdgeScope::getLastStepHaltingNumber(const std::string& edgeID) const { + return myParent.getInt(CMD_GET_EDGE_VARIABLE, LAST_STEP_VEHICLE_HALTING_NUMBER, edgeID); +} + +std::vector +TraCIAPI::EdgeScope::getLastStepVehicleIDs(const std::string& edgeID) const { + return myParent.getStringVector(CMD_GET_EDGE_VARIABLE, LAST_STEP_VEHICLE_ID_LIST, edgeID); +} + + + +void +TraCIAPI::EdgeScope::adaptTraveltime(const std::string& edgeID, SUMOReal time) const { + tcpip::Storage content; + content.writeDouble(time); + myParent.send_commandSetValue(CMD_SET_EDGE_VARIABLE, VAR_EDGE_TRAVELTIME, edgeID, content); +} + +void +TraCIAPI::EdgeScope::setEffort(const std::string& edgeID, SUMOReal effort) const { + tcpip::Storage content; + content.writeDouble(effort); + myParent.send_commandSetValue(CMD_SET_EDGE_VARIABLE, VAR_EDGE_EFFORT, edgeID, content); +} + +void +TraCIAPI::EdgeScope::setMaxSpeed(const std::string& edgeID, SUMOReal speed) const { + tcpip::Storage content; + content.writeDouble(speed); + myParent.send_commandSetValue(CMD_SET_EDGE_VARIABLE, VAR_MAXSPEED, edgeID, content); +} + + + + +// --------------------------------------------------------------------------- +// TraCIAPI::GUIScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::GUIScope::getIDList() const { + return myParent.getStringVector(CMD_GET_GUI_VARIABLE, ID_LIST, ""); +} + +SUMOReal +TraCIAPI::GUIScope::getZoom(const std::string& viewID) const { + return myParent.getDouble(CMD_GET_GUI_VARIABLE, VAR_VIEW_ZOOM, viewID); +} + +TraCIAPI::TraCIPosition +TraCIAPI::GUIScope::getOffset(const std::string& viewID) const { + return myParent.getPosition(CMD_GET_GUI_VARIABLE, VAR_VIEW_OFFSET, viewID); +} + +std::string +TraCIAPI::GUIScope::getSchema(const std::string& viewID) const { + return myParent.getString(CMD_GET_GUI_VARIABLE, VAR_VIEW_SCHEMA, viewID); +} + +TraCIAPI::TraCIBoundary +TraCIAPI::GUIScope::getBoundary(const std::string& viewID) const { + return myParent.getBoundingBox(CMD_GET_GUI_VARIABLE, VAR_VIEW_BOUNDARY, viewID); +} + + +void +TraCIAPI::GUIScope::setZoom(const std::string& viewID, SUMOReal zoom) const { + tcpip::Storage content; + content.writeDouble(zoom); + myParent.send_commandSetValue(CMD_SET_GUI_VARIABLE, VAR_VIEW_ZOOM, viewID, content); +} + +void +TraCIAPI::GUIScope::setOffset(const std::string& viewID, SUMOReal x, SUMOReal y) const { + tcpip::Storage content; + content.writeUnsignedByte(POSITION_2D); + content.writeDouble(x); + content.writeDouble(y); + myParent.send_commandSetValue(CMD_SET_GUI_VARIABLE, VAR_VIEW_OFFSET, viewID, content); +} + +void +TraCIAPI::GUIScope::setSchema(const std::string& viewID, const std::string& schemeName) const { + tcpip::Storage content; + content.writeString(schemeName); + myParent.send_commandSetValue(CMD_SET_GUI_VARIABLE, VAR_VIEW_SCHEMA, viewID, content); +} + +void +TraCIAPI::GUIScope::setBoundary(const std::string& viewID, SUMOReal xmin, SUMOReal ymin, SUMOReal xmax, SUMOReal ymax) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_BOUNDINGBOX); + content.writeDouble(xmin); + content.writeDouble(ymin); + content.writeDouble(xmax); + content.writeDouble(ymax); + myParent.send_commandSetValue(CMD_SET_GUI_VARIABLE, VAR_VIEW_BOUNDARY, viewID, content); +} + +void +TraCIAPI::GUIScope::screenshot(const std::string& viewID, const std::string& filename) const { + tcpip::Storage content; + content.writeString(filename); + myParent.send_commandSetValue(CMD_SET_GUI_VARIABLE, VAR_SCREENSHOT, viewID, content); +} + +void +TraCIAPI::GUIScope::trackVehicle(const std::string& viewID, const std::string& vehID) const { + tcpip::Storage content; + content.writeString(vehID); + myParent.send_commandSetValue(CMD_SET_GUI_VARIABLE, VAR_TRACK_VEHICLE, viewID, content); +} + + + + +// --------------------------------------------------------------------------- +// TraCIAPI::InductionLoopScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::InductionLoopScope::getIDList() const { + return myParent.getStringVector(CMD_GET_INDUCTIONLOOP_VARIABLE, ID_LIST, ""); +} + +SUMOReal +TraCIAPI::InductionLoopScope::getPosition(const std::string& loopID) const { + return myParent.getDouble(CMD_GET_INDUCTIONLOOP_VARIABLE, VAR_POSITION, loopID); +} + +std::string +TraCIAPI::InductionLoopScope::getLaneID(const std::string& loopID) const { + return myParent.getString(CMD_GET_INDUCTIONLOOP_VARIABLE, VAR_LANE_ID, loopID); +} + +unsigned int +TraCIAPI::InductionLoopScope::getLastStepVehicleNumber(const std::string& loopID) const { + return myParent.getInt(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_VEHICLE_NUMBER, loopID); +} + +SUMOReal +TraCIAPI::InductionLoopScope::getLastStepMeanSpeed(const std::string& loopID) const { + return myParent.getDouble(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_MEAN_SPEED, loopID); +} + +std::vector +TraCIAPI::InductionLoopScope::getLastStepVehicleIDs(const std::string& loopID) const { + return myParent.getStringVector(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_VEHICLE_ID_LIST, loopID); +} + +SUMOReal +TraCIAPI::InductionLoopScope::getLastStepOccupancy(const std::string& loopID) const { + return myParent.getDouble(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_OCCUPANCY, loopID); +} + +SUMOReal +TraCIAPI::InductionLoopScope::getLastStepMeanLength(const std::string& loopID) const { + return myParent.getDouble(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_LENGTH, loopID); +} + +SUMOReal +TraCIAPI::InductionLoopScope::getTimeSinceDetection(const std::string& loopID) const { + return myParent.getDouble(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_TIME_SINCE_DETECTION, loopID); +} + +unsigned int +TraCIAPI::InductionLoopScope::getVehicleData(const std::string& loopID) const { + return myParent.getInt(CMD_GET_INDUCTIONLOOP_VARIABLE, LAST_STEP_VEHICLE_DATA, loopID); +} + + + + +// --------------------------------------------------------------------------- +// TraCIAPI::JunctionScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::JunctionScope::getIDList() const { + return myParent.getStringVector(CMD_GET_JUNCTION_VARIABLE, ID_LIST, ""); +} + +TraCIAPI::TraCIPosition +TraCIAPI::JunctionScope::getPosition(const std::string& junctionID) const { + return myParent.getPosition(CMD_GET_JUNCTION_VARIABLE, VAR_POSITION, junctionID); +} + + + + +// --------------------------------------------------------------------------- +// TraCIAPI::LaneScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::LaneScope::getIDList() const { + return myParent.getStringVector(CMD_GET_LANE_VARIABLE, ID_LIST, ""); +} + +SUMOReal +TraCIAPI::LaneScope::getLength(const std::string& laneID) const { + return myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_LENGTH, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getMaxSpeed(const std::string& laneID) const { + return myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_MAXSPEED, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getWidth(const std::string& laneID) const { + return myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_WIDTH, laneID); +} + +std::vector +TraCIAPI::LaneScope::getAllowed(const std::string& laneID) const { + return myParent.getStringVector(CMD_GET_LANE_VARIABLE, LANE_ALLOWED, laneID); +} + +std::vector +TraCIAPI::LaneScope::getDisallowed(const std::string& laneID) const { + return myParent.getStringVector(CMD_GET_LANE_VARIABLE, LANE_DISALLOWED, laneID); +} + +unsigned int +TraCIAPI::LaneScope::getLinkNumber(const std::string& /* laneID */) const { + throw tcpip::SocketException("Not implemented!"); +} + +TraCIAPI::TraCIPositionVector +TraCIAPI::LaneScope::getShape(const std::string& laneID) const { + throw myParent.getPolygon(CMD_GET_LANE_VARIABLE, VAR_SHAPE, laneID); +} + +std::string +TraCIAPI::LaneScope::getEdgeID(const std::string& laneID) const { + throw myParent.getString(CMD_GET_LANE_VARIABLE, LANE_EDGE_ID, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getCO2Emission(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_CO2EMISSION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getCOEmission(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_COEMISSION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getHCEmission(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_HCEMISSION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getPMxEmission(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_PMXEMISSION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getNOxEmission(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_NOXEMISSION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getFuelConsumption(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_FUELCONSUMPTION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getNoiseEmission(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_NOISEEMISSION, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getLastStepMeanSpeed(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, LAST_STEP_MEAN_SPEED, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getLastStepOccupancy(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, LAST_STEP_OCCUPANCY, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getLastStepLength(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, LAST_STEP_LENGTH, laneID); +} + +SUMOReal +TraCIAPI::LaneScope::getTraveltime(const std::string& laneID) const { + throw myParent.getDouble(CMD_GET_LANE_VARIABLE, VAR_CURRENT_TRAVELTIME, laneID); +} + +unsigned int +TraCIAPI::LaneScope::getLastStepVehicleNumber(const std::string& laneID) const { + throw myParent.getInt(CMD_GET_LANE_VARIABLE, LAST_STEP_VEHICLE_NUMBER, laneID); +} + +unsigned int +TraCIAPI::LaneScope::getLastStepHaltingNumber(const std::string& laneID) const { + throw myParent.getInt(CMD_GET_LANE_VARIABLE, LAST_STEP_VEHICLE_HALTING_NUMBER, laneID); +} + +std::vector +TraCIAPI::LaneScope::getLastStepVehicleIDs(const std::string& laneID) const { + throw myParent.getStringVector(CMD_GET_LANE_VARIABLE, LAST_STEP_VEHICLE_ID_LIST, laneID); +} + + +void +TraCIAPI::LaneScope::setAllowed(const std::string& laneID, const std::vector& allowedClasses) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRINGLIST); + content.writeInt((int)allowedClasses.size()); + for (unsigned int i = 0; i < allowedClasses.size(); ++i) { + content.writeString(allowedClasses[i]); + } + myParent.send_commandSetValue(CMD_SET_LANE_VARIABLE, LANE_ALLOWED, laneID, content); +} + +void +TraCIAPI::LaneScope::setDisallowed(const std::string& laneID, const std::vector& disallowedClasses) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRINGLIST); + content.writeInt((int)disallowedClasses.size()); + for (unsigned int i = 0; i < disallowedClasses.size(); ++i) { + content.writeString(disallowedClasses[i]); + } + myParent.send_commandSetValue(CMD_SET_LANE_VARIABLE, LANE_DISALLOWED, laneID, content); +} + +void +TraCIAPI::LaneScope::setMaxSpeed(const std::string& laneID, SUMOReal speed) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(speed); + myParent.send_commandSetValue(CMD_SET_LANE_VARIABLE, VAR_MAXSPEED, laneID, content); +} + +void +TraCIAPI::LaneScope::setLength(const std::string& laneID, SUMOReal length) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(length); + myParent.send_commandSetValue(CMD_SET_LANE_VARIABLE, VAR_LENGTH, laneID, content); +} + + + +// --------------------------------------------------------------------------- +// TraCIAPI::MeMeScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::MeMeScope::getIDList() const { + return myParent.getStringVector(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, ID_LIST, ""); +} + +unsigned int +TraCIAPI::MeMeScope::getLastStepVehicleNumber(const std::string& detID) const { + return myParent.getInt(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, LAST_STEP_VEHICLE_NUMBER, detID); +} + +SUMOReal +TraCIAPI::MeMeScope::getLastStepMeanSpeed(const std::string& detID) const { + return myParent.getInt(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, LAST_STEP_MEAN_SPEED, detID); +} + +std::vector +TraCIAPI::MeMeScope::getLastStepVehicleIDs(const std::string& detID) const { + return myParent.getStringVector(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, LAST_STEP_VEHICLE_ID_LIST, detID); +} + +unsigned int +TraCIAPI::MeMeScope::getLastStepHaltingNumber(const std::string& detID) const { + return myParent.getInt(CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, LAST_STEP_VEHICLE_HALTING_NUMBER, detID); +} + + + +// --------------------------------------------------------------------------- +// TraCIAPI::POIScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::POIScope::getIDList() const { + return myParent.getStringVector(CMD_GET_POI_VARIABLE, ID_LIST, ""); +} + +std::string +TraCIAPI::POIScope::getType(const std::string& poiID) const { + return myParent.getString(CMD_GET_POI_VARIABLE, VAR_TYPE, poiID); +} + +TraCIAPI::TraCIPosition +TraCIAPI::POIScope::getPosition(const std::string& poiID) const { + return myParent.getPosition(CMD_GET_POI_VARIABLE, VAR_POSITION, poiID); +} + +TraCIAPI::TraCIColor +TraCIAPI::POIScope::getColor(const std::string& poiID) const { + return myParent.getColor(CMD_GET_POI_VARIABLE, VAR_COLOR, poiID); +} + + +void +TraCIAPI::POIScope::setType(const std::string& poiID, const std::string& setType) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(setType); + myParent.send_commandSetValue(CMD_SET_POI_VARIABLE, VAR_TYPE, poiID, content); +} + +void +TraCIAPI::POIScope::setPosition(const std::string& poiID, SUMOReal x, SUMOReal y) const { + tcpip::Storage content; + content.writeUnsignedByte(POSITION_2D); + content.writeDouble(x); + content.writeDouble(y); + myParent.send_commandSetValue(CMD_SET_POI_VARIABLE, VAR_POSITION, poiID, content); +} + +void +TraCIAPI::POIScope::setColor(const std::string& poiID, const TraCIColor& c) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_COLOR); + content.writeInt(c.r); + content.writeInt(c.g); + content.writeInt(c.b); + content.writeInt(c.a); + myParent.send_commandSetValue(CMD_SET_POI_VARIABLE, VAR_COLOR, poiID, content); +} + +void +TraCIAPI::POIScope::add(const std::string& poiID, SUMOReal x, SUMOReal y, const TraCIColor& c, const std::string& type, int layer) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_COMPOUND); + content.writeInt(4); + content.writeUnsignedByte(TYPE_STRING); + content.writeString(type); + content.writeUnsignedByte(TYPE_COLOR); + content.writeInt(c.r); + content.writeInt(c.g); + content.writeInt(c.b); + content.writeInt(c.a); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(layer); + content.writeUnsignedByte(POSITION_2D); + content.writeDouble(x); + content.writeDouble(y); + myParent.send_commandSetValue(CMD_SET_POI_VARIABLE, ADD, poiID, content); +} + +void +TraCIAPI::POIScope::remove(const std::string& poiID, int layer) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(layer); + myParent.send_commandSetValue(CMD_SET_POI_VARIABLE, REMOVE, poiID, content); +} + + + +// --------------------------------------------------------------------------- +// TraCIAPI::PolygonScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::PolygonScope::getIDList() const { + return myParent.getStringVector(CMD_GET_POLYGON_VARIABLE, ID_LIST, ""); +} + +std::string +TraCIAPI::PolygonScope::getType(const std::string& polygonID) const { + return myParent.getString(CMD_GET_POLYGON_VARIABLE, VAR_TYPE, polygonID); +} + +TraCIAPI::TraCIPositionVector +TraCIAPI::PolygonScope::getShape(const std::string& polygonID) const { + return myParent.getPolygon(CMD_GET_POLYGON_VARIABLE, VAR_SHAPE, polygonID); +} + +TraCIAPI::TraCIColor +TraCIAPI::PolygonScope::getColor(const std::string& polygonID) const { + return myParent.getColor(CMD_GET_POLYGON_VARIABLE, VAR_COLOR, polygonID); +} + + +void +TraCIAPI::PolygonScope::setType(const std::string& polygonID, const std::string& setType) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(setType); + myParent.send_commandSetValue(CMD_SET_POLYGON_VARIABLE, VAR_TYPE, polygonID, content); +} + +void +TraCIAPI::PolygonScope::setShape(const std::string& polygonID, const TraCIAPI::TraCIPositionVector& shape) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_POLYGON); + content.writeInt((int)shape.size()); + for (unsigned int i = 0; i < shape.size(); ++i) { + content.writeDouble(shape[i].x); + content.writeDouble(shape[i].y); + } + myParent.send_commandSetValue(CMD_SET_POLYGON_VARIABLE, VAR_POSITION, polygonID, content); +} + +void +TraCIAPI::PolygonScope::setColor(const std::string& polygonID, const TraCIColor& c) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_COLOR); + content.writeInt(c.r); + content.writeInt(c.g); + content.writeInt(c.b); + content.writeInt(c.a); + myParent.send_commandSetValue(CMD_SET_POLYGON_VARIABLE, VAR_COLOR, polygonID, content); +} + +void +TraCIAPI::PolygonScope::add(const std::string& polygonID, const TraCIAPI::TraCIPositionVector& shape, const TraCIColor& c, bool fill, const std::string& type, int layer) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_COMPOUND); + content.writeInt(4); + content.writeUnsignedByte(TYPE_STRING); + content.writeString(type); + content.writeUnsignedByte(TYPE_COLOR); + content.writeInt(c.r); + content.writeInt(c.g); + content.writeInt(c.b); + content.writeInt(c.a); + content.writeUnsignedByte(TYPE_UBYTE); + int f = fill ? 1 : 0; + content.writeUnsignedByte(f); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(layer); + content.writeUnsignedByte(TYPE_POLYGON); + content.writeInt((int)shape.size()); + for (unsigned int i = 0; i < shape.size(); ++i) { + content.writeDouble(shape[i].x); + content.writeDouble(shape[i].y); + } + myParent.send_commandSetValue(CMD_SET_POLYGON_VARIABLE, ADD, polygonID, content); +} + +void +TraCIAPI::PolygonScope::remove(const std::string& polygonID, int layer) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(layer); + myParent.send_commandSetValue(CMD_SET_POLYGON_VARIABLE, REMOVE, polygonID, content); +} + + + +// --------------------------------------------------------------------------- +// TraCIAPI::RouteScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::RouteScope::getIDList() const { + return myParent.getStringVector(CMD_GET_ROUTE_VARIABLE, ID_LIST, ""); +} + +std::vector +TraCIAPI::RouteScope::getEdges(const std::string& routeID) const { + return myParent.getStringVector(CMD_GET_ROUTE_VARIABLE, VAR_EDGES, routeID); +} + + +void +TraCIAPI::RouteScope::add(const std::string& routeID, const std::vector& edges) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRINGLIST); + content.writeStringList(edges); + myParent.send_commandSetValue(CMD_SET_ROUTE_VARIABLE, VAR_POSITION, routeID, content); +} + + + + + +// --------------------------------------------------------------------------- +// TraCIAPI::SimulationScope-methods +// --------------------------------------------------------------------------- +SUMOTime +TraCIAPI::SimulationScope::getCurrentTime() const { + return myParent.getSUMOTime(CMD_GET_SIM_VARIABLE, VAR_TIME_STEP, ""); +} + +unsigned int +TraCIAPI::SimulationScope::getLoadedNumber() const { + return (unsigned int) myParent.getInt(CMD_GET_SIM_VARIABLE, VAR_LOADED_VEHICLES_NUMBER, ""); +} + +std::vector +TraCIAPI::SimulationScope::getLoadedIDList() const { + return myParent.getStringVector(CMD_GET_SIM_VARIABLE, VAR_LOADED_VEHICLES_IDS, ""); +} + +unsigned int +TraCIAPI::SimulationScope::getDepartedNumber() const { + return (unsigned int) myParent.getInt(CMD_GET_SIM_VARIABLE, VAR_DEPARTED_VEHICLES_NUMBER, ""); +} + +std::vector +TraCIAPI::SimulationScope::getDepartedIDList() const { + return myParent.getStringVector(CMD_GET_SIM_VARIABLE, VAR_DEPARTED_VEHICLES_IDS, ""); +} + +unsigned int +TraCIAPI::SimulationScope::getArrivedNumber() const { + return (unsigned int) myParent.getInt(CMD_GET_SIM_VARIABLE, VAR_ARRIVED_VEHICLES_NUMBER, ""); +} + +std::vector +TraCIAPI::SimulationScope::getArrivedIDList() const { + return myParent.getStringVector(CMD_GET_SIM_VARIABLE, VAR_ARRIVED_VEHICLES_IDS, ""); +} + +unsigned int +TraCIAPI::SimulationScope::getStartingTeleportNumber() const { + return (unsigned int) myParent.getInt(CMD_GET_SIM_VARIABLE, VAR_TELEPORT_STARTING_VEHICLES_NUMBER, ""); +} + +std::vector +TraCIAPI::SimulationScope::getStartingTeleportIDList() const { + return myParent.getStringVector(CMD_GET_SIM_VARIABLE, VAR_TELEPORT_STARTING_VEHICLES_IDS, ""); +} + +unsigned int +TraCIAPI::SimulationScope::getEndingTeleportNumber() const { + return (unsigned int) myParent.getInt(CMD_GET_SIM_VARIABLE, VAR_TELEPORT_ENDING_VEHICLES_NUMBER, ""); +} + +std::vector +TraCIAPI::SimulationScope::getEndingTeleportIDList() const { + return myParent.getStringVector(CMD_GET_SIM_VARIABLE, VAR_TELEPORT_ENDING_VEHICLES_IDS, ""); +} + +SUMOTime +TraCIAPI::SimulationScope::getDeltaT() const { + return myParent.getSUMOTime(CMD_GET_SIM_VARIABLE, VAR_DELTA_T, ""); +} + +TraCIAPI::TraCIBoundary +TraCIAPI::SimulationScope::getNetBoundary() const { + return myParent.getBoundingBox(CMD_GET_SIM_VARIABLE, VAR_NET_BOUNDING_BOX, ""); +} + +unsigned int +TraCIAPI::SimulationScope::getMinExpectedNumber() const { + return myParent.getInt(CMD_GET_SIM_VARIABLE, VAR_MIN_EXPECTED_VEHICLES, ""); +} + + + +// --------------------------------------------------------------------------- +// TraCIAPI::TrafficLightScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::TrafficLightScope::getIDList() const { + return myParent.getStringVector(CMD_GET_TL_VARIABLE, ID_LIST, ""); +} + +std::string +TraCIAPI::TrafficLightScope::getRedYellowGreenState(const std::string& tlsID) const { + return myParent.getString(CMD_GET_TL_VARIABLE, TL_RED_YELLOW_GREEN_STATE, tlsID); +} + +std::vector +TraCIAPI::TrafficLightScope::getCompleteRedYellowGreenDefinition(const std::string& tlsID) const { + tcpip::Storage inMsg; + myParent.send_commandGetVariable(CMD_GET_TL_VARIABLE, TL_COMPLETE_DEFINITION_RYG, tlsID); + myParent.processGET(inMsg, CMD_GET_TL_VARIABLE, TYPE_COMPOUND); + std::vector ret; + int logicNo = inMsg.readInt(); + for (int i = 0; i < logicNo; ++i) { + inMsg.readUnsignedByte(); + std::string subID = inMsg.readString(); + inMsg.readUnsignedByte(); + int type = inMsg.readInt(); + inMsg.readUnsignedByte(); + inMsg.readInt(); // add + inMsg.readUnsignedByte(); + int phaseIndex = inMsg.readInt(); + inMsg.readUnsignedByte(); + int phaseNumber = inMsg.readInt(); + std::vector phases; + for (int j = 0; j < phaseNumber; ++j) { + inMsg.readUnsignedByte(); + int duration = inMsg.readInt(); + inMsg.readUnsignedByte(); + int duration1 = inMsg.readInt(); + inMsg.readUnsignedByte(); + int duration2 = inMsg.readInt(); + inMsg.readUnsignedByte(); + std::string phase = inMsg.readString(); + phases.push_back(TraCIAPI::TraCIPhase(duration, phase, duration1, duration2)); + } + ret.push_back(TraCIAPI::TraCILogic(subID, type, std::map(), phaseIndex, phases)); + } + return ret; +} + +std::vector +TraCIAPI::TrafficLightScope::getControlledLanes(const std::string& tlsID) const { + return myParent.getStringVector(CMD_GET_TL_VARIABLE, TL_CONTROLLED_LANES, tlsID); +} + +std::vector +TraCIAPI::TrafficLightScope::getControlledLinks(const std::string& tlsID) const { + tcpip::Storage inMsg; + myParent.send_commandGetVariable(CMD_GET_TL_VARIABLE, TL_CONTROLLED_LINKS, tlsID); + myParent.processGET(inMsg, CMD_GET_TL_VARIABLE, TYPE_COMPOUND); + std::vector ret; + int linkNo = inMsg.readInt(); + for (int i = 0; i < linkNo; ++i) { + inMsg.readUnsignedByte(); + std::string from = inMsg.readString(); + inMsg.readUnsignedByte(); + std::string via = inMsg.readString(); + inMsg.readUnsignedByte(); + std::string to = inMsg.readString(); + ret.push_back(TraCIAPI::TraCILink(from, via, to)); + } + return ret; +} + +std::string +TraCIAPI::TrafficLightScope::getProgram(const std::string& tlsID) const { + return myParent.getString(CMD_GET_TL_VARIABLE, TL_CURRENT_PROGRAM, tlsID); +} + +unsigned int +TraCIAPI::TrafficLightScope::getPhase(const std::string& tlsID) const { + return myParent.getInt(CMD_GET_TL_VARIABLE, TL_CURRENT_PHASE, tlsID); +} + +unsigned int +TraCIAPI::TrafficLightScope::getNextSwitch(const std::string& tlsID) const { + return myParent.getInt(CMD_GET_TL_VARIABLE, TL_NEXT_SWITCH, tlsID); +} + + +void +TraCIAPI::TrafficLightScope::setRedYellowGreenState(const std::string& tlsID, const std::string& state) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(state); + myParent.send_commandSetValue(CMD_SET_TL_VARIABLE, TL_RED_YELLOW_GREEN_STATE, tlsID, content); +} + +void +TraCIAPI::TrafficLightScope::setPhase(const std::string& tlsID, unsigned int index) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(index); + myParent.send_commandSetValue(CMD_SET_TL_VARIABLE, TL_PHASE_INDEX, tlsID, content); +} + +void +TraCIAPI::TrafficLightScope::setProgram(const std::string& tlsID, const std::string& programID) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(programID); + myParent.send_commandSetValue(CMD_SET_TL_VARIABLE, TL_PROGRAM, tlsID, content); +} + +void +TraCIAPI::TrafficLightScope::setPhaseDuration(const std::string& tlsID, unsigned int phaseDuration) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(int(1000 * phaseDuration)); + myParent.send_commandSetValue(CMD_SET_TL_VARIABLE, TL_PHASE_DURATION, tlsID, content); +} + +void +TraCIAPI::TrafficLightScope::setCompleteRedYellowGreenDefinition(const std::string& tlsID, const TraCIAPI::TraCILogic& logic) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_COMPOUND); + content.writeInt(5 + 4 * (int)logic.phases.size()); + content.writeUnsignedByte(TYPE_STRING); + content.writeString(logic.subID); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(logic.type); + content.writeUnsignedByte(TYPE_COMPOUND); + content.writeInt(0); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(logic.currentPhaseIndex); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt((int)logic.phases.size()); + for (int i = 0; i < (int) logic.phases.size(); ++i) { + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(logic.phases[i].duration); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(logic.phases[i].duration1); + content.writeUnsignedByte(TYPE_INTEGER); + content.writeInt(logic.phases[i].duration2); + content.writeUnsignedByte(TYPE_STRING); + content.writeString(logic.phases[i].phase); + } + myParent.send_commandSetValue(CMD_SET_TL_VARIABLE, TL_COMPLETE_PROGRAM_RYG, tlsID, content); +} + + + + + +// --------------------------------------------------------------------------- +// TraCIAPI::VehicleTypeScope-methods +// --------------------------------------------------------------------------- +std::vector +TraCIAPI::VehicleTypeScope::getIDList() const { + return myParent.getStringVector(CMD_GET_VEHICLETYPE_VARIABLE, ID_LIST, ""); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getLength(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_LENGTH, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getMaxSpeed(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_MAXSPEED, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getSpeedFactor(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_SPEED_FACTOR, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getSpeedDeviation(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_SPEED_DEVIATION, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getAccel(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_ACCEL, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getDecel(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_DECEL, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getImperfection(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_IMPERFECTION, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getTau(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_TAU, typeID); +} + +std::string +TraCIAPI::VehicleTypeScope::getVehicleClass(const std::string& typeID) const { + return myParent.getString(CMD_GET_TL_VARIABLE, VAR_VEHICLECLASS, typeID); +} + +std::string +TraCIAPI::VehicleTypeScope::getEmissionClass(const std::string& typeID) const { + return myParent.getString(CMD_GET_TL_VARIABLE, VAR_EMISSIONCLASS, typeID); +} + +std::string +TraCIAPI::VehicleTypeScope::getShapeClass(const std::string& typeID) const { + return myParent.getString(CMD_GET_TL_VARIABLE, VAR_SHAPECLASS, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getMinGap(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_MINGAP, typeID); +} + +SUMOReal +TraCIAPI::VehicleTypeScope::getWidth(const std::string& typeID) const { + return myParent.getDouble(CMD_GET_TL_VARIABLE, VAR_WIDTH, typeID); +} + +TraCIAPI::TraCIColor +TraCIAPI::VehicleTypeScope::getColor(const std::string& typeID) const { + return myParent.getColor(CMD_GET_TL_VARIABLE, VAR_COLOR, typeID); +} + + + +void +TraCIAPI::VehicleTypeScope::setLength(const std::string& typeID, SUMOReal length) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(length); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_LENGTH, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setMaxSpeed(const std::string& typeID, SUMOReal speed) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(speed); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_MAXSPEED, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setVehicleClass(const std::string& typeID, const std::string& clazz) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(clazz); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_VEHICLECLASS, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setSpeedFactor(const std::string& typeID, SUMOReal factor) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(factor); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_SPEED_FACTOR, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setSpeedDeviation(const std::string& typeID, SUMOReal deviation) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(deviation); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_SPEED_DEVIATION, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setEmissionClass(const std::string& typeID, const std::string& clazz) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(clazz); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_EMISSIONCLASS, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setWidth(const std::string& typeID, SUMOReal width) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(width); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_WIDTH, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setMinGap(const std::string& typeID, SUMOReal minGap) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(minGap); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_MINGAP, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setShapeClass(const std::string& typeID, const std::string& clazz) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_STRING); + content.writeString(clazz); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_SHAPECLASS, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setAccel(const std::string& typeID, SUMOReal accel) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(accel); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_ACCEL, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setDecel(const std::string& typeID, SUMOReal decel) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(decel); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_DECEL, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setImperfection(const std::string& typeID, SUMOReal imperfection) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(imperfection); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_IMPERFECTION, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setTau(const std::string& typeID, SUMOReal tau) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_DOUBLE); + content.writeDouble(tau); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_TAU, typeID, content); +} + +void +TraCIAPI::VehicleTypeScope::setColor(const std::string& typeID, const TraCIColor& c) const { + tcpip::Storage content; + content.writeUnsignedByte(TYPE_COLOR); + content.writeInt(c.r); + content.writeInt(c.g); + content.writeInt(c.b); + content.writeInt(c.a); + myParent.send_commandSetValue(CMD_SET_VEHICLETYPE_VARIABLE, VAR_COLOR, typeID, content); +} + + + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/traci/TraCIAPI.h sumo-0.16.0~dfsg/src/utils/traci/TraCIAPI.h --- sumo-0.15.0~dfsg/src/utils/traci/TraCIAPI.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/traci/TraCIAPI.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,735 @@ +/****************************************************************************/ +/// @file TraCIAPI.h +/// @author Daniel Krajzewicz +/// @date 30.05.2012 +/// @version $Id: TraCIAPI.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// C++ TraCI client API implementation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef TraCIAPI_h +#define TraCIAPI_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include + + +// =========================================================================== +// global definitions +// =========================================================================== +#define DEFAULT_VIEW "View #0" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIAPI + * @brief C++ TraCI client API implementation + */ +class TraCIAPI { +public: + /// @name Structures definitions + /// @{ + + /** @struct TraCIPosition + * @brief A 3D-position + */ + struct TraCIPosition { + double x, y, z; + }; + + /** @struct TraCIPosition + * @brief A color + */ + struct TraCIColor { + int r, g, b, a; + }; + + /** @struct TraCIPositionVector + * @brief A list of positions + */ + typedef std::vector TraCIPositionVector; + + /** @struct TraCIBoundary + * @brief A 3D-bounding box + */ + struct TraCIBoundary { + double xMin, yMin, zMin; + double xMax, yMax, zMax; + }; + + + + class TraCIPhase { + public: + TraCIPhase(SUMOTime _duration, const std::string& _phase, SUMOTime _duration1, SUMOTime _duration2) + : duration(_duration), phase(_phase), duration1(_duration1), duration2(_duration2) {} + ~TraCIPhase() {} + + SUMOTime duration, duration1, duration2; + std::string phase; + }; + + + class TraCILogic { + public: + TraCILogic(const std::string& _subID, int _type, const std::map& _subParameter, unsigned int _currentPhaseIndex, const std::vector& _phases) + : subID(_subID), type(_type), subParameter(_subParameter), currentPhaseIndex(_currentPhaseIndex), phases(_phases) {} + ~TraCILogic() {} + + std::string subID; + int type; + std::map subParameter; + unsigned int currentPhaseIndex; + std::vector phases; + }; + + class TraCILink { + public: + TraCILink(const std::string& _from, const std::string& _via, const std::string& _to) + : from(_from), via(_via), to(_to) {} + ~TraCILink() {} + + std::string from; + std::string via; + std::string to; + }; + + /// @} + + + + /** @brief Constructor + */ + TraCIAPI(); + + + /// @brief Destructor + ~TraCIAPI(); + + + /// @name Connection handling + /// @{ + + /** @brief Connects to the specified SUMO server + * @param[in] host The name of the host to connect to + * @param[in] port The port to connect to + * @exception tcpip::SocketException if the connection fails + */ + void connect(const std::string& host, int port); + + + /// @brief Closes the connection + void close(); + /// @} + + + + /// @name Atomar getter + /// @{ + + SUMOTime getSUMOTime(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + int getUnsignedByte(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + int getByte(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + int getInt(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + SUMOReal getFloat(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + SUMOReal getDouble(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + TraCIBoundary getBoundingBox(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + TraCIPositionVector getPolygon(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + TraCIPosition getPosition(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + std::string getString(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + std::vector getStringVector(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + TraCIColor getColor(int cmd, int var, const std::string& id, tcpip::Storage* add = 0); + /// @} + + + + /** @class TraCIScopeWrapper + * @brief An abstract interface for accessing type-dependent values + * + * Must be derived by interfaces which implement access methods to certain object types + */ + class TraCIScopeWrapper { + public: + /** @brief Constructor + * @param[in] parent The parent TraCI client which offers the connection + */ + TraCIScopeWrapper(TraCIAPI& parent) : myParent(parent) {} + + /// @brief Destructor + virtual ~TraCIScopeWrapper() {} + + + protected: + /// @brief The parent TraCI client which offers the connection + TraCIAPI& myParent; + + + private: + /// @brief invalidated copy constructor + TraCIScopeWrapper(const TraCIScopeWrapper& src); + + /// @brief invalidated assignment operator + TraCIScopeWrapper& operator=(const TraCIScopeWrapper& src); + + }; + + + + + + /** @class EdgeScope + * @brief Scope for interaction with edges + */ + class EdgeScope : public TraCIScopeWrapper { + public: + EdgeScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~EdgeScope() {} + + std::vector getIDList() const; + unsigned int getIDCount() const; + SUMOReal getAdaptedTraveltime(const std::string& edgeID, SUMOTime time) const; + SUMOReal getEffort(const std::string& edgeID, SUMOTime time) const; + SUMOReal getCO2Emission(const std::string& edgeID) const; + SUMOReal getCOEmission(const std::string& edgeID) const; + SUMOReal getHCEmission(const std::string& edgeID) const; + SUMOReal getPMxEmission(const std::string& edgeID) const; + SUMOReal getNOxEmission(const std::string& edgeID) const; + SUMOReal getFuelConsumption(const std::string& edgeID) const; + SUMOReal getNoiseEmission(const std::string& edgeID) const; + SUMOReal getLastStepMeanSpeed(const std::string& edgeID) const; + SUMOReal getLastStepOccupancy(const std::string& edgeID) const; + SUMOReal getLastStepLength(const std::string& edgeID) const; + SUMOReal getTraveltime(const std::string& edgeID) const; + unsigned int getLastStepVehicleNumber(const std::string& edgeID) const; + SUMOReal getLastStepHaltingNumber(const std::string& edgeID) const; + std::vector getLastStepVehicleIDs(const std::string& edgeID) const; + + void adaptTraveltime(const std::string& edgeID, SUMOReal time) const; + void setEffort(const std::string& edgeID, SUMOReal effort) const; + void setMaxSpeed(const std::string& edgeID, SUMOReal speed) const; + + private: + /// @brief invalidated copy constructor + EdgeScope(const EdgeScope& src); + + /// @brief invalidated assignment operator + EdgeScope& operator=(const EdgeScope& src); + + }; + + + + + + /** @class GUIScope + * @brief Scope for interaction with the gui + */ + class GUIScope : public TraCIScopeWrapper { + public: + GUIScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~GUIScope() {} + + std::vector getIDList() const; + SUMOReal getZoom(const std::string& viewID = DEFAULT_VIEW) const; + TraCIPosition getOffset(const std::string& viewID = DEFAULT_VIEW) const; + std::string getSchema(const std::string& viewID = DEFAULT_VIEW) const; + TraCIBoundary getBoundary(const std::string& viewID = DEFAULT_VIEW) const; + void setZoom(const std::string& viewID, SUMOReal zoom) const; + void setOffset(const std::string& viewID, SUMOReal x, SUMOReal y) const; + void setSchema(const std::string& viewID, const std::string& schemeName) const; + void setBoundary(const std::string& viewID, SUMOReal xmin, SUMOReal ymin, SUMOReal xmax, SUMOReal ymax) const; + void screenshot(const std::string& viewID, const std::string& filename) const; + void trackVehicle(const std::string& viewID, const std::string& vehID) const; + + private: + /// @brief invalidated copy constructor + GUIScope(const GUIScope& src); + + /// @brief invalidated assignment operator + GUIScope& operator=(const GUIScope& src); + + }; + + + + + + /** @class InductionLoopScope + * @brief Scope for interaction with inductive loops + */ + class InductionLoopScope : public TraCIScopeWrapper { + public: + InductionLoopScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~InductionLoopScope() {} + + std::vector getIDList() const; + SUMOReal getPosition(const std::string& loopID) const; + std::string getLaneID(const std::string& loopID) const; + unsigned int getLastStepVehicleNumber(const std::string& loopID) const; + SUMOReal getLastStepMeanSpeed(const std::string& loopID) const; + std::vector getLastStepVehicleIDs(const std::string& loopID) const; + SUMOReal getLastStepOccupancy(const std::string& loopID) const; + SUMOReal getLastStepMeanLength(const std::string& loopID) const; + SUMOReal getTimeSinceDetection(const std::string& loopID) const; + unsigned int getVehicleData(const std::string& loopID) const; + + private: + /// @brief invalidated copy constructor + InductionLoopScope(const InductionLoopScope& src); + + /// @brief invalidated assignment operator + InductionLoopScope& operator=(const InductionLoopScope& src); + + }; + + + + + + /** @class JunctionScope + * @brief Scope for interaction with junctions + */ + class JunctionScope : public TraCIScopeWrapper { + public: + JunctionScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~JunctionScope() {} + + std::vector getIDList() const; + TraCIPosition getPosition(const std::string& junctionID) const; + + private: + /// @brief invalidated copy constructor + JunctionScope(const JunctionScope& src); + + /// @brief invalidated assignment operator + JunctionScope& operator=(const JunctionScope& src); + + }; + + + + + + /** @class LaneScope + * @brief Scope for interaction with lanes + */ + class LaneScope : public TraCIScopeWrapper { + public: + LaneScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~LaneScope() {} + + std::vector getIDList() const; + SUMOReal getLength(const std::string& laneID) const; + SUMOReal getMaxSpeed(const std::string& laneID) const; + SUMOReal getWidth(const std::string& laneID) const; + std::vector getAllowed(const std::string& laneID) const; + std::vector getDisallowed(const std::string& laneID) const; + unsigned int getLinkNumber(const std::string& laneID) const; + TraCIPositionVector getShape(const std::string& laneID) const; + std::string getEdgeID(const std::string& laneID) const; + SUMOReal getCO2Emission(const std::string& laneID) const; + SUMOReal getCOEmission(const std::string& laneID) const; + SUMOReal getHCEmission(const std::string& laneID) const; + SUMOReal getPMxEmission(const std::string& laneID) const; + SUMOReal getNOxEmission(const std::string& laneID) const; + SUMOReal getFuelConsumption(const std::string& laneID) const; + SUMOReal getNoiseEmission(const std::string& laneID) const; + SUMOReal getLastStepMeanSpeed(const std::string& laneID) const; + SUMOReal getLastStepOccupancy(const std::string& laneID) const; + SUMOReal getLastStepLength(const std::string& laneID) const; + SUMOReal getTraveltime(const std::string& laneID) const; + unsigned int getLastStepVehicleNumber(const std::string& laneID) const; + unsigned int getLastStepHaltingNumber(const std::string& laneID) const; + std::vector getLastStepVehicleIDs(const std::string& laneID) const; + + void setAllowed(const std::string& laneID, const std::vector& allowedClasses) const; + void setDisallowed(const std::string& laneID, const std::vector& disallowedClasses) const; + void setMaxSpeed(const std::string& laneID, SUMOReal speed) const; + void setLength(const std::string& laneID, SUMOReal length) const; + + private: + /// @brief invalidated copy constructor + LaneScope(const LaneScope& src); + + /// @brief invalidated assignment operator + LaneScope& operator=(const LaneScope& src); + + }; + + + + + + /** @class MeMeScope + * @brief Scope for interaction with multi entry/-exit detectors + */ + class MeMeScope : public TraCIScopeWrapper { + public: + MeMeScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~MeMeScope() {} + + std::vector getIDList() const; + unsigned int getLastStepVehicleNumber(const std::string& detID) const; + SUMOReal getLastStepMeanSpeed(const std::string& detID) const; + std::vector getLastStepVehicleIDs(const std::string& detID) const; + unsigned int getLastStepHaltingNumber(const std::string& detID) const; + + private: + /// @brief invalidated copy constructor + MeMeScope(const MeMeScope& src); + + /// @brief invalidated assignment operator + MeMeScope& operator=(const MeMeScope& src); + + }; + + + + + + /** @class POIScope + * @brief Scope for interaction with POIs + */ + class POIScope : public TraCIScopeWrapper { + public: + POIScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~POIScope() {} + + std::vector getIDList() const; + std::string getType(const std::string& poiID) const; + TraCIPosition getPosition(const std::string& poiID) const; + TraCIColor getColor(const std::string& poiID) const; + + void setType(const std::string& poiID, const std::string& setType) const; + void setPosition(const std::string& poiID, SUMOReal x, SUMOReal y) const; + void setColor(const std::string& poiID, const TraCIColor& c) const; + void add(const std::string& poiID, SUMOReal x, SUMOReal y, const TraCIColor& c, const std::string& type, int layer) const; + void remove(const std::string& poiID, int layer = 0) const; + + private: + /// @brief invalidated copy constructor + POIScope(const POIScope& src); + + /// @brief invalidated assignment operator + POIScope& operator=(const POIScope& src); + + }; + + + + + + /** @class PolygonScope + * @brief Scope for interaction with polygons + */ + class PolygonScope : public TraCIScopeWrapper { + public: + PolygonScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~PolygonScope() {} + + std::vector getIDList() const; + std::string getType(const std::string& polygonID) const; + TraCIPositionVector getShape(const std::string& polygonID) const; + TraCIColor getColor(const std::string& polygonID) const; + void setType(const std::string& polygonID, const std::string& setType) const; + void setShape(const std::string& polygonID, const TraCIPositionVector& shape) const; + void setColor(const std::string& polygonID, const TraCIColor& c) const; + void add(const std::string& polygonID, const TraCIPositionVector& shape, const TraCIColor& c, bool fill, const std::string& type, int layer) const; + void remove(const std::string& polygonID, int layer = 0) const; + + private: + /// @brief invalidated copy constructor + PolygonScope(const PolygonScope& src); + + /// @brief invalidated assignment operator + PolygonScope& operator=(const PolygonScope& src); + + }; + + + + + + /** @class RouteScope + * @brief Scope for interaction with routes + */ + class RouteScope : public TraCIScopeWrapper { + public: + RouteScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~RouteScope() {} + + std::vector getIDList() const; + std::vector getEdges(const std::string& routeID) const; + + void add(const std::string& routeID, const std::vector& edges) const; + + private: + /// @brief invalidated copy constructor + RouteScope(const RouteScope& src); + + /// @brief invalidated assignment operator + RouteScope& operator=(const RouteScope& src); + + }; + + + + + + /** @class SimulationScope + * @brief Scope for interaction with the simulation + */ + class SimulationScope : public TraCIScopeWrapper { + public: + SimulationScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~SimulationScope() {} + + SUMOTime getCurrentTime() const; + unsigned int getLoadedNumber() const; + std::vector getLoadedIDList() const; + unsigned int getDepartedNumber() const; + std::vector getDepartedIDList() const; + unsigned int getArrivedNumber() const; + std::vector getArrivedIDList() const; + unsigned int getStartingTeleportNumber() const; + std::vector getStartingTeleportIDList() const; + unsigned int getEndingTeleportNumber() const; + std::vector getEndingTeleportIDList() const; + SUMOTime getDeltaT() const; + TraCIBoundary getNetBoundary() const; + unsigned int getMinExpectedNumber() const; + + private: + /// @brief invalidated copy constructor + SimulationScope(const SimulationScope& src); + + /// @brief invalidated assignment operator + SimulationScope& operator=(const SimulationScope& src); + + }; + + + + + + /** @class TrafficLightScope + * @brief Scope for interaction with traffic lights + */ + class TrafficLightScope : public TraCIScopeWrapper { + public: + TrafficLightScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~TrafficLightScope() {} + + std::vector getIDList() const; + std::string getRedYellowGreenState(const std::string& tlsID) const; + std::vector getCompleteRedYellowGreenDefinition(const std::string& tlsID) const; + std::vector getControlledLanes(const std::string& tlsID) const; + std::vector getControlledLinks(const std::string& tlsID) const; + std::string getProgram(const std::string& tlsID) const; + unsigned int getPhase(const std::string& tlsID) const; + unsigned int getNextSwitch(const std::string& tlsID) const; + + void setRedYellowGreenState(const std::string& tlsID, const std::string& state) const; + void setPhase(const std::string& tlsID, unsigned int index) const; + void setProgram(const std::string& tlsID, const std::string& programID) const; + void setPhaseDuration(const std::string& tlsID, unsigned int phaseDuration) const; + void setCompleteRedYellowGreenDefinition(const std::string& tlsID, const TraCIAPI::TraCILogic& logic) const; + + private: + /// @brief invalidated copy constructor + TrafficLightScope(const TrafficLightScope& src); + + /// @brief invalidated assignment operator + TrafficLightScope& operator=(const TrafficLightScope& src); + + }; + + + + + + /** @class VehicleTypeScope + * @brief Scope for interaction with vehicle types + */ + class VehicleTypeScope : public TraCIScopeWrapper { + public: + VehicleTypeScope(TraCIAPI& parent) : TraCIScopeWrapper(parent) {} + virtual ~VehicleTypeScope() {} + + std::vector getIDList() const; + SUMOReal getLength(const std::string& typeID) const; + SUMOReal getMaxSpeed(const std::string& typeID) const; + SUMOReal getSpeedFactor(const std::string& typeID) const; + SUMOReal getSpeedDeviation(const std::string& typeID) const; + SUMOReal getAccel(const std::string& typeID) const; + SUMOReal getDecel(const std::string& typeID) const; + SUMOReal getImperfection(const std::string& typeID) const; + SUMOReal getTau(const std::string& typeID) const; + std::string getVehicleClass(const std::string& typeID) const; + std::string getEmissionClass(const std::string& typeID) const; + std::string getShapeClass(const std::string& typeID) const; + SUMOReal getMinGap(const std::string& typeID) const; + SUMOReal getWidth(const std::string& typeID) const; + TraCIColor getColor(const std::string& typeID) const; + + void setLength(const std::string& typeID, SUMOReal length) const; + void setMaxSpeed(const std::string& typeID, SUMOReal speed) const; + void setVehicleClass(const std::string& typeID, const std::string& clazz) const; + void setSpeedFactor(const std::string& typeID, SUMOReal factor) const; + void setSpeedDeviation(const std::string& typeID, SUMOReal deviation) const; + void setEmissionClass(const std::string& typeID, const std::string& clazz) const; + void setWidth(const std::string& typeID, SUMOReal width) const; + void setMinGap(const std::string& typeID, SUMOReal minGap) const; + void setShapeClass(const std::string& typeID, const std::string& clazz) const; + void setAccel(const std::string& typeID, SUMOReal accel) const; + void setDecel(const std::string& typeID, SUMOReal decel) const; + void setImperfection(const std::string& typeID, SUMOReal imperfection) const; + void setTau(const std::string& typeID, SUMOReal tau) const; + void setColor(const std::string& typeID, const TraCIColor& c) const; + + private: + /// @brief invalidated copy constructor + VehicleTypeScope(const VehicleTypeScope& src); + + /// @brief invalidated assignment operator + VehicleTypeScope& operator=(const VehicleTypeScope& src); + + }; + +public: + /// @brief Scope for interaction with edges + EdgeScope edge; + /// @brief Scope for interaction with the gui + GUIScope gui; + /// @brief Scope for interaction with inductive loops + InductionLoopScope inductionloop; + /// @brief Scope for interaction with junctions + JunctionScope junction; + /// @brief Scope for interaction with lanes + LaneScope lane; + /// @brief Scope for interaction with multi-entry/-exit detectors + MeMeScope multientryexit; + /// @brief Scope for interaction with POIs + POIScope poi; + /// @brief Scope for interaction with polygons + PolygonScope polygon; + /// @brief Scope for interaction with routes + RouteScope route; + /// @brief Scope for interaction with the simulation + SimulationScope simulation; + /// @brief Scope for interaction with traffic lights + TrafficLightScope trafficlights; + /// @brief Scope for interaction with vehicle types + VehicleTypeScope vehicletype; + + +protected: + /// @name Command sending methods + /// @{ + + /** @brief Sends a SimulationStep command + */ + void send_commandSimulationStep(SUMOTime time) const; + + + /** @brief Sends a Close command + */ + void send_commandClose() const; + + + /** @brief Sends a GetVariable request + * @param[in] domID The domain of the variable + * @param[in] varID The variable to retrieve + * @param[in] objID The object to retrieve the variable from + * @param[in] add Optional additional parameter + */ + void send_commandGetVariable(int domID, int varID, const std::string& objID, tcpip::Storage* add = 0) const; + + + /** @brief Sends a SetVariable request + * @param[in] domID The domain of the variable + * @param[in] varID The variable to set + * @param[in] objID The object to change + * @param[in] content The value of the variable + */ + void send_commandSetValue(int domID, int varID, const std::string& objID, tcpip::Storage& content) const; + + + /** @brief Sends a SubscribeVariable request + * @param[in] domID The domain of the variable + * @param[in] objID The object to subscribe the variables from + * @param[in] beginTime The begin time step of subscriptions + * @param[in] endTime The end time step of subscriptions + * @param[in] vars The variables to subscribe + */ + void send_commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, const std::vector& vars) const; + + + /** @brief Sends a SubscribeContext request + * @param[in] domID The domain of the variable + * @param[in] objID The object to subscribe the variables from + * @param[in] beginTime The begin time step of subscriptions + * @param[in] endTime The end time step of subscriptions + * @param[in] domain The domain of the objects which values shall be returned + * @param[in] range The range around the obj to investigate + * @param[in] vars The variables to subscribe + */ + void send_commandSubscribeObjectContext(int domID, const std::string& objID, int beginTime, int endTime, + int domain, SUMOReal range, const std::vector& vars) const; + /// @} + + + + /// @name Command sending methods + /// @{ + + /** @brief Validates the result state of a command + * @param[in] inMsg The buffer to read the message from + * @param[in] command The original command id + * @param[in] ignoreCommandId Whether the returning command id shall be validated + * @param[in] acknowledgement Pointer to an existing string into which the acknowledgement message shall be inserted + */ + void check_resultState(tcpip::Storage& inMsg, int command, bool ignoreCommandId = false, std::string* acknowledgement = 0) const; + + void check_commandGetResult(tcpip::Storage& inMsg, int command, int expectedType = -1, bool ignoreCommandId = false) const; + + void processGET(tcpip::Storage& inMsg, int command, int expectedType, bool ignoreCommandId = false) const; + /// @} + + +protected: + /// @brief The socket + tcpip::Socket* mySocket; + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/xml/GenericSAXHandler.cpp sumo-0.16.0~dfsg/src/utils/xml/GenericSAXHandler.cpp --- sumo-0.15.0~dfsg/src/utils/xml/GenericSAXHandler.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/GenericSAXHandler.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GenericSAXHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GenericSAXHandler.cpp 13109 2012-12-02 14:49:47Z behrisch $ /// // A handler which converts occuring elements and attributes into enums /****************************************************************************/ @@ -34,7 +34,7 @@ #include #include "GenericSAXHandler.h" #include -#include +#include #include #include #include @@ -105,8 +105,8 @@ GenericSAXHandler::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*localname*/, const XMLCh* const qname, - const Attributes& attrs) { - std::string name = TplConvert::_2str(qname); + const XERCES_CPP_NAMESPACE::Attributes& attrs) { + std::string name = TplConvert::_2str(qname); int element = convertTag(name); myCharactersVector.clear(); SUMOSAXAttributesImpl_Xerces na(attrs, myPredefinedTags, myPredefinedTagsMML, name); @@ -126,7 +126,7 @@ GenericSAXHandler::endElement(const XMLCh* const /*uri*/, const XMLCh* const /*localname*/, const XMLCh* const qname) { - std::string name = TplConvert::_2str(qname); + std::string name = TplConvert::_2str(qname); int element = convertTag(name); // collect characters if (myCharactersVector.size() != 0) { @@ -175,7 +175,7 @@ void GenericSAXHandler::characters(const XMLCh* const chars, const XERCES3_SIZE_t length) { - myCharactersVector.push_back(TplConvert::_2str(chars, static_cast(length))); + myCharactersVector.push_back(TplConvert::_2str(chars, static_cast(length))); } @@ -190,32 +190,32 @@ std::string -GenericSAXHandler::buildErrorMessage(const SAXParseException& exception) { +GenericSAXHandler::buildErrorMessage(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { std::ostringstream buf; - char* pMsg = XMLString::transcode(exception.getMessage()); + char* pMsg = XERCES_CPP_NAMESPACE::XMLString::transcode(exception.getMessage()); buf << pMsg << std::endl; buf << " In file '" << getFileName() << "'" << std::endl; buf << " At line/column " << exception.getLineNumber() + 1 << '/' << exception.getColumnNumber() << "." << std::endl; - XMLString::release(&pMsg); + XERCES_CPP_NAMESPACE::XMLString::release(&pMsg); return buf.str(); } void -GenericSAXHandler::warning(const SAXParseException& exception) { +GenericSAXHandler::warning(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { WRITE_WARNING(buildErrorMessage(exception)); } void -GenericSAXHandler::error(const SAXParseException& exception) { +GenericSAXHandler::error(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { throw ProcessError(buildErrorMessage(exception)); } void -GenericSAXHandler::fatalError(const SAXParseException& exception) { +GenericSAXHandler::fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& exception) { throw ProcessError(buildErrorMessage(exception)); } diff -Nru sumo-0.15.0~dfsg/src/utils/xml/GenericSAXHandler.h sumo-0.16.0~dfsg/src/utils/xml/GenericSAXHandler.h --- sumo-0.15.0~dfsg/src/utils/xml/GenericSAXHandler.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/GenericSAXHandler.h 2012-12-03 00:02:27.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GenericSAXHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: GenericSAXHandler.h 13109 2012-12-02 14:49:47Z behrisch $ /// // A handler which converts occuring elements and attributes into enums /****************************************************************************/ @@ -45,14 +45,6 @@ // =========================================================================== -// xerces 2.2 compatibility -// =========================================================================== -#if defined(XERCES_HAS_CPP_NAMESPACE) -using namespace XERCES_CPP_NAMESPACE; -#endif - - -// =========================================================================== // class definitions // =========================================================================== /** @@ -80,7 +72,7 @@ * which knows all tags/attributes used by SUMO. It is still kept separate for * an easier maintainability and later extensions. */ -class GenericSAXHandler : public DefaultHandler { +class GenericSAXHandler : public XERCES_CPP_NAMESPACE::DefaultHandler { public: /** @@ -124,7 +116,7 @@ * @todo do not generate and report the string-representation */ void startElement(const XMLCh* const uri, const XMLCh* const localname, - const XMLCh* const qname, const Attributes& attrs); + const XMLCh* const qname, const XERCES_CPP_NAMESPACE::Attributes& attrs); /** @@ -168,7 +160,7 @@ * * @todo Hmmm - this is as unsafe as having a direct access to the variable; recheck */ - void setFileName(const std::string& name) ; + void setFileName(const std::string& name); /** @@ -176,7 +168,7 @@ * * @return The name of the currently processed file */ - const std::string& getFileName() const ; + const std::string& getFileName() const; /// @name SAX ErrorHandler callbacks @@ -190,7 +182,7 @@ * * @param[in] exception The occured exception to process */ - void warning(const SAXParseException& exception) ; + void warning(const XERCES_CPP_NAMESPACE::SAXParseException& exception); /** @@ -201,7 +193,7 @@ * @param[in] exception The occured exception to process * @exception ProcessError On any call */ - void error(const SAXParseException& exception) ; + void error(const XERCES_CPP_NAMESPACE::SAXParseException& exception); /** @@ -212,10 +204,13 @@ * @exception ProcessError On any call * @param[in] exception The occured exception to process */ - void fatalError(const SAXParseException& exception) ; + void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& exception); //@} + // Reader needs access to myStartElement, myEndElement + friend class SUMOSAXReader; + protected: /** @@ -227,7 +222,7 @@ * @param[in] exception The name of the currently processed file * @return A string describing the given exception */ - std::string buildErrorMessage(const SAXParseException& exception) ; + std::string buildErrorMessage(const XERCES_CPP_NAMESPACE::SAXParseException& exception); /** @@ -271,7 +266,7 @@ * @param[in] name The string to convert * @return The string converted into a XMLCh-string */ - XMLCh* convert(const std::string& name) const ; + XMLCh* convert(const std::string& name) const; /** @@ -282,7 +277,7 @@ * @param[in] tag The string to convert * @return The int-value that represents the string, SUMO_TAG_NOTHING if the named attribute is not known */ - int convertTag(const std::string& tag) const ; + int convertTag(const std::string& tag) const; private: @@ -322,6 +317,13 @@ /// @brief The name of the currently parsed file std::string myFileName; +private: + /// @brief invalidated copy constructor + GenericSAXHandler(const GenericSAXHandler& s); + + /// @brief invalidated assignment operator + const GenericSAXHandler& operator=(const GenericSAXHandler& s); + }; #endif diff -Nru sumo-0.15.0~dfsg/src/utils/xml/Makefile.am sumo-0.16.0~dfsg/src/utils/xml/Makefile.am --- sumo-0.15.0~dfsg/src/utils/xml/Makefile.am 2012-03-07 00:02:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/Makefile.am 2012-11-05 00:02:22.000000000 +0000 @@ -2,9 +2,11 @@ libxml_a_SOURCES = GenericSAXHandler.h GenericSAXHandler.cpp \ SUMOSAXAttributes.cpp SUMOSAXAttributes.h \ +SUMOSAXAttributesImpl_Binary.cpp SUMOSAXAttributesImpl_Binary.h \ SUMOSAXAttributesImpl_Xerces.cpp SUMOSAXAttributesImpl_Xerces.h \ SUMORouteHandler.cpp SUMORouteHandler.h \ SUMOSAXHandler.cpp SUMOSAXHandler.h \ +SUMOSAXReader.cpp SUMOSAXReader.h \ SUMOVehicleParserHelper.cpp SUMOVehicleParserHelper.h \ SUMOXMLDefinitions.cpp SUMOXMLDefinitions.h \ SAXWeightsHandler.cpp SAXWeightsHandler.h \ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/Makefile.in sumo-0.16.0~dfsg/src/utils/xml/Makefile.in --- sumo-0.15.0~dfsg/src/utils/xml/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -51,10 +51,12 @@ libxml_a_LIBADD = am_libxml_a_OBJECTS = GenericSAXHandler.$(OBJEXT) \ SUMOSAXAttributes.$(OBJEXT) \ + SUMOSAXAttributesImpl_Binary.$(OBJEXT) \ SUMOSAXAttributesImpl_Xerces.$(OBJEXT) \ SUMORouteHandler.$(OBJEXT) SUMOSAXHandler.$(OBJEXT) \ - SUMOVehicleParserHelper.$(OBJEXT) SUMOXMLDefinitions.$(OBJEXT) \ - SAXWeightsHandler.$(OBJEXT) XMLSubSys.$(OBJEXT) + SUMOSAXReader.$(OBJEXT) SUMOVehicleParserHelper.$(OBJEXT) \ + SUMOXMLDefinitions.$(OBJEXT) SAXWeightsHandler.$(OBJEXT) \ + XMLSubSys.$(OBJEXT) libxml_a_OBJECTS = $(am_libxml_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -105,6 +107,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -135,6 +138,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -169,6 +173,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -202,7 +207,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -225,9 +229,11 @@ noinst_LIBRARIES = libxml.a libxml_a_SOURCES = GenericSAXHandler.h GenericSAXHandler.cpp \ SUMOSAXAttributes.cpp SUMOSAXAttributes.h \ +SUMOSAXAttributesImpl_Binary.cpp SUMOSAXAttributesImpl_Binary.h \ SUMOSAXAttributesImpl_Xerces.cpp SUMOSAXAttributesImpl_Xerces.h \ SUMORouteHandler.cpp SUMORouteHandler.h \ SUMOSAXHandler.cpp SUMOSAXHandler.h \ +SUMOSAXReader.cpp SUMOSAXReader.h \ SUMOVehicleParserHelper.cpp SUMOVehicleParserHelper.h \ SUMOXMLDefinitions.cpp SUMOXMLDefinitions.h \ SAXWeightsHandler.cpp SAXWeightsHandler.h \ @@ -285,8 +291,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAXWeightsHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMORouteHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOSAXAttributes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOSAXAttributesImpl_Binary.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOSAXAttributesImpl_Xerces.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOSAXHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOSAXReader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOVehicleParserHelper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOXMLDefinitions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMLSubSys.Po@am__quote@ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SAXWeightsHandler.cpp sumo-0.16.0~dfsg/src/utils/xml/SAXWeightsHandler.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SAXWeightsHandler.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SAXWeightsHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SAXWeightsHandler.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SAXWeightsHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // An XML-handler for network weights /****************************************************************************/ @@ -63,7 +63,7 @@ // --------------------------------------------------------------------------- // SAXWeightsHandler methods // --------------------------------------------------------------------------- -SAXWeightsHandler::SAXWeightsHandler(const std::vector &defs, +SAXWeightsHandler::SAXWeightsHandler(const std::vector& defs, const std::string& file) : SUMOSAXHandler(file), myDefinitions(defs), myCurrentTimeBeg(-1), myCurrentTimeEnd(-1) {} diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SAXWeightsHandler.h sumo-0.16.0~dfsg/src/utils/xml/SAXWeightsHandler.h --- sumo-0.15.0~dfsg/src/utils/xml/SAXWeightsHandler.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SAXWeightsHandler.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SAXWeightsHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SAXWeightsHandler.h 13107 2012-12-02 13:57:34Z behrisch $ /// // An XML-handler for network weights /****************************************************************************/ @@ -148,7 +148,7 @@ * Gets a list of retriever definitions. Please note that the retrievers are * not deleted! */ - SAXWeightsHandler(const std::vector &defs, + SAXWeightsHandler(const std::vector& defs, const std::string& file); @@ -162,7 +162,7 @@ /// Destructor - ~SAXWeightsHandler() ; + ~SAXWeightsHandler(); protected: @@ -177,7 +177,7 @@ * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -186,7 +186,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int elemente) ; + void myEndElement(int elemente); //@} diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMORouteHandler.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMORouteHandler.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMORouteHandler.cpp 2012-03-07 00:02:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMORouteHandler.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: SUMORouteHandler.cpp 12019 2012-03-06 11:31:59Z behrisch $ +/// @version $Id: SUMORouteHandler.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Parser for routes during their loading /****************************************************************************/ @@ -55,6 +55,7 @@ SUMOSAXHandler(file), myVehicleParameter(0), myLastDepart(0), + myActiveRouteColor(0), myCurrentVType(0) { } @@ -81,7 +82,7 @@ } -void +void SUMORouteHandler::registerLastDepart() { if (myVehicleParameter->departProcedure == DEPART_GIVEN) { myLastDepart = myVehicleParameter->depart; @@ -92,7 +93,7 @@ void SUMORouteHandler::myStartElement(int element, - const SUMOSAXAttributes& attrs) { + const SUMOSAXAttributes& attrs) { switch (element) { case SUMO_TAG_VEHICLE: delete myVehicleParameter; @@ -107,7 +108,7 @@ myVehicleParameter = SUMOVehicleParserHelper::parseFlowAttributes(attrs); break; case SUMO_TAG_VTYPE: - myCurrentVType = SUMOVehicleParserHelper::beginVTypeParsing(attrs); + myCurrentVType = SUMOVehicleParserHelper::beginVTypeParsing(attrs, getFileName()); break; case SUMO_TAG_VTYPE_DISTRIBUTION: openVehicleTypeDistribution(attrs); @@ -157,17 +158,15 @@ case SUMO_TAG_FLOW: closeFlow(); break; - case SUMO_TAG_VTYPE_DISTRIBUTION__DEPRECATED: case SUMO_TAG_VTYPE_DISTRIBUTION: closeVehicleTypeDistribution(); break; case SUMO_TAG_ROUTE_DISTRIBUTION: closeRouteDistribution(); break; - case SUMO_TAG_VTYPE__DEPRECATED: case SUMO_TAG_VTYPE: SUMOVehicleParserHelper::closeVTypeParsing(*myCurrentVType); - break; + break; default: break; } @@ -176,7 +175,7 @@ bool SUMORouteHandler::checkStopPos(SUMOReal& startPos, SUMOReal& endPos, const SUMOReal laneLength, - const SUMOReal minLength, const bool friendlyPos) { + const SUMOReal minLength, const bool friendlyPos) { if (minLength > laneLength) { return false; } diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMORouteHandler.h sumo-0.16.0~dfsg/src/utils/xml/SUMORouteHandler.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMORouteHandler.h 2012-03-07 00:02:35.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMORouteHandler.h 2012-10-25 23:02:23.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: SUMORouteHandler.h 12019 2012-03-06 11:31:59Z behrisch $ +/// @version $Id: SUMORouteHandler.h 12887 2012-10-25 11:58:17Z behrisch $ /// // Parser for routes during their loading /****************************************************************************/ @@ -53,7 +53,7 @@ SUMORouteHandler(const std::string& file); /// standard destructor - virtual ~SUMORouteHandler() ; + virtual ~SUMORouteHandler(); /// Returns the last loaded depart time SUMOTime getLastDepart() const; @@ -74,7 +74,7 @@ * @see GenericSAXHandler::myStartElement */ virtual void myStartElement(int element, - const SUMOSAXAttributes& attrs) ; + const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs @@ -83,7 +83,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - virtual void myEndElement(int element) ; + virtual void myEndElement(int element); //@} @@ -144,7 +144,7 @@ SUMOReal myActiveRouteProbability; /// @brief The currently parsed route's color - RGBColor myActiveRouteColor; + const RGBColor* myActiveRouteColor; /// @brief List of the stops on the parsed route std::vector myActiveRouteStops; diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributes.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributes.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributes.cpp 2012-02-11 00:02:20.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributes.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributes.cpp 11876 2012-02-10 14:12:59Z dkrajzew $ +/// @version $Id: SUMOSAXAttributes.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Encapsulated SAX-Attributes /****************************************************************************/ @@ -104,9 +104,9 @@ } -long +SUMOLong SUMOSAXAttributes::getLongReporting(int attr, const char* objectid, - bool& ok, bool report) const { + bool& ok, bool report) const { if (!hasAttribute(attr)) { if (report) { emitUngivenError(getName(attr), objectid); @@ -378,7 +378,7 @@ void -SUMOSAXAttributes::parseStringVector(const std::string& def, std::vector &into) { +SUMOSAXAttributes::parseStringVector(const std::string& def, std::vector& into) { if (def.find(';') != std::string::npos || def.find(',') != std::string::npos) { if (!myHaveInformedAboutDeprecatedDivider) { WRITE_WARNING("Please note that using ';' and ',' as XML list separators is deprecated.\n From 1.0 onwards, only ' ' will be accepted."); diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributes.h sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributes.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributes.h 2012-02-11 00:02:20.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributes.h 2012-12-02 13:57:49.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributes.h 11876 2012-02-10 14:12:59Z dkrajzew $ +/// @version $Id: SUMOSAXAttributes.h 13107 2012-12-02 13:57:34Z behrisch $ /// // Encapsulated SAX-Attributes /****************************************************************************/ @@ -34,8 +34,18 @@ #include #include + #include #include +#include "SUMOXMLDefinitions.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class PositionVector; +class Boundary; +class RGBColor; // =========================================================================== @@ -54,7 +64,7 @@ /* @brief Constructor * @param[in] tagName The name of the parsed object type; used for error message generation */ - SUMOSAXAttributes(const std::string& objectType) ; + SUMOSAXAttributes(const std::string& objectType); /// @brief Destructor @@ -75,7 +85,7 @@ * @return The read value if given and correct; -1 if an error occured */ int getIntReporting(int attr, const char* objectid, bool& ok, - bool report = true) const ; + bool report = true) const; /** @brief Tries to read given attribute assuming it is an int @@ -94,7 +104,7 @@ * @return The read value if given and correct; the default value if the attribute does not exist; -1 if an error occured */ int getOptIntReporting(int attr, const char* objectid, bool& ok, - int defaultValue, bool report = true) const ; + int defaultValue, bool report = true) const; @@ -111,8 +121,8 @@ * @param[in] report Whether errors shall be written to msg handler's error instance * @return The read value if given and correct; -1 if an error occured */ - long getLongReporting(int attr, const char* objectid, bool& ok, - bool report = true) const ; + SUMOLong getLongReporting(int attr, const char* objectid, bool& ok, + bool report = true) const; @@ -130,7 +140,7 @@ * @return The read value if given and correct; -1 if an error occured */ SUMOReal getSUMORealReporting(int attr, const char* objectid, bool& ok, - bool report = true) const ; + bool report = true) const; @@ -150,7 +160,7 @@ * @return The read value if given and correct; the default value if the attribute does not exist; -1 if an error occured */ SUMOReal getOptSUMORealReporting(int attr, const char* objectid, bool& ok, - SUMOReal defaultValue, bool report = true) const ; + SUMOReal defaultValue, bool report = true) const; @@ -168,7 +178,7 @@ * @return The read value if given and correct; false if an error occured */ bool getBoolReporting(int attr, const char* objectid, bool& ok, - bool report = true) const ; + bool report = true) const; @@ -188,7 +198,7 @@ * @return The read value if given and correct; the default value if the attribute does not exist; false if an error occured */ bool getOptBoolReporting(int attr, const char* objectid, bool& ok, - bool defaultValue, bool report = true) const ; + bool defaultValue, bool report = true) const; @@ -206,7 +216,7 @@ * @return The read value if given and not empty; "" if an error occured */ std::string getStringReporting(int attr, const char* objectid, bool& ok, - bool report = true) const ; + bool report = true) const; @@ -226,7 +236,7 @@ * @return The read value if given and not empty; the default value if the attribute does not exist; "" if an error occured */ std::string getOptStringReporting(int attr, const char* objectid, bool& ok, - const std::string& defaultValue, bool report = true) const ; + const std::string& defaultValue, bool report = true) const; @@ -247,7 +257,7 @@ * @return The read value if given and correct; -1 if an error occured */ SUMOTime getSUMOTimeReporting(int attr, const char* objectid, bool& ok, - bool report = true) const ; + bool report = true) const; @@ -270,7 +280,7 @@ * @return The read value if given and correct; the default value if the attribute does not exist; -1 if an error occured */ SUMOTime getOptSUMOTimeReporting(int attr, const char* objectid, bool& ok, - SUMOTime defaultValue, bool report = true) const ; + SUMOTime defaultValue, bool report = true) const; @@ -347,7 +357,7 @@ * @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 */ - virtual int getInt(int id) const throw(EmptyData, NumberFormatException) = 0; + virtual int getInt(int id) const = 0; /** @@ -365,7 +375,7 @@ * @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 */ - virtual long getLong(int id) const throw(EmptyData, NumberFormatException) = 0; + virtual SUMOLong getLong(int id) const = 0; /** @@ -385,7 +395,7 @@ * @exception EmptyData If the attribute value is an empty string * @exception NumberFormatException If the attribute value can not be parsed to an int */ - virtual int getIntSecure(int id, int def) const throw(EmptyData, NumberFormatException) = 0; + virtual int getIntSecure(int id, int def) const = 0; /** @@ -434,7 +444,7 @@ * @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 SUMOReal */ - virtual SUMOReal getFloat(int id) const throw(EmptyData, NumberFormatException) = 0; + virtual SUMOReal getFloat(int id) const = 0; /** * @brief Returns the SUMOReal-value of the named (by its enum-value) attribute @@ -453,7 +463,7 @@ * @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 SUMOReal */ - virtual SUMOReal getFloatSecure(int id, SUMOReal def) const throw(EmptyData, NumberFormatException) = 0; + virtual SUMOReal getFloatSecure(int id, SUMOReal def) const = 0; /** @@ -471,7 +481,7 @@ * @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 SUMOReal */ - virtual SUMOReal getFloat(const std::string& id) const throw(EmptyData, NumberFormatException) = 0; + virtual SUMOReal getFloat(const std::string& id) const = 0; /** @@ -488,6 +498,64 @@ //} + /** + * @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 + */ + virtual SumoXMLEdgeFunc getEdgeFunc(bool& ok) const = 0; + + + /** + * @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 + */ + virtual SumoXMLNodeType getNodeType(bool& ok) const = 0; + + + /** + * @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 + */ + virtual RGBColor getColorReporting(const char* objectid, bool& ok) const = 0; + + + /** @brief Tries to read given attribute assuming it is a PositionVector + * + * If an error occurs (the attribute is not there, it's empty), "ok" is + * set to false and an error message is written to MsgHandler::getErrorInstance. + * + * Otherwise, "ok" is not changed. + * + * @param[in] attr The id of the attribute to read + * @param[in] objectid The name of the parsed object; used for error message generation + * @param[out] ok Whether the value could be read + * @param[in] report Whether errors shall be written to msg handler's error instance + * @return The read value if given and not empty; "" if an error occured + */ + virtual PositionVector getShapeReporting(int attr, const char* objectid, bool& ok, + bool allowEmpty) const = 0; + + /** @brief Tries to read given attribute assuming it is a PositionVector + * + * If an error occurs (the attribute is not there, it's empty), "ok" is + * set to false and an error message is written to MsgHandler::getErrorInstance. + * + * Otherwise, "ok" is not changed. + * + * @param[in] attr The id of the attribute to read + * @param[in] objectid The name of the parsed object; used for error message generation + * @param[out] ok Whether the value could be read + * @param[in] report Whether errors shall be written to msg handler's error instance + * @return The read value if given and not empty; "" if an error occured + */ + virtual Boundary getBoundaryReporting(int attr, const char* objectid, bool& ok) const = 0; + /** @brief Converts the given attribute id into a man readable string * * @param[in] attr The id of the attribute to return the name of @@ -496,6 +564,13 @@ virtual std::string getName(int attr) const = 0; + /** @brief Prints all attribute names and values into the given stream + * + * @param[in] os The stream to use + */ + virtual void serialize(std::ostream& os) const = 0; + + /** @brief Splits the given string * * Spaces, ",", and ";" are assumed to be separator characters. @@ -504,7 +579,7 @@ * @param[in] def The string to split * @param[out] into The vector to fill */ - static void parseStringVector(const std::string& def, std::vector &into) ; + static void parseStringVector(const std::string& def, std::vector& into); /// @brief return the objecttype to which these attributes belong @@ -513,14 +588,16 @@ } + friend std::ostream& operator<<(std::ostream& os, const SUMOSAXAttributes& src); + /** @brief The encoding of parsed strings */ static const std::string ENCODING; protected: - void emitUngivenError(const std::string& attrname, const char* objectid) const ; - void emitEmptyError(const std::string& attrname, const char* objectid) const ; - void emitFormatError(const std::string& attrname, const std::string& type, const char* objectid) const ; + void emitUngivenError(const std::string& attrname, const char* objectid) const; + void emitEmptyError(const std::string& attrname, const char* objectid) const; + void emitFormatError(const std::string& attrname, const std::string& type, const char* objectid) const; private: /// @brief Information whether the usage of a deprecated divider was reported @@ -539,6 +616,12 @@ }; +inline std::ostream& operator<<(std::ostream& os, const SUMOSAXAttributes& src) { + src.serialize(os); + return os; +} + + #endif /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,365 @@ +/****************************************************************************/ +/// @file SUMOSAXAttributesImpl_Binary.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: SUMOSAXAttributesImpl_Binary.cpp 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Encapsulated Xerces-SAX-attributes +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "SUMOSAXAttributesImpl_Binary.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// class definitions +// =========================================================================== +SUMOSAXAttributesImpl_Binary::SUMOSAXAttributesImpl_Binary( + const std::map& predefinedTagsMML, + const std::string& objectType, + BinaryInputDevice* in) : SUMOSAXAttributes(objectType), myAttrIds(predefinedTagsMML) { + while (in->peek() == BinaryFormatter::BF_XML_ATTRIBUTE) { + unsigned char attr; + *in >> attr; + 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("Invalid binary file"); + } + 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 throw(EmptyData, BoolFormatException) { + const std::map::const_iterator i = myCharValues.find(id); + if (i == myCharValues.end()) { + throw EmptyData(); + } + return i->second != 0; +} + + +bool +SUMOSAXAttributesImpl_Binary::getBoolSecure(int id, bool val) const throw(EmptyData) { + const std::map::const_iterator i = myCharValues.find(id); + if (i == myCharValues.end()) { + return val; + } + 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; +} + + +int +SUMOSAXAttributesImpl_Binary::getIntSecure(int id, + int def) const { + const std::map::const_iterator i = myIntValues.find(id); + if (i == myIntValues.end()) { + return def; + } + return i->second; +} + + +SUMOLong +SUMOSAXAttributesImpl_Binary::getLong(int /* id */) const { + throw NumberFormatException(); +} + + +std::string +SUMOSAXAttributesImpl_Binary::getString(int id) const throw(EmptyData) { + 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 throw(EmptyData) { + const std::map::const_iterator i = myStringValues.find(id); + if (i == myStringValues.end()) { + return str; + } + return i->second; +} + + +SUMOReal +SUMOSAXAttributesImpl_Binary::getFloat(int id) const { + const std::map::const_iterator i = myFloatValues.find(id); + if (i == myFloatValues.end()) { + return TplConvert::_2SUMOReal(getString(id).c_str()); + } + return i->second; +} + + +SUMOReal +SUMOSAXAttributesImpl_Binary::getFloatSecure(int id, SUMOReal def) const { + const std::map::const_iterator i = myFloatValues.find(id); + if (i == myFloatValues.end()) { + return def; + } + return i->second; +} + + +SUMOReal +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; +} + + +RGBColor +SUMOSAXAttributesImpl_Binary::getColorReporting(const char* /* objectid */, bool& /* ok */) const { + const std::map::const_iterator i = myIntValues.find(SUMO_ATTR_COLOR); + if (i != myIntValues.end()) { + const int val = i->second; + return RGBColor((val & 0xff) / 255., ((val >> 8) & 0xff) / 255., ((val >> 16) & 0xff) / 255.); + } + return RGBColor(); +} + + +PositionVector +SUMOSAXAttributesImpl_Binary::getShapeReporting(int attr, const char* objectid, bool& ok, + bool allowEmpty) const { + const std::map::const_iterator i = myPositionVectors.find(attr); + if (i == myPositionVectors.end() || i->second.size() == 0) { + if (!allowEmpty) { + emitEmptyError(getName(attr), objectid); + ok = false; + } + return PositionVector(); + } + return i->second; +} + + +Boundary +SUMOSAXAttributesImpl_Binary::getBoundaryReporting(int attr, const char* objectid, bool& ok) const { + const std::map::const_iterator i = myPositionVectors.find(attr); + if (i == myPositionVectors.end() || i->second.size() == 0) { + emitEmptyError(getName(attr), objectid); + ok = false; + return Boundary(); + } + if (i->second.size() != 2) { + emitFormatError(getName(attr), "a valid number of entries", objectid); + ok = false; + return Boundary(); + } + 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, "?") << "\""; + } +} + + +/****************************************************************************/ + diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.h sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.h 2012-12-02 13:57:49.000000000 +0000 @@ -0,0 +1,392 @@ +/****************************************************************************/ +/// @file SUMOSAXAttributesImpl_Binary.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Fri, 30 Mar 2007 +/// @version $Id: SUMOSAXAttributesImpl_Binary.h 13107 2012-12-02 13:57:34Z behrisch $ +/// +// Encapsulated Xerces-SAX-attributes +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef SUMOSAXAttributesImpl_Binary_h +#define SUMOSAXAttributesImpl_Binary_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#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); + + + /// @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 throw(EmptyData, BoolFormatException); + + /** + * @brief Returns the bool-value of the named (by its enum-value) attribute or the given value if the attribute is not known + * + * Tries to retrieve the attribute from the the attribute list. The retrieved + * attribute (which may be 0) is then parsed using TplConvert::_2boolSec. + * If the attribute is empty, TplConvert::_2boolSec throws an + * EmptyData-exception which is passed. If the attribute==0, TplConvert::_2boolSec + * 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 bool, if it could be read and parsed + * @exception EmptyData If the attribute value is an empty string + */ + bool getBoolSecure(int id, bool def) const throw(EmptyData); + + + /** + * @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 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::_2intSec. + * If the attribute is empty, TplConvert::_2intSec throws an + * EmptyData-exception which is passed. If the attribute==0, TplConvert::_2intSec + * returns the default value. + * If the value can not be parsed to an int, TplConvert::_2intSec throws a + * NumberFormatException-exception which is passed. + * + * @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 an int, if it could be read and parsed + * @exception EmptyData If the attribute value is an empty string + * @exception NumberFormatException If the attribute value can not be parsed to an int + */ + int getIntSecure(int id, int def) 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 + */ + SUMOLong 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 throw(EmptyData); + + /** + * @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 throw(EmptyData); + + + /** + * @brief Returns the SUMOReal-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::_2SUMOReal. + * If the attribute is empty or ==0, TplConvert::_2SUMOReal throws an + * EmptyData-exception which is passed. + * If the value can not be parsed to a SUMOReal, TplConvert::_2SUMOReal 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 SUMOReal + */ + SUMOReal getFloat(int id) const; + + /** + * @brief Returns the SUMOReal-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::_2SUMORealSec. + * If the attribute is empty, TplConvert::_2SUMORealSec throws an + * EmptyData-exception which is passed. If the attribute==0, TplConvert::_2SUMORealSec + * returns the default value. + * If the value can not be parsed to a SUMOReal, TplConvert::_2SUMORealSec throws a + * NumberFormatException-exception which is passed. + * + * @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 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 SUMOReal + */ + SUMOReal getFloatSecure(int id, SUMOReal def) const; + + + /** + * @brief Returns the information whether the named attribute is within the current list + */ + bool hasAttribute(const std::string& id) const; + + + /** + * @brief Returns the SUMOReal-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::_2SUMOReal. + * If the attribute is empty or ==0, TplConvert::_2SUMOReal throws an + * EmptyData-exception which is passed. + * If the value can not be parsed to a SUMOReal, TplConvert::_2SUMOReal 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 SUMOReal + */ + SUMOReal 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 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 getColorReporting(const char* objectid, bool& ok) const; + + + /** @brief Tries to read given attribute assuming it is a PositionVector + * + * If an error occurs (the attribute is not there, it's empty), "ok" is + * set to false and an error message is written to MsgHandler::getErrorInstance. + * + * Otherwise, "ok" is not changed. + * + * @param[in] attr The id of the attribute to read + * @param[in] objectid The name of the parsed object; used for error message generation + * @param[out] ok Whether the value could be read + * @param[in] report Whether errors shall be written to msg handler's error instance + * @return The read value if given and not empty; "" if an error occured + */ + PositionVector getShapeReporting(int attr, const char* objectid, bool& ok, + bool allowEmpty) const; + + /** @brief Tries to read given attribute assuming it is a Boundary + * + * If an error occurs (the attribute is not there, it's empty), "ok" is + * set to false and an error message is written to MsgHandler::getErrorInstance. + * + * Otherwise, "ok" is not changed. + * + * @param[in] attr The id of the attribute to read + * @param[in] objectid The name of the parsed object; used for error message generation + * @param[out] ok Whether the value could be read + * @param[in] report Whether errors shall be written to msg handler's error instance + * @return The read value if given and not empty; "" if an error occured + */ + Boundary getBoundaryReporting(int attr, const char* objectid, bool& ok) 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; + + +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-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2012-02-11 00:02:20.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: SUMOSAXAttributesImpl_Xerces.cpp 11876 2012-02-10 14:12:59Z dkrajzew $ +/// @version $Id: SUMOSAXAttributesImpl_Xerces.cpp 13109 2012-12-02 14:49:47Z behrisch $ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ @@ -35,9 +35,12 @@ #include #include #include -#include "SUMOSAXAttributesImpl_Xerces.h" +#include +#include #include -#include +#include +#include +#include "SUMOSAXAttributesImpl_Xerces.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -47,9 +50,9 @@ // =========================================================================== // class definitions // =========================================================================== -SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces(const Attributes& attrs, - const std::map &predefinedTags, - const std::map &predefinedTagsMML, +SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces(const XERCES_CPP_NAMESPACE::Attributes& attrs, + const std::map& predefinedTags, + const std::map& predefinedTagsMML, const std::string& objectType) : SUMOSAXAttributes(objectType), myAttrs(attrs), @@ -73,47 +76,50 @@ bool SUMOSAXAttributesImpl_Xerces::getBool(int id) const throw(EmptyData, BoolFormatException) { - return TplConvert::_2bool(getAttributeValueSecure(id)); + return TplConvert::_2bool(getAttributeValueSecure(id)); } bool SUMOSAXAttributesImpl_Xerces::getBoolSecure(int id, bool val) const throw(EmptyData) { - return TplConvertSec::_2boolSec(getAttributeValueSecure(id), val); + return TplConvert::_2boolSec(getAttributeValueSecure(id), val); } int -SUMOSAXAttributesImpl_Xerces::getInt(int id) const throw(EmptyData, NumberFormatException) { - return TplConvert::_2int(getAttributeValueSecure(id)); +SUMOSAXAttributesImpl_Xerces::getInt(int id) const { + return TplConvert::_2int(getAttributeValueSecure(id)); } int SUMOSAXAttributesImpl_Xerces::getIntSecure(int id, - int def) const throw(EmptyData, NumberFormatException) { - return TplConvertSec::_2intSec(getAttributeValueSecure(id), def); + int def) const { + return TplConvert::_2intSec(getAttributeValueSecure(id), def); } -long -SUMOSAXAttributesImpl_Xerces::getLong(int id) const throw(EmptyData, NumberFormatException) { - return TplConvert::_2long(getAttributeValueSecure(id)); +SUMOLong +SUMOSAXAttributesImpl_Xerces::getLong(int id) const { + return TplConvert::_2long(getAttributeValueSecure(id)); } std::string SUMOSAXAttributesImpl_Xerces::getString(int id) const throw(EmptyData) { const XMLCh* utf16 = getAttributeValueSecure(id); -#if _XERCES_VERSION < 30000 - return TplConvert::_2str(utf16); +#if _XERCES_VERSION < 30100 + char* t = XERCES_CPP_NAMESPACE::XMLString::transcode(utf16); + std::string result(t); + XERCES_CPP_NAMESPACE::XMLString::release(&t); + return result; #else - if (XMLString::stringLen(utf16) == 0) { + if (XERCES_CPP_NAMESPACE::XMLString::stringLen(utf16) == 0) { // TranscodeToStr and debug_new interact badly in this case; return ""; } else { - TranscodeToStr utf8(utf16, "UTF-8"); - return TplConvert::_2str(utf8.str(), (unsigned)utf8.length()); + XERCES_CPP_NAMESPACE::TranscodeToStr utf8(utf16, "UTF-8"); + return TplConvert::_2str(utf8.str(), (unsigned)utf8.length()); } #endif } @@ -123,30 +129,33 @@ SUMOSAXAttributesImpl_Xerces::getStringSecure(int id, const std::string& str) const throw(EmptyData) { const XMLCh* utf16 = getAttributeValueSecure(id); -#if _XERCES_VERSION < 30000 - return TplConvertSec::_2strSec(utf16, str); +#if _XERCES_VERSION < 30100 + char* t = XERCES_CPP_NAMESPACE::XMLString::transcode(utf16); + std::string result(TplConvert::_2strSec(t, str)); + XERCES_CPP_NAMESPACE::XMLString::release(&t); + return result; #else - if (XMLString::stringLen(utf16) == 0) { + if (XERCES_CPP_NAMESPACE::XMLString::stringLen(utf16) == 0) { // TranscodeToStr and debug_new interact badly in this case; return ""; } else { - TranscodeToStr utf8(utf16, "UTF-8"); - return TplConvertSec::_2strSec(utf8.str(), (int)utf8.length(), str); + XERCES_CPP_NAMESPACE::TranscodeToStr utf8(utf16, "UTF-8"); + return TplConvert::_2strSec(utf8.str(), (unsigned)utf8.length(), str); } #endif } SUMOReal -SUMOSAXAttributesImpl_Xerces::getFloat(int id) const throw(EmptyData, NumberFormatException) { - return TplConvert::_2SUMOReal(getAttributeValueSecure(id)); +SUMOSAXAttributesImpl_Xerces::getFloat(int id) const { + return TplConvert::_2SUMOReal(getAttributeValueSecure(id)); } SUMOReal SUMOSAXAttributesImpl_Xerces::getFloatSecure(int id, - SUMOReal def) const throw(EmptyData, NumberFormatException) { - return TplConvertSec::_2SUMORealSec(getAttributeValueSecure(id), def); + SUMOReal def) const { + return TplConvert::_2SUMORealSec(getAttributeValueSecure(id), def); } @@ -159,19 +168,19 @@ SUMOReal -SUMOSAXAttributesImpl_Xerces::getFloat(const std::string& id) const throw(EmptyData, NumberFormatException) { - XMLCh* t = XMLString::transcode(id.c_str()); - SUMOReal result = TplConvert::_2SUMOReal(myAttrs.getValue(t)); - XMLString::release(&t); +SUMOSAXAttributesImpl_Xerces::getFloat(const std::string& id) const { + XMLCh* t = XERCES_CPP_NAMESPACE::XMLString::transcode(id.c_str()); + SUMOReal result = TplConvert::_2SUMOReal(myAttrs.getValue(t)); + XERCES_CPP_NAMESPACE::XMLString::release(&t); return result; } bool SUMOSAXAttributesImpl_Xerces::hasAttribute(const std::string& id) const { - XMLCh* t = XMLString::transcode(id.c_str()); + XMLCh* t = XERCES_CPP_NAMESPACE::XMLString::transcode(id.c_str()); bool result = myAttrs.getIndex(t) >= 0; - XMLString::release(&t); + XERCES_CPP_NAMESPACE::XMLString::release(&t); return result; } @@ -179,13 +188,120 @@ std::string SUMOSAXAttributesImpl_Xerces::getStringSecure(const std::string& id, const std::string& str) const { - XMLCh* t = XMLString::transcode(id.c_str()); - std::string result = TplConvertSec::_2strSec(myAttrs.getValue(t), str); - XMLString::release(&t); + XMLCh* t = XERCES_CPP_NAMESPACE::XMLString::transcode(id.c_str()); + std::string result = TplConvert::_2strSec(myAttrs.getValue(t), str); + XERCES_CPP_NAMESPACE::XMLString::release(&t); return result; } +SumoXMLEdgeFunc +SUMOSAXAttributesImpl_Xerces::getEdgeFunc(bool& ok) const { + if (hasAttribute(SUMO_ATTR_FUNCTION)) { + std::string funcString = getString(SUMO_ATTR_FUNCTION); + if (SUMOXMLDefinitions::EdgeFunctions.hasString(funcString)) { + return SUMOXMLDefinitions::EdgeFunctions.get(funcString); + } + ok = false; + } + return EDGEFUNC_NORMAL; +} + + +SumoXMLNodeType +SUMOSAXAttributesImpl_Xerces::getNodeType(bool& ok) const { + if (hasAttribute(SUMO_ATTR_TYPE)) { + std::string typeString = getString(SUMO_ATTR_TYPE); + if (SUMOXMLDefinitions::NodeTypes.hasString(typeString)) { + return SUMOXMLDefinitions::NodeTypes.get(typeString); + } + ok = false; + } + return NODETYPE_UNKNOWN; +} + + +RGBColor +SUMOSAXAttributesImpl_Xerces::getColorReporting(const char* objectid, bool& ok) const { + try { + return RGBColor::parseColor(getString(SUMO_ATTR_COLOR)); + } catch (NumberFormatException&) { + } catch (EmptyData&) { + } + ok = false; + emitFormatError("color", "a valid color", objectid); + return RGBColor(); +} + + +PositionVector +SUMOSAXAttributesImpl_Xerces::getShapeReporting(int attr, const char* objectid, bool& ok, + bool allowEmpty) const { + std::string shpdef = getOptStringReporting(attr, objectid, ok, ""); + if (shpdef == "") { + if (!allowEmpty) { + emitEmptyError(getName(attr), objectid); + ok = false; + } + return PositionVector(); + } + StringTokenizer st(shpdef, " "); + PositionVector shape; + while (st.hasNext()) { + StringTokenizer pos(st.next(), ","); + if (pos.size() != 2 && pos.size() != 3) { + emitFormatError(getName(attr), "x,y or x,y,z", objectid); + ok = false; + return PositionVector(); + } + try { + SUMOReal x = TplConvert::_2SUMOReal(pos.next().c_str()); + SUMOReal y = TplConvert::_2SUMOReal(pos.next().c_str()); + if (pos.size() == 2) { + shape.push_back(Position(x, y)); + } else { + SUMOReal z = TplConvert::_2SUMOReal(pos.next().c_str()); + shape.push_back(Position(x, y, z)); + } + } catch (NumberFormatException&) { + emitFormatError(getName(attr), "all numeric position entries", objectid); + ok = false; + return PositionVector(); + } catch (EmptyData&) { + emitFormatError(getName(attr), "all valid entries", objectid); + ok = false; + return PositionVector(); + } + } + return shape; +} + + +Boundary +SUMOSAXAttributesImpl_Xerces::getBoundaryReporting(int attr, const char* objectid, bool& ok) const { + std::string def = getStringReporting(attr, objectid, ok); + StringTokenizer st(def, ","); + if (st.size() != 4) { + emitFormatError(getName(attr), "a valid number of entries", objectid); + ok = false; + return Boundary(); + } + try { + const SUMOReal xmin = TplConvert::_2SUMOReal(st.next().c_str()); + const SUMOReal ymin = TplConvert::_2SUMOReal(st.next().c_str()); + const SUMOReal xmax = TplConvert::_2SUMOReal(st.next().c_str()); + const SUMOReal ymax = TplConvert::_2SUMOReal(st.next().c_str()); + return Boundary(xmin, ymin, xmax, ymax); + } catch (NumberFormatException&) { + emitFormatError(getName(attr), "all numeric entries", objectid); + } catch (EmptyData&) { + emitFormatError(getName(attr), "all valid entries", objectid); + } + ok = false; + return Boundary(); +} + + std::string SUMOSAXAttributesImpl_Xerces::getName(int attr) const { if (myPredefinedTagsMML.find(attr) == myPredefinedTagsMML.end()) { @@ -195,5 +311,14 @@ } +void +SUMOSAXAttributesImpl_Xerces::serialize(std::ostream& os) const { + for (int i = 0; i < (int)myAttrs.getLength(); ++i) { + os << " " << TplConvert::_2str(myAttrs.getLocalName(i)); + os << "=\"" << TplConvert::_2str(myAttrs.getValue(i)) << "\""; + } +} + + /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2012-02-11 00:02:20.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2012-12-03 00:02:27.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributesImpl_Xerces.h 11876 2012-02-10 14:12:59Z dkrajzew $ +/// @version $Id: SUMOSAXAttributesImpl_Xerces.h 13109 2012-12-02 14:49:47Z behrisch $ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ @@ -33,18 +33,12 @@ #endif #include +#include +#include +#include #include +#include #include "SUMOSAXAttributes.h" -#include -#include - - -// =========================================================================== -// xerces 2.2 compatibility -// =========================================================================== -#if defined(XERCES_HAS_CPP_NAMESPACE) -using namespace XERCES_CPP_NAMESPACE; -#endif // =========================================================================== @@ -64,14 +58,14 @@ * @param[in] predefinedTags Map of attribute ids to their xerces-representation * @param[in] predefinedTagsMML Map of attribute ids to their (readable) string-representation */ - SUMOSAXAttributesImpl_Xerces(const Attributes& attrs, - const std::map &predefinedTags, - const std::map &predefinedTagsMML, - const std::string& objectType) ; + SUMOSAXAttributesImpl_Xerces(const XERCES_CPP_NAMESPACE::Attributes& attrs, + const std::map& predefinedTags, + const std::map& predefinedTagsMML, + const std::string& objectType); /// @brief Destructor - virtual ~SUMOSAXAttributesImpl_Xerces() ; + virtual ~SUMOSAXAttributesImpl_Xerces(); @@ -84,7 +78,7 @@ * @param[in] id The id of the searched attribute * @return Whether the attribute is within the attributes */ - bool hasAttribute(int id) const ; + bool hasAttribute(int id) const; /** @@ -136,7 +130,7 @@ * @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 throw(EmptyData, NumberFormatException); + int getInt(int id) const; /** * @brief Returns the int-value of the named (by its enum-value) attribute @@ -155,7 +149,7 @@ * @exception EmptyData If the attribute value is an empty string * @exception NumberFormatException If the attribute value can not be parsed to an int */ - int getIntSecure(int id, int def) const throw(EmptyData, NumberFormatException); + int getIntSecure(int id, int def) const; /** @@ -173,7 +167,7 @@ * @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 getLong(int id) const throw(EmptyData, NumberFormatException); + SUMOLong getLong(int id) const; /** @@ -221,7 +215,7 @@ * @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 SUMOReal */ - SUMOReal getFloat(int id) const throw(EmptyData, NumberFormatException); + SUMOReal getFloat(int id) const; /** * @brief Returns the SUMOReal-value of the named (by its enum-value) attribute @@ -240,13 +234,13 @@ * @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 SUMOReal */ - SUMOReal getFloatSecure(int id, SUMOReal def) const throw(EmptyData, NumberFormatException); + SUMOReal getFloatSecure(int id, SUMOReal def) const; /** * @brief Returns the information whether the named attribute is within the current list */ - bool hasAttribute(const std::string& id) const ; + bool hasAttribute(const std::string& id) const; /** @@ -264,7 +258,7 @@ * @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 SUMOReal */ - SUMOReal getFloat(const std::string& id) const throw(EmptyData, NumberFormatException); + SUMOReal getFloat(const std::string& id) const; /** @@ -277,10 +271,70 @@ * @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 ; + 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 SumoXMLEdgeFunc, 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 SumoXMLNodeType, if it could be read and parsed + */ + SumoXMLNodeType getNodeType(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 getColorReporting(const char* objectid, bool& ok) const; + + + /** @brief Tries to read given attribute assuming it is a PositionVector + * + * If an error occurs (the attribute is not there, it's empty), "ok" is + * set to false and an error message is written to MsgHandler::getErrorInstance. + * + * Otherwise, "ok" is not changed. + * + * @param[in] attr The id of the attribute to read + * @param[in] objectid The name of the parsed object; used for error message generation + * @param[out] ok Whether the value could be read + * @param[in] report Whether errors shall be written to msg handler's error instance + * @return The read value if given and not empty; "" if an error occured + */ + PositionVector getShapeReporting(int attr, const char* objectid, bool& ok, + bool allowEmpty) const; + + + /** @brief Tries to read given attribute assuming it is a Boundary + * + * If an error occurs (the attribute is not there, it's empty), "ok" is + * set to false and an error message is written to MsgHandler::getErrorInstance. + * + * Otherwise, "ok" is not changed. + * + * @param[in] attr The id of the attribute to read + * @param[in] objectid The name of the parsed object; used for error message generation + * @param[out] ok Whether the value could be read + * @param[in] report Whether errors shall be written to msg handler's error instance + * @return The read value if given and not empty; "" if an error occured + */ + Boundary getBoundaryReporting(int attr, const char* objectid, bool& ok) const; + + /** @brief Converts the given attribute id into a man readable string * * Returns a "?" if the attribute is not known. @@ -288,7 +342,14 @@ * @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 ; + 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; private: @@ -298,12 +359,12 @@ * @param[in] id The id of the attribute to retrieve the vale of * @return The xerces-value of the attribute */ - const XMLCh* getAttributeValueSecure(int id) const ; + const XMLCh* getAttributeValueSecure(int id) const; private: /// @brief The encapsulated attributes - const Attributes& myAttrs; + const XERCES_CPP_NAMESPACE::Attributes& myAttrs; /// @brief Definition of a map of attribute ids to their xerces-representation typedef std::map AttrMap; @@ -311,7 +372,7 @@ const AttrMap& myPredefinedTags; /// @brief Map of attribute ids to their (readable) string-representation - const std::map &myPredefinedTagsMML; + const std::map& myPredefinedTagsMML; private: diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXHandler.h sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXHandler.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXHandler.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXHandler.h 2012-11-05 00:02:22.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: SUMOSAXHandler.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SUMOSAXHandler.h 12927 2012-11-04 06:47:13Z behrisch $ /// // SAX-handler base for SUMO-files /****************************************************************************/ @@ -45,9 +45,6 @@ * * This class is a GenericSAXHandler which knows all tags SUMO uses, so all * SUMO-XML - loading classes should be derived from it. - * - * Besides the functionality of GenericSAXHandler it - * implements methods for dealing with SAX-parser errors. */ class SUMOSAXHandler : public GenericSAXHandler { public: @@ -63,9 +60,6 @@ virtual ~SUMOSAXHandler(); - -private: - private: /// @brief invalidated copy constructor SUMOSAXHandler(const SUMOSAXHandler& s); diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXReader.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXReader.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXReader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXReader.cpp 2012-12-03 00:02:27.000000000 +0000 @@ -0,0 +1,190 @@ +/****************************************************************************/ +/// @file SUMOSAXReader.cpp +/// @author Michael Behrisch +/// @date Nov 2012 +/// @version $Id: SUMOSAXReader.cpp 13109 2012-12-02 14:49:47Z behrisch $ +/// +// SAX-reader encapsulation containing binary reader +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "SUMOSAXAttributesImpl_Binary.h" +#include "GenericSAXHandler.h" +#include "SUMOSAXReader.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +SUMOSAXReader::SUMOSAXReader(GenericSAXHandler& handler, const bool enableValidation) + : myHandler(&handler), myEnableValidation(enableValidation), + myXMLReader(0), myBinaryInput(0) {} + + +SUMOSAXReader::~SUMOSAXReader() { + delete myXMLReader; + delete myBinaryInput; +} + + +void +SUMOSAXReader::setHandler(GenericSAXHandler& handler) { + myHandler = &handler; + if (myXMLReader != 0) { + myXMLReader->setContentHandler(&handler); + myXMLReader->setErrorHandler(&handler); + } +} + + +void +SUMOSAXReader::parse(std::string systemID) { + if (systemID.substr(systemID.length() - 4) == ".sbx") { + if (parseFirst(systemID)) { + while (parseNext()); + } + } else { + if (myXMLReader == 0) { + myXMLReader = getSAXReader(); + } + myXMLReader->parse(systemID.c_str()); + } +} + + +void +SUMOSAXReader::parseString(std::string content) { + if (myXMLReader == 0) { + myXMLReader = getSAXReader(); + } + XERCES_CPP_NAMESPACE::MemBufInputSource memBufIS((const XMLByte*)content.c_str(), content.size(), "registrySettings"); + myXMLReader->parse(memBufIS); +} + + +bool +SUMOSAXReader::parseFirst(std::string systemID) { + if (systemID.substr(systemID.length() - 4) == ".sbx") { + myBinaryInput = new BinaryInputDevice(systemID, true, myEnableValidation); + char sbxVer; + *myBinaryInput >> sbxVer; + if (sbxVer != 1) { + 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 (myXMLReader == 0) { + myXMLReader = getSAXReader(); + } + myToken = XERCES_CPP_NAMESPACE::XMLPScanToken(); + return myXMLReader->parseFirst(systemID.c_str(), myToken); + } +} + + +bool +SUMOSAXReader::parseNext() { + if (myBinaryInput != 0) { + int next = myBinaryInput->peek(); + switch (next) { + case EOF: + delete myBinaryInput; + myBinaryInput = 0; + return false; + case BinaryFormatter::BF_XML_TAG_START: { + char t; + *myBinaryInput >> t; + SUMOSAXAttributesImpl_Binary attrs(myHandler->myPredefinedTagsMML, toString((SumoXMLTag)t), myBinaryInput); + myHandler->myStartElement(t, attrs); + break; + } + case BinaryFormatter::BF_XML_TAG_END: { + char t; + *myBinaryInput >> t; + myHandler->myEndElement(t); + break; + } + default: + throw ProcessError("Invalid binary file"); + } + return true; + } else { + if (myXMLReader == 0) { + throw ProcessError("The XML-parser was not initialized."); + } + return myXMLReader->parseNext(myToken); + } +} + + +XERCES_CPP_NAMESPACE::SAX2XMLReader* +SUMOSAXReader::getSAXReader() { + XERCES_CPP_NAMESPACE::SAX2XMLReader* reader = XERCES_CPP_NAMESPACE::XMLReaderFactory::createXMLReader(); + if (reader == 0) { + throw ProcessError("The XML-parser could not be build."); + } + if (!myEnableValidation) { + reader->setProperty(XERCES_CPP_NAMESPACE::XMLUni::fgXercesScannerName, (void*)XERCES_CPP_NAMESPACE::XMLUni::fgWFXMLScanner); + } +// see here https://svn.apache.org/repos/asf/xerces/c/trunk/samples/src/SAX2Count/SAX2Count.cpp for the way to set features + reader->setFeature(XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchema, myEnableValidation); + reader->setFeature(XERCES_CPP_NAMESPACE::XMLUni::fgSAX2CoreValidation, myEnableValidation); + reader->setFeature(XERCES_CPP_NAMESPACE::XMLUni::fgXercesDynamic, myEnableValidation); + reader->setContentHandler(myHandler); + reader->setErrorHandler(myHandler); + return reader; +} + + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXReader.h sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXReader.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOSAXReader.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOSAXReader.h 2012-12-03 00:02:27.000000000 +0000 @@ -0,0 +1,119 @@ +/****************************************************************************/ +/// @file SUMOSAXReader.h +/// @author Michael Behrisch +/// @date Nov 2012 +/// @version $Id: SUMOSAXReader.h 13109 2012-12-02 14:49:47Z behrisch $ +/// +// SAX-reader encapsulation containing binary reader +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This file is part of SUMO. +// SUMO is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ +#ifndef SUMOSAXReader_h +#define SUMOSAXReader_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class GenericSAXHandler; +class BinaryInputDevice; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class SUMOSAXReader + * @brief SAX-reader encapsulation containing binary reader + * + * This class generates on demand either a SAX2XMLReader or parses the SUMO + * binary xml. The interface is inspired by but not identical to + * SAX2XMLReader. + */ +class SUMOSAXReader { +public: + /** + * @brief Constructor + * + * @param[in] file The name of the processed file + */ + SUMOSAXReader(GenericSAXHandler& handler, const bool enableValidation = false); + + /// Destructor + ~SUMOSAXReader(); + + /** + * @brief Sets the given handler as content and error handler for the reader + * + * @param[in] handler The handler to assign to the reader + */ + void setHandler(GenericSAXHandler& handler); + + void parse(std::string systemID); + + void parseString(std::string content); + + bool parseFirst(std::string systemID); + + bool parseNext(); + +private: + /** + * @brief Builds a reader + * + * Tries to build a SAX2XMLReader using XMLReaderFactory::createXMLReader. If this + * fails, 0 is returned. Otherwise the validation is set matching the value of + * "myEnableValidation". If validation is not wanted, a WFXMLScanner is used + * (see http://www.ibm.com/developerworks/library/x-xercesperf.html). + * + * @return The built Xerces-SAX-reader, 0 if something failed + */ + XERCES_CPP_NAMESPACE::SAX2XMLReader* getSAXReader(); + + +private: + GenericSAXHandler* myHandler; + + /// @brief Information whether built reader/parser shall validate XML-documents against schemata + const bool myEnableValidation; + + XERCES_CPP_NAMESPACE::XMLPScanToken myToken; + + XERCES_CPP_NAMESPACE::SAX2XMLReader* myXMLReader; + + BinaryInputDevice* myBinaryInput; + +private: + /// @brief invalidated copy constructor + SUMOSAXReader(const SUMOSAXReader& s); + + /// @brief invalidated assignment operator + const SUMOSAXReader& operator=(const SUMOSAXReader& s); + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.cpp 2012-01-29 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.cpp 2012-12-02 13:57:49.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 07.04.2008 -/// @version $Id: SUMOVehicleParserHelper.cpp 11808 2012-01-28 21:36:11Z behrisch $ +/// @version $Id: SUMOVehicleParserHelper.cpp 13107 2012-12-02 13:57:34Z behrisch $ /// // Helper methods for parsing vehicle attributes /****************************************************************************/ @@ -35,8 +35,8 @@ #include #include #include -#include #include +#include #include #include "SUMOVehicleParserHelper.h" @@ -50,16 +50,6 @@ // =========================================================================== SUMOVehicleParserHelper::CFAttrMap SUMOVehicleParserHelper::allowedCFModelAttrs; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedNumber = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedTazs = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedDepartLane = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedDepartPos = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedDepartSpeed = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedArrivalLane = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedArrivalPos = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedArrivalSpeed = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedMaxSpeed = false; -bool SUMOVehicleParserHelper::gHaveWarnedAboutDeprecatedVClass = false; // =========================================================================== @@ -75,7 +65,7 @@ "' has to be given in the definition of flow '" + id + "'."); } if (attrs.hasAttribute(SUMO_ATTR_PERIOD) || attrs.hasAttribute(SUMO_ATTR_VEHSPERHOUR)) { - if (attrs.hasAttribute(SUMO_ATTR_END) && (attrs.hasAttribute(SUMO_ATTR_NO__DEPRECATED) || attrs.hasAttribute(SUMO_ATTR_NUMBER))) { + if (attrs.hasAttribute(SUMO_ATTR_END) && attrs.hasAttribute(SUMO_ATTR_NUMBER)) { throw ProcessError("If '" + attrs.getName(SUMO_ATTR_PERIOD) + "' or '" + attrs.getName(SUMO_ATTR_VEHSPERHOUR) + "' are given at most one of '" + attrs.getName(SUMO_ATTR_END) + @@ -83,7 +73,7 @@ "' are allowed in flow '" + id + "'."); } } else { - if (!attrs.hasAttribute(SUMO_ATTR_NO__DEPRECATED) && !attrs.hasAttribute(SUMO_ATTR_NUMBER)) { + if (!attrs.hasAttribute(SUMO_ATTR_NUMBER)) { throw ProcessError("At least one of '" + attrs.getName(SUMO_ATTR_PERIOD) + "', '" + attrs.getName(SUMO_ATTR_VEHSPERHOUR) + "', and '" + attrs.getName(SUMO_ATTR_NUMBER) + @@ -134,14 +124,8 @@ delete ret; throw ProcessError("Flow '" + id + "' ends before or at its begin time."); } - if (attrs.hasAttribute(SUMO_ATTR_NO__DEPRECATED) || attrs.hasAttribute(SUMO_ATTR_NUMBER)) { - ret->repetitionNumber = attrs.hasAttribute(SUMO_ATTR_NUMBER) - ? attrs.getIntReporting(SUMO_ATTR_NUMBER, id.c_str(), ok) - : attrs.getIntReporting(SUMO_ATTR_NO__DEPRECATED, id.c_str(), ok); - if (!gHaveWarnedAboutDeprecatedNumber && attrs.hasAttribute(SUMO_ATTR_NO__DEPRECATED)) { - gHaveWarnedAboutDeprecatedNumber = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_NO__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_NUMBER) + "' instead."); - } + if (attrs.hasAttribute(SUMO_ATTR_NUMBER)) { + ret->repetitionNumber = attrs.getIntReporting(SUMO_ATTR_NUMBER, id.c_str(), ok); ret->setParameter |= VEHPARS_PERIODFREQ_SET; if (ok && ret->repetitionNumber < 0) { delete ret; @@ -247,220 +231,93 @@ ret->line = attrs.getStringReporting(SUMO_ATTR_LINE, 0, ok); } // parse zone information - if ((attrs.hasAttribute(SUMO_ATTR_FROM_TAZ) || attrs.hasAttribute(SUMO_ATTR_FROM_TAZ__DEPRECATED)) - && - (attrs.hasAttribute(SUMO_ATTR_TO_TAZ) || attrs.hasAttribute(SUMO_ATTR_TO_TAZ__DEPRECATED))) { + if (attrs.hasAttribute(SUMO_ATTR_FROM_TAZ) && attrs.hasAttribute(SUMO_ATTR_TO_TAZ)) { ret->setParameter |= VEHPARS_TAZ_SET; - ret->fromTaz = attrs.hasAttribute(SUMO_ATTR_FROM_TAZ) - ? attrs.getStringReporting(SUMO_ATTR_FROM_TAZ, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_FROM_TAZ__DEPRECATED, 0, ok); - ret->toTaz = attrs.hasAttribute(SUMO_ATTR_TO_TAZ) - ? attrs.getStringReporting(SUMO_ATTR_TO_TAZ, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_TO_TAZ__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedTazs && (attrs.hasAttribute(SUMO_ATTR_TO_TAZ__DEPRECATED) || attrs.hasAttribute(SUMO_ATTR_FROM_TAZ__DEPRECATED))) { - gHaveWarnedAboutDeprecatedTazs = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_FROM_TAZ__DEPRECATED) - + "'/'" + toString(SUMO_ATTR_TO_TAZ__DEPRECATED) - + "' is deprecated, please use '" + toString(SUMO_ATTR_FROM_TAZ) - + "'/'" + toString(SUMO_ATTR_TO_TAZ) - + "' instead."); - } + ret->fromTaz = attrs.getStringReporting(SUMO_ATTR_FROM_TAZ, 0, ok); + ret->toTaz = attrs.getStringReporting(SUMO_ATTR_TO_TAZ, 0, ok); } // parse reroute information if (attrs.getOptBoolReporting(SUMO_ATTR_REROUTE, 0, ok, false)) { ret->setParameter |= VEHPARS_FORCE_REROUTE; } + std::string error; // parse depart lane information - if (attrs.hasAttribute(SUMO_ATTR_DEPARTLANE) || attrs.hasAttribute(SUMO_ATTR_DEPARTLANE__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_DEPARTLANE)) { ret->setParameter |= VEHPARS_DEPARTLANE_SET; - const std::string helper = attrs.hasAttribute(SUMO_ATTR_DEPARTLANE) - ? attrs.getStringReporting(SUMO_ATTR_DEPARTLANE, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_DEPARTLANE__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedDepartLane && attrs.hasAttribute(SUMO_ATTR_DEPARTLANE__DEPRECATED)) { - gHaveWarnedAboutDeprecatedDepartLane = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_DEPARTLANE__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_DEPARTLANE) + "' instead."); - } - if (helper == "random") { - ret->departLaneProcedure = DEPART_LANE_RANDOM; - } else if (helper == "free") { - ret->departLaneProcedure = DEPART_LANE_FREE; - } else if (helper == "allowed") { - ret->departLaneProcedure = DEPART_LANE_ALLOWED_FREE; - } else if (helper == "best") { - ret->departLaneProcedure = DEPART_LANE_BEST_FREE; - } else { - try { - ret->departLane = TplConvert::_2int(helper.c_str()); - ret->departLaneProcedure = DEPART_LANE_GIVEN; - if (ret->departLane < 0) { - throw ProcessError("Invalid departLane definition for " + element + " '" + ret->id + "'"); - } - } catch (NumberFormatException&) { - throw ProcessError("Invalid departLane definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid departLane definition for " + element + " '" + ret->id + "'"); - } + const std::string helper = attrs.getStringReporting(SUMO_ATTR_DEPARTLANE, 0, ok); + if (!SUMOVehicleParameter::parseDepartLane(helper, element, ret->id, ret->departLane, ret->departLaneProcedure, error)) { + throw ProcessError(error); } } // parse depart position information - if (attrs.hasAttribute(SUMO_ATTR_DEPARTPOS) || attrs.hasAttribute(SUMO_ATTR_DEPARTPOS__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_DEPARTPOS)) { ret->setParameter |= VEHPARS_DEPARTPOS_SET; - const std::string helper = attrs.hasAttribute(SUMO_ATTR_DEPARTPOS) - ? attrs.getStringReporting(SUMO_ATTR_DEPARTPOS, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_DEPARTPOS__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedDepartPos && attrs.hasAttribute(SUMO_ATTR_DEPARTPOS__DEPRECATED)) { - gHaveWarnedAboutDeprecatedDepartPos = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_DEPARTPOS__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_DEPARTPOS) + "' instead."); - } - if (helper == "random") { - ret->departPosProcedure = DEPART_POS_RANDOM; - } else if (helper == "random_free") { - ret->departPosProcedure = DEPART_POS_RANDOM_FREE; - } else if (helper == "free") { - ret->departPosProcedure = DEPART_POS_FREE; - } else if (helper == "base") { - ret->departPosProcedure = DEPART_POS_BASE; - } else if (helper == "pwagSimple") { - ret->departPosProcedure = DEPART_POS_PWAG_SIMPLE; - } else if (helper == "pwagGeneric") { - ret->departPosProcedure = DEPART_POS_PWAG_GENERIC; - } else if (helper == "maxSpeedGap") { - ret->departPosProcedure = DEPART_POS_MAX_SPEED_GAP; - } else { - try { - ret->departPos = TplConvert::_2SUMOReal(helper.c_str()); - ret->departPosProcedure = DEPART_POS_GIVEN; - } catch (NumberFormatException&) { - throw ProcessError("Invalid departPos definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid departPos definition for " + element + " '" + ret->id + "'"); - } + const std::string helper = attrs.getStringReporting(SUMO_ATTR_DEPARTPOS, 0, ok); + if (!SUMOVehicleParameter::parseDepartPos(helper, element, ret->id, ret->departPos, ret->departPosProcedure, error)) { + throw ProcessError(error); } } // parse depart speed information - if (attrs.hasAttribute(SUMO_ATTR_DEPARTSPEED) || attrs.hasAttribute(SUMO_ATTR_DEPARTSPEED__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_DEPARTSPEED)) { ret->setParameter |= VEHPARS_DEPARTSPEED_SET; - std::string helper = attrs.hasAttribute(SUMO_ATTR_DEPARTSPEED) - ? attrs.getStringReporting(SUMO_ATTR_DEPARTSPEED, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_DEPARTSPEED__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedDepartSpeed && attrs.hasAttribute(SUMO_ATTR_DEPARTSPEED__DEPRECATED)) { - gHaveWarnedAboutDeprecatedDepartSpeed = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_DEPARTSPEED__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_DEPARTSPEED) + "' instead."); - } - if (helper == "random") { - ret->departSpeedProcedure = DEPART_SPEED_RANDOM; - } else if (helper == "max") { - ret->departSpeedProcedure = DEPART_SPEED_MAX; - } else { - try { - ret->departSpeed = TplConvert::_2SUMOReal(helper.c_str()); - ret->departSpeedProcedure = DEPART_SPEED_GIVEN; - } catch (NumberFormatException&) { - throw ProcessError("Invalid departSpeed definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid departSpeed definition for " + element + " '" + ret->id + "'"); - } + std::string helper = attrs.getStringReporting(SUMO_ATTR_DEPARTSPEED, 0, ok); + if (!SUMOVehicleParameter::parseDepartSpeed(helper, element, ret->id, ret->departSpeed, ret->departSpeedProcedure, error)) { + throw ProcessError(error); } } // parse arrival lane information - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALLANE) || attrs.hasAttribute(SUMO_ATTR_ARRIVALLANE__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALLANE)) { ret->setParameter |= VEHPARS_ARRIVALLANE_SET; - std::string helper = attrs.hasAttribute(SUMO_ATTR_ARRIVALLANE) - ? attrs.getStringReporting(SUMO_ATTR_ARRIVALLANE, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_ARRIVALLANE__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedArrivalLane && attrs.hasAttribute(SUMO_ATTR_ARRIVALLANE__DEPRECATED)) { - gHaveWarnedAboutDeprecatedArrivalLane = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_ARRIVALLANE__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_ARRIVALLANE) + "' instead."); - } - if (helper == "current") { - ret->arrivalLaneProcedure = ARRIVAL_LANE_CURRENT; - } else { - try { - ret->arrivalLane = TplConvert::_2int(helper.c_str()); - ret->arrivalLaneProcedure = ARRIVAL_LANE_GIVEN; - } catch (NumberFormatException&) { - throw ProcessError("Invalid arrivalLane definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid arrivalLane definition for " + element + " '" + ret->id + "'"); - } + std::string helper = attrs.getStringReporting(SUMO_ATTR_ARRIVALLANE, 0, ok); + if (!SUMOVehicleParameter::parseArrivalLane(helper, element, ret->id, ret->arrivalLane, ret->arrivalLaneProcedure, error)) { + throw ProcessError(error); } } // parse arrival position information - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS) || attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { ret->setParameter |= VEHPARS_ARRIVALPOS_SET; - std::string helper = attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS) - ? attrs.getStringReporting(SUMO_ATTR_ARRIVALPOS, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_ARRIVALPOS__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedArrivalPos && attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS__DEPRECATED)) { - gHaveWarnedAboutDeprecatedArrivalPos = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_ARRIVALPOS__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_ARRIVALPOS) + "' instead."); - } - if (helper == "random") { - ret->arrivalPosProcedure = ARRIVAL_POS_RANDOM; - } else if (helper == "max") { - ret->arrivalPosProcedure = ARRIVAL_POS_MAX; - } else { - try { - ret->arrivalPos = TplConvert::_2SUMOReal(helper.c_str()); - ret->arrivalPosProcedure = ARRIVAL_POS_GIVEN; - } catch (NumberFormatException&) { - throw ProcessError("Invalid arrivalPos definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid arrivalPos definition for " + element + " '" + ret->id + "'"); - } + std::string helper = attrs.getStringReporting(SUMO_ATTR_ARRIVALPOS, 0, ok); + if (!SUMOVehicleParameter::parseArrivalPos(helper, element, ret->id, ret->arrivalPos, ret->arrivalPosProcedure, error)) { + throw ProcessError(error); } } // parse arrival speed information - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALSPEED) || attrs.hasAttribute(SUMO_ATTR_ARRIVALSPEED__DEPRECATED)) { + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALSPEED)) { ret->setParameter |= VEHPARS_ARRIVALSPEED_SET; - std::string helper = attrs.hasAttribute(SUMO_ATTR_ARRIVALSPEED) - ? attrs.getStringReporting(SUMO_ATTR_ARRIVALSPEED, 0, ok) - : attrs.getStringReporting(SUMO_ATTR_ARRIVALSPEED__DEPRECATED, 0, ok); - if (!gHaveWarnedAboutDeprecatedArrivalSpeed && attrs.hasAttribute(SUMO_ATTR_ARRIVALSPEED__DEPRECATED)) { - gHaveWarnedAboutDeprecatedArrivalSpeed = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_ARRIVALSPEED__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_ARRIVALSPEED) + "' instead."); - } - if (helper == "current") { - ret->arrivalSpeedProcedure = ARRIVAL_SPEED_CURRENT; - } else { - try { - ret->arrivalSpeed = TplConvert::_2SUMOReal(helper.c_str()); - ret->arrivalSpeedProcedure = ARRIVAL_SPEED_GIVEN; - } catch (NumberFormatException&) { - throw ProcessError("Invalid arrivalSpeed definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid arrivalSpeed definition for " + element + " '" + ret->id + "'"); - } + std::string helper = attrs.getStringReporting(SUMO_ATTR_ARRIVALSPEED, 0, ok); + if (!SUMOVehicleParameter::parseArrivalSpeed(helper, element, ret->id, ret->arrivalSpeed, ret->arrivalSpeedProcedure, error)) { + throw ProcessError(error); } } // parse color if (attrs.hasAttribute(SUMO_ATTR_COLOR)) { ret->setParameter |= VEHPARS_COLOR_SET; - try { - ret->color = RGBColor::parseColor(attrs.getStringReporting(SUMO_ATTR_COLOR, 0, ok)); - } catch (NumberFormatException&) { - throw ProcessError("Invalid color definition for " + element + " '" + ret->id + "'"); - } catch (EmptyData&) { - throw ProcessError("Invalid color definition for " + element + " '" + ret->id + "'"); - } + ret->color = attrs.getColorReporting(ret->id.c_str(), ok); } else { ret->color = RGBColor::DEFAULT_COLOR; } + // 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); + } } SUMOVTypeParameter* -SUMOVehicleParserHelper::beginVTypeParsing(const SUMOSAXAttributes& attrs) { +SUMOVehicleParserHelper::beginVTypeParsing(const SUMOSAXAttributes& attrs, const std::string& file) { SUMOVTypeParameter* vtype = new SUMOVTypeParameter(); bool ok = true; vtype->id = attrs.getStringReporting(SUMO_ATTR_ID, 0, ok); if (attrs.hasAttribute(SUMO_ATTR_LENGTH)) { - if (!attrs.hasAttribute(SUMO_ATTR_MINGAP)) { - WRITE_WARNING("The length does not include the gap to the preceeding vehicle anymore! Please recheck your values."); - } vtype->length = attrs.getSUMORealReporting(SUMO_ATTR_LENGTH, vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_LENGTH_SET; } @@ -468,21 +325,9 @@ vtype->minGap = attrs.getSUMORealReporting(SUMO_ATTR_MINGAP, vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_MINGAP_SET; } - if (attrs.hasAttribute(SUMO_ATTR_GUIOFFSET)) { - WRITE_WARNING("The guiOffset attribute is deprecated! Please use minGap instead."); - vtype->minGap = attrs.getSUMORealReporting(SUMO_ATTR_GUIOFFSET, vtype->id.c_str(), ok); - vtype->setParameter |= VTYPEPARS_MINGAP_SET; - } if (attrs.hasAttribute(SUMO_ATTR_MAXSPEED)) { vtype->maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_MAXSPEED, vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_MAXSPEED_SET; - } else if (attrs.hasAttribute(SUMO_ATTR_MAXSPEED__DEPRECATED)) { - vtype->maxSpeed = attrs.getSUMORealReporting(SUMO_ATTR_MAXSPEED__DEPRECATED, vtype->id.c_str(), ok); - vtype->setParameter |= VTYPEPARS_MAXSPEED_SET; - if (!gHaveWarnedAboutDeprecatedMaxSpeed) { - gHaveWarnedAboutDeprecatedMaxSpeed = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_MAXSPEED__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_MAXSPEED) + "' instead."); - } } if (attrs.hasAttribute(SUMO_ATTR_SPEEDFACTOR)) { vtype->speedFactor = attrs.getSUMORealReporting(SUMO_ATTR_SPEEDFACTOR, vtype->id.c_str(), ok); @@ -496,11 +341,7 @@ vtype->emissionClass = parseEmissionClass(attrs, vtype->id); vtype->setParameter |= VTYPEPARS_EMISSIONCLASS_SET; } - if (attrs.hasAttribute(SUMO_ATTR_VCLASS) || attrs.hasAttribute(SUMO_ATTR_VCLASS__DEPRECATED)) { - if (!gHaveWarnedAboutDeprecatedVClass && attrs.hasAttribute(SUMO_ATTR_VCLASS__DEPRECATED)) { - gHaveWarnedAboutDeprecatedVClass = true; - WRITE_WARNING("'" + toString(SUMO_ATTR_VCLASS__DEPRECATED) + "' is deprecated, please use '" + toString(SUMO_ATTR_VCLASS) + "' instead."); - } + if (attrs.hasAttribute(SUMO_ATTR_VCLASS)) { vtype->vehicleClass = parseVehicleClass(attrs, vtype->id); vtype->setParameter |= VTYPEPARS_VEHICLECLASS_SET; } @@ -520,8 +361,15 @@ vtype->osgFile = attrs.getStringReporting(SUMO_ATTR_OSGFILE, vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_OSGFILE_SET; } + if (attrs.hasAttribute(SUMO_ATTR_IMGFILE)) { + vtype->imgFile = attrs.getStringReporting(SUMO_ATTR_IMGFILE, vtype->id.c_str(), ok); + if (vtype->imgFile != "" && !FileHelpers::isAbsolute(vtype->imgFile)) { + vtype->imgFile = FileHelpers::getConfigurationRelative(file, vtype->imgFile); + } + vtype->setParameter |= VTYPEPARS_IMGFILE_SET; + } if (attrs.hasAttribute(SUMO_ATTR_COLOR)) { - vtype->color = RGBColor::parseColorReporting(attrs.getString(SUMO_ATTR_COLOR), attrs.getObjectType(), vtype->id.c_str(), true, ok); + vtype->color = attrs.getColorReporting(vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_COLOR_SET; } else { vtype->color = RGBColor(1, 1, 0); @@ -588,6 +436,30 @@ allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS] = krausParams; allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS_ORIG1] = krausParams; + std::set 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; + + std::set daniel1Params; + daniel1Params.insert(SUMO_ATTR_ACCEL); + daniel1Params.insert(SUMO_ATTR_DECEL); + daniel1Params.insert(SUMO_ATTR_SIGMA); + daniel1Params.insert(SUMO_ATTR_TAU); + daniel1Params.insert(SUMO_ATTR_TMP1); + daniel1Params.insert(SUMO_ATTR_TMP2); + daniel1Params.insert(SUMO_ATTR_TMP3); + daniel1Params.insert(SUMO_ATTR_TMP4); + daniel1Params.insert(SUMO_ATTR_TMP5); + allowedCFModelAttrs[SUMO_TAG_CF_DANIEL1] = daniel1Params; + std::set pwagParams; pwagParams.insert(SUMO_ATTR_ACCEL); pwagParams.insert(SUMO_ATTR_DECEL); @@ -639,9 +511,7 @@ SUMOVehicleClass vclass = SVC_UNKNOWN; try { bool ok = true; - std::string vclassS = attrs.hasAttribute(SUMO_ATTR_VCLASS) - ? attrs.getOptStringReporting(SUMO_ATTR_VCLASS, id.c_str(), ok, "") - : attrs.getOptStringReporting(SUMO_ATTR_VCLASS__DEPRECATED, id.c_str(), ok, ""); + std::string vclassS = attrs.getOptStringReporting(SUMO_ATTR_VCLASS, id.c_str(), ok, ""); if (vclassS == "") { return vclass; } diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.h sumo-0.16.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOVehicleParserHelper.h 2012-10-22 23:02:37.000000000 +0000 @@ -5,7 +5,7 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 07.04.2008 -/// @version $Id: SUMOVehicleParserHelper.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: SUMOVehicleParserHelper.h 12880 2012-10-22 14:15:33Z namdre $ /// // Helper methods for parsing vehicle attributes /****************************************************************************/ @@ -64,7 +64,7 @@ * @exception ProcessError If an attribute's value is invalid * @note: the caller is responsible for deleting the returned pointer */ - static SUMOVehicleParameter* parseFlowAttributes(const SUMOSAXAttributes& attrs) ; + static SUMOVehicleParameter* parseFlowAttributes(const SUMOSAXAttributes& attrs); /** @brief Parses a vehicle's attributes @@ -80,17 +80,18 @@ * @note: the caller is responsible for deleting the returned pointer */ static SUMOVehicleParameter* parseVehicleAttributes(const SUMOSAXAttributes& attrs, - bool skipID = false, bool skipDepart = false) ; + bool skipID = false, bool skipDepart = false); /** @brief Starts to parse a vehicle type * * @param[in] attr The SAX-attributes to get vehicle parameter from + * @param[in] file The name of the file being parsed (for resolving paths) * @exception ProcessError If an attribute's value is invalid * @see SUMOVTypeParameter * @note: the caller is responsible for deleting the returned pointer */ - static SUMOVTypeParameter* beginVTypeParsing(const SUMOSAXAttributes& attrs) ; + static SUMOVTypeParameter* beginVTypeParsing(const SUMOSAXAttributes& attrs, const std::string& file); /** @brief Parses an element embedded in vtype definition @@ -104,7 +105,7 @@ */ static void parseVTypeEmbedded(SUMOVTypeParameter& into, int element, const SUMOSAXAttributes& attrs, - bool fromVType = false) ; + bool fromVType = false); /** @brief Closes parsing of the vehicle type @@ -179,7 +180,7 @@ * @exception ProcessError If an attribute's value is invalid */ static void parseCommonAttributes(const SUMOSAXAttributes& attrs, - SUMOVehicleParameter* ret, std::string element) ; + SUMOVehicleParameter* ret, std::string element); typedef std::map > CFAttrMap; @@ -191,10 +192,6 @@ static CFAttrMap allowedCFModelAttrs; - static bool gHaveWarnedAboutDeprecatedNumber, gHaveWarnedAboutDeprecatedTazs, - gHaveWarnedAboutDeprecatedDepartLane, gHaveWarnedAboutDeprecatedDepartPos, gHaveWarnedAboutDeprecatedDepartSpeed, - gHaveWarnedAboutDeprecatedArrivalLane, gHaveWarnedAboutDeprecatedArrivalPos, gHaveWarnedAboutDeprecatedArrivalSpeed, - gHaveWarnedAboutDeprecatedMaxSpeed, gHaveWarnedAboutDeprecatedVClass; }; diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOXMLDefinitions.cpp sumo-0.16.0~dfsg/src/utils/xml/SUMOXMLDefinitions.cpp --- sumo-0.15.0~dfsg/src/utils/xml/SUMOXMLDefinitions.cpp 2012-01-29 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOXMLDefinitions.cpp 2012-10-18 23:02:43.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Sept 2002 -/// @version $Id: SUMOXMLDefinitions.cpp 11808 2012-01-28 21:36:11Z behrisch $ +/// @version $Id: SUMOXMLDefinitions.cpp 12857 2012-10-18 11:33:33Z namdre $ /// // Definitions of elements and attributes known by SUMO /****************************************************************************/ @@ -46,31 +46,25 @@ // =========================================================================== StringBijection::Entry SUMOXMLDefinitions::tags[] = { + { "net", SUMO_TAG_NET }, { "edge", SUMO_TAG_EDGE }, { "lane", SUMO_TAG_LANE }, { "poi", SUMO_TAG_POI }, { "poly", SUMO_TAG_POLY }, { "junction", SUMO_TAG_JUNCTION }, - { "e1-detector", SUMO_TAG_E1DETECTOR__DEPRECATED }, { "e1Detector", SUMO_TAG_E1DETECTOR }, { "inductionLoop", SUMO_TAG_INDUCTION_LOOP }, - { "e2-detector", SUMO_TAG_E2DETECTOR__DEPRECATED }, { "e2Detector", SUMO_TAG_E2DETECTOR }, { "laneAreaDetector", SUMO_TAG_LANE_AREA_DETECTOR }, - { "e3-detector", SUMO_TAG_E3DETECTOR__DEPRECATED }, { "e3Detector", SUMO_TAG_E3DETECTOR }, { "entryExitDetector", SUMO_TAG_ENTRY_EXIT_DETECTOR }, - { "meandata-edge", SUMO_TAG_MEANDATA_EDGE__DEPRECATED }, { "edgeData", SUMO_TAG_MEANDATA_EDGE }, - { "meandata-lane", SUMO_TAG_MEANDATA_LANE__DEPRECATED }, { "laneData", SUMO_TAG_MEANDATA_LANE }, #ifdef _MESSAGES { "msgemitter", SUMO_TAG_MSG_EMITTER }, #endif - { "det_entry", SUMO_TAG_DET_ENTRY__DEPRECATED }, { "detEntry", SUMO_TAG_DET_ENTRY }, - { "det_exit", SUMO_TAG_DET_EXIT__DEPRECATED }, { "detExit", SUMO_TAG_DET_EXIT }, { "edgeFollowDetector", SUMO_TAG_EDGEFOLLOWDETECTOR }, { "instantInductionLoop", SUMO_TAG_INSTANT_INDUCTION_LOOP }, @@ -78,39 +72,25 @@ { "calibrator", SUMO_TAG_CALIBRATOR }, { "rerouter", SUMO_TAG_REROUTER }, { "busStop", SUMO_TAG_BUS_STOP }, - { "vtypeprobe", SUMO_TAG_VTYPEPROBE__DEPRECATED }, { "vTypeProbe", SUMO_TAG_VTYPEPROBE }, - { "routeprobe", SUMO_TAG_ROUTEPROBE__DEPRECATED }, { "routeProbe", SUMO_TAG_ROUTEPROBE }, + { "routes", SUMO_TAG_ROUTES }, { "vehicle", SUMO_TAG_VEHICLE }, - { "vtype", SUMO_TAG_VTYPE__DEPRECATED }, { "vType", SUMO_TAG_VTYPE }, { "route", SUMO_TAG_ROUTE }, - { "succ", SUMO_TAG_SUCC }, - { "succlane", SUMO_TAG_SUCCLANE }, - { "logicitem", SUMO_TAG_LOGICITEM }, // deprecated - { "row-logic", SUMO_TAG_ROWLOGIC__DEPRECATED }, // deprecated { "request", SUMO_TAG_REQUEST }, { "source", SUMO_TAG_SOURCE }, - { "district", SUMO_TAG_DISTRICT__DEPRECATED }, { "taz", SUMO_TAG_TAZ }, - { "dsource", SUMO_TAG_DSOURCE__DEPRECATED }, { "tazSource", SUMO_TAG_TAZSOURCE }, - { "dsink", SUMO_TAG_DSINK__DEPRECATED }, { "tazSink", SUMO_TAG_TAZSINK }, - { "tl-logic", SUMO_TAG_TLLOGIC__DEPRECATED }, { "tlLogic", SUMO_TAG_TLLOGIC }, { "phase", SUMO_TAG_PHASE }, - { "tripdef", SUMO_TAG_TRIP__DEPRECATED }, { "trip", SUMO_TAG_TRIP }, { "flow", SUMO_TAG_FLOW }, { "step", SUMO_TAG_STEP }, { "interval", SUMO_TAG_INTERVAL }, - { "timed_event", SUMO_TAG_TIMEDEVENT__DEPRECATED }, { "timedEvent", SUMO_TAG_TIMEDEVENT }, - { "fromedge", SUMO_TAG_FROMEDGE__DEPRECATED }, { "fromEdge", SUMO_TAG_FROMEDGE }, - { "toedge", SUMO_TAG_TOEDGE__DEPRECATED }, { "toEdge", SUMO_TAG_TOEDGE }, { "sink", SUMO_TAG_SINK }, { "param", SUMO_TAG_PARAM }, @@ -120,23 +100,17 @@ { "reset", SUMO_TAG_RESET }, { "delete", SUMO_TAG_DELETE }, { "stop", SUMO_TAG_STOP }, - { "dest_prob_reroute", SUMO_TAG_DEST_PROB_REROUTE__DEPRECATED }, { "destProbReroute", SUMO_TAG_DEST_PROB_REROUTE }, - { "closing_reroute", SUMO_TAG_CLOSING_REROUTE__DEPRECATED }, { "closingReroute", SUMO_TAG_CLOSING_REROUTE }, - { "route_prob_reroute", SUMO_TAG_ROUTE_PROB_REROUTE__DEPRECATED }, { "routeProbReroute", SUMO_TAG_ROUTE_PROB_REROUTE }, - { "polytype", SUMO_TAG_POLYTYPE__DEPRECATED }, { "polygonType", SUMO_TAG_POLYTYPE }, { "connection", SUMO_TAG_CONNECTION }, { "prohibition", SUMO_TAG_PROHIBITION }, { "split", SUMO_TAG_SPLIT }, { "node", SUMO_TAG_NODE }, { "type", SUMO_TAG_TYPE }, - { "detector_definition", SUMO_TAG_DETECTOR_DEFINITION__DEPRECATED }, { "detectorDefinition", SUMO_TAG_DETECTOR_DEFINITION }, { "routeDistribution", SUMO_TAG_ROUTE_DISTRIBUTION }, - { "vtypeDistribution", SUMO_TAG_VTYPE_DISTRIBUTION__DEPRECATED }, { "vTypeDistribution", SUMO_TAG_VTYPE_DISTRIBUTION }, { "vaporizer", SUMO_TAG_VAPORIZER }, { "roundabout", SUMO_TAG_ROUNDABOUT }, @@ -172,6 +146,8 @@ { "carFollowing-IDMM", SUMO_TAG_CF_IDMM }, { "carFollowing-Krauss", SUMO_TAG_CF_KRAUSS }, { "carFollowing-KraussOrig1", SUMO_TAG_CF_KRAUSS_ORIG1 }, + { "carFollowing-SmartSK", SUMO_TAG_CF_SMART_SK }, + { "carFollowing-Daniel1", SUMO_TAG_CF_DANIEL1 }, { "carFollowing-PWagner2009", SUMO_TAG_CF_PWAGNER2009 }, { "carFollowing-BKerner", SUMO_TAG_CF_BKERNER }, { "carFollowing-Wiedemann", SUMO_TAG_CF_WIEDEMANN }, @@ -206,12 +182,10 @@ StringBijection::Entry SUMOXMLDefinitions::attrs[] = { { "id", SUMO_ATTR_ID }, - { "refid", SUMO_ATTR_REFID__DEPRECATED }, { "refId", SUMO_ATTR_REFID }, { "name", SUMO_ATTR_NAME }, { "type", SUMO_ATTR_TYPE }, { "priority", SUMO_ATTR_PRIORITY }, - { "nolanes", SUMO_ATTR_NOLANES__DEPRECATED }, { "numLanes", SUMO_ATTR_NUMLANES }, { "speed", SUMO_ATTR_SPEED }, { "oneway", SUMO_ATTR_ONEWAY }, @@ -219,12 +193,6 @@ { "remove", SUMO_ATTR_REMOVE }, { "length", SUMO_ATTR_LENGTH }, - { "fromnode", SUMO_ATTR_FROMNODE }, - { "tonode", SUMO_ATTR_TONODE }, - { "xfrom", SUMO_ATTR_XFROM }, - { "yfrom", SUMO_ATTR_YFROM }, - { "xto", SUMO_ATTR_XTO }, - { "yto", SUMO_ATTR_YTO }, { "x", SUMO_ATTR_X }, { "y", SUMO_ATTR_Y }, @@ -245,24 +213,16 @@ { "edges", SUMO_ATTR_EDGES }, { "depart", SUMO_ATTR_DEPART }, - { "departlane", SUMO_ATTR_DEPARTLANE__DEPRECATED }, { "departLane", SUMO_ATTR_DEPARTLANE }, - { "departpos", SUMO_ATTR_DEPARTPOS__DEPRECATED }, { "departPos", SUMO_ATTR_DEPARTPOS }, - { "departspeed", SUMO_ATTR_DEPARTSPEED__DEPRECATED }, { "departSpeed", SUMO_ATTR_DEPARTSPEED }, - { "arrivallane", SUMO_ATTR_ARRIVALLANE__DEPRECATED }, { "arrivalLane", SUMO_ATTR_ARRIVALLANE }, - { "arrivalpos", SUMO_ATTR_ARRIVALPOS__DEPRECATED }, { "arrivalPos", SUMO_ATTR_ARRIVALPOS }, - { "arrivalspeed", SUMO_ATTR_ARRIVALSPEED__DEPRECATED }, { "arrivalSpeed", SUMO_ATTR_ARRIVALSPEED }, { "route", SUMO_ATTR_ROUTE }, - { "maxspeed", SUMO_ATTR_MAXSPEED__DEPRECATED }, { "maxSpeed", SUMO_ATTR_MAXSPEED }, { "accel", SUMO_ATTR_ACCEL }, { "decel", SUMO_ATTR_DECEL }, - { "vclass", SUMO_ATTR_VCLASS__DEPRECATED }, { "vClass", SUMO_ATTR_VCLASS }, { "repno", SUMO_ATTR_REPNUMBER }, { "speedFactor", SUMO_ATTR_SPEEDFACTOR }, @@ -272,12 +232,17 @@ { "sigma", SUMO_ATTR_SIGMA }, { "tau", SUMO_ATTR_TAU }, + { "tmp1", SUMO_ATTR_TMP1 }, + { "tmp2", SUMO_ATTR_TMP2 }, + { "tmp3", SUMO_ATTR_TMP3 }, + { "tmp4", SUMO_ATTR_TMP4 }, + { "tmp5", SUMO_ATTR_TMP5 }, { "last", SUMO_ATTR_LAST }, { "cost", SUMO_ATTR_COST }, { "probability", SUMO_ATTR_PROB }, + { "probabilities", SUMO_ATTR_PROBS }, { "routes", SUMO_ATTR_ROUTES }, - { "vtypes", SUMO_ATTR_VTYPES__DEPRECATED }, { "vTypes", SUMO_ATTR_VTYPES }, { "lane", SUMO_ATTR_LANE }, @@ -285,11 +250,11 @@ { "from", SUMO_ATTR_FROM }, { "to", SUMO_ATTR_TO }, { "period", SUMO_ATTR_PERIOD }, - { "fromtaz", SUMO_ATTR_FROM_TAZ__DEPRECATED }, { "fromTaz", SUMO_ATTR_FROM_TAZ }, - { "totaz", SUMO_ATTR_TO_TAZ__DEPRECATED }, { "toTaz", SUMO_ATTR_TO_TAZ }, { "reroute", SUMO_ATTR_REROUTE }, + { "personCapacity", SUMO_ATTR_PERSON_CAPACITY }, + { "personNumber", SUMO_ATTR_PERSON_NUMBER }, { "function", SUMO_ATTR_FUNCTION }, { "pos", SUMO_ATTR_POSITION }, @@ -297,7 +262,6 @@ { "style", SUMO_ATTR_STYLE }, { "file", SUMO_ATTR_FILE }, { "junction", SUMO_ATTR_JUNCTION }, - { "no", SUMO_ATTR_NO__DEPRECATED }, { "number", SUMO_ATTR_NUMBER }, { "duration", SUMO_ATTR_DURATION }, { "until", SUMO_ATTR_UNTIL }, @@ -306,10 +270,8 @@ { "begin", SUMO_ATTR_BEGIN }, { "end", SUMO_ATTR_END }, { "tl", SUMO_ATTR_TLID }, - { "linkno", SUMO_ATTR_TLLINKNO__DEPRECATED }, { "linkIndex", SUMO_ATTR_TLLINKINDEX }, { "shape", SUMO_ATTR_SHAPE }, - { "spread_type", SUMO_ATTR_SPREADFUNC__DEPRECATED }, { "spreadType", SUMO_ATTR_SPREADTYPE }, { "color", SUMO_ATTR_COLOR }, { "dir", SUMO_ATTR_DIR }, @@ -334,18 +296,13 @@ { "xy", SUMO_ATTR_XY }, { "step", SUMO_ATTR_STEP }, #endif - { "min_dur", SUMO_ATTR_MINDURATION__DEPRECATED }, { "minDur", SUMO_ATTR_MINDURATION }, - { "max_dur", SUMO_ATTR_MAXDURATION__DEPRECATED }, { "maxDur", SUMO_ATTR_MAXDURATION }, { "foes", SUMO_ATTR_FOES }, { "cont", SUMO_ATTR_CONT }, - { "time_treshold", SUMO_ATTR_HALTING_TIME_THRESHOLD__DEPRECATED }, { "timeThreshold", SUMO_ATTR_HALTING_TIME_THRESHOLD }, - { "speed_treshold", SUMO_ATTR_HALTING_SPEED_THRESHOLD__DEPRECATED }, { "speedThreshold", SUMO_ATTR_HALTING_SPEED_THRESHOLD }, - { "jam_treshold", SUMO_ATTR_JAM_DIST_THRESHOLD__DEPRECATED }, { "jamThreshold", SUMO_ATTR_JAM_DIST_THRESHOLD }, { "wautID", SUMO_ATTR_WAUT_ID }, @@ -355,12 +312,10 @@ { "refTime", SUMO_ATTR_REF_TIME }, { "startProg", SUMO_ATTR_START_PROG }, { "off", SUMO_ATTR_OFF }, - { "friendly_pos", SUMO_ATTR_FRIENDLY_POS__DEPRECATED }, { "friendlyPos", SUMO_ATTR_FRIENDLY_POS }, { "splitByType", SUMO_ATTR_SPLIT_VTYPE }, { "uncontrolled", SUMO_ATTR_UNCONTROLLED }, { "pass", SUMO_ATTR_PASS }, - { "bus_stop", SUMO_ATTR_BUS_STOP__DEPRECATED }, { "busStop", SUMO_ATTR_BUS_STOP }, { "line", SUMO_ATTR_LINE }, { "lines", SUMO_ATTR_LINES }, @@ -370,14 +325,14 @@ { "allow", SUMO_ATTR_ALLOW }, { "disallow", SUMO_ATTR_DISALLOW }, { "prefer", SUMO_ATTR_PREFER }, - { "controlled_inner", SUMO_ATTR_CONTROLLED_INNER__DEPRECATED }, { "controlledInner", SUMO_ATTR_CONTROLLED_INNER }, { "vehsPerHour", SUMO_ATTR_VEHSPERHOUR }, { "output", SUMO_ATTR_OUTPUT }, { "height", SUMO_ATTR_HEIGHT }, - { "guiOffset", SUMO_ATTR_GUIOFFSET }, { "guiShape", SUMO_ATTR_GUISHAPE }, { "osgFile", SUMO_ATTR_OSGFILE }, + { "imgFile", SUMO_ATTR_IMGFILE }, + { "angle", SUMO_ATTR_ANGLE }, { "emissionClass", SUMO_ATTR_EMISSIONCLASS }, { "startPos", SUMO_ATTR_STARTPOS }, { "endPos", SUMO_ATTR_ENDPOS }, @@ -419,6 +374,7 @@ { "estimation", SUMO_ATTR_CF_WIEDEMANN_ESTIMATION }, { "generateWalks", SUMO_ATTR_GENERATE_WALKS }, + { "actType", SUMO_ATTR_ACTTYPE }, // ActivityGen statistics file { "inhabitants", AGEN_ATTR_INHABITANTS }, diff -Nru sumo-0.15.0~dfsg/src/utils/xml/SUMOXMLDefinitions.h sumo-0.16.0~dfsg/src/utils/xml/SUMOXMLDefinitions.h --- sumo-0.15.0~dfsg/src/utils/xml/SUMOXMLDefinitions.h 2012-01-29 00:02:13.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/SUMOXMLDefinitions.h 2012-10-18 23:02:43.000000000 +0000 @@ -7,7 +7,7 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Sept 2002 -/// @version $Id: SUMOXMLDefinitions.h 11808 2012-01-28 21:36:11Z behrisch $ +/// @version $Id: SUMOXMLDefinitions.h 12857 2012-10-18 11:33:33Z namdre $ /// // Definitions of elements and attributes known by SUMO /****************************************************************************/ @@ -49,6 +49,8 @@ enum SumoXMLTag { /** invalid tag */ SUMO_TAG_NOTHING, + /** root element of a network file */ + SUMO_TAG_NET, /** begin/end of the description of an edge */ SUMO_TAG_EDGE, /** begin/end of the description of a single lane */ @@ -64,28 +66,21 @@ SUMO_TAG_MSG_EMITTER, #endif /** an e1 detector */ - SUMO_TAG_E1DETECTOR__DEPRECATED, SUMO_TAG_E1DETECTOR, SUMO_TAG_INDUCTION_LOOP, /** an e2 detector */ - SUMO_TAG_E2DETECTOR__DEPRECATED, SUMO_TAG_E2DETECTOR, SUMO_TAG_LANE_AREA_DETECTOR, /** an e3 detector */ - SUMO_TAG_E3DETECTOR__DEPRECATED, SUMO_TAG_E3DETECTOR, SUMO_TAG_ENTRY_EXIT_DETECTOR, /** an edge based mean data detector */ - SUMO_TAG_MEANDATA_EDGE__DEPRECATED, SUMO_TAG_MEANDATA_EDGE, /** a lane based mean data detector */ - SUMO_TAG_MEANDATA_LANE__DEPRECATED, SUMO_TAG_MEANDATA_LANE, /** an e3 entry point*/ - SUMO_TAG_DET_ENTRY__DEPRECATED, SUMO_TAG_DET_ENTRY, /** an e3 exit point */ - SUMO_TAG_DET_EXIT__DEPRECATED, SUMO_TAG_DET_EXIT, /// @brief An edge-following detector SUMO_TAG_EDGEFOLLOWDETECTOR, @@ -100,46 +95,32 @@ /// @brief A bus stop SUMO_TAG_BUS_STOP, /** a vtypeprobe detector */ - SUMO_TAG_VTYPEPROBE__DEPRECATED, SUMO_TAG_VTYPEPROBE, /** a routeprobe detector */ - SUMO_TAG_ROUTEPROBE__DEPRECATED, SUMO_TAG_ROUTEPROBE, + /** root element of a route file */ + SUMO_TAG_ROUTES, /** description of a vehicle */ SUMO_TAG_VEHICLE, /** description of a vehicle type */ - SUMO_TAG_VTYPE__DEPRECATED, SUMO_TAG_VTYPE, /** begin/end of the description of a route */ SUMO_TAG_ROUTE, - /** begin/end of the description of succeeding lanes (deprecated) */ - SUMO_TAG_SUCC, - /** description of a single succeeding lane (deprecated) */ - SUMO_TAG_SUCCLANE, - /** begin of a right-of-way logic (deprecated) */ - SUMO_TAG_ROWLOGIC__DEPRECATED, - /** description of a single junction logic part (deprecated) */ - SUMO_TAG_LOGICITEM, /** description of a logic request within the junction */ SUMO_TAG_REQUEST, /** a source */ SUMO_TAG_SOURCE, /** a traffic assignment zone */ - SUMO_TAG_DISTRICT__DEPRECATED, SUMO_TAG_TAZ, /** a source within a district (connection road) */ - SUMO_TAG_DSOURCE__DEPRECATED, SUMO_TAG_TAZSOURCE, /** a sink within a district (connection road) */ - SUMO_TAG_DSINK__DEPRECATED, SUMO_TAG_TAZSINK, /** a traffic light logic */ - SUMO_TAG_TLLOGIC__DEPRECATED, SUMO_TAG_TLLOGIC, /** a single phase description */ SUMO_TAG_PHASE, /** a single trip definition (used by router) */ - SUMO_TAG_TRIP__DEPRECATED, SUMO_TAG_TRIP, /** a flow definition (used by router) */ SUMO_TAG_FLOW, @@ -148,13 +129,10 @@ /** an aggreagated-output interval */ SUMO_TAG_INTERVAL, /// The definition of a periodic event - SUMO_TAG_TIMEDEVENT__DEPRECATED, SUMO_TAG_TIMEDEVENT, /// Incoming edge specification (jtrrouter) - SUMO_TAG_FROMEDGE__DEPRECATED, SUMO_TAG_FROMEDGE, /// Outgoing edge specification (jtrrouter) - SUMO_TAG_TOEDGE__DEPRECATED, SUMO_TAG_TOEDGE, /// Sink(s) specification SUMO_TAG_SINK, @@ -165,23 +143,17 @@ SUMO_TAG_RESET, SUMO_TAG_DELETE, SUMO_TAG_STOP, - SUMO_TAG_DEST_PROB_REROUTE__DEPRECATED, SUMO_TAG_DEST_PROB_REROUTE, - SUMO_TAG_CLOSING_REROUTE__DEPRECATED, SUMO_TAG_CLOSING_REROUTE, - SUMO_TAG_ROUTE_PROB_REROUTE__DEPRECATED, SUMO_TAG_ROUTE_PROB_REROUTE, - SUMO_TAG_POLYTYPE__DEPRECATED, SUMO_TAG_POLYTYPE, SUMO_TAG_CONNECTION, SUMO_TAG_PROHIBITION, SUMO_TAG_SPLIT, SUMO_TAG_NODE, SUMO_TAG_TYPE, - SUMO_TAG_DETECTOR_DEFINITION__DEPRECATED, SUMO_TAG_DETECTOR_DEFINITION, SUMO_TAG_ROUTE_DISTRIBUTION, - SUMO_TAG_VTYPE_DISTRIBUTION__DEPRECATED, SUMO_TAG_VTYPE_DISTRIBUTION, SUMO_TAG_VAPORIZER, SUMO_TAG_ROUNDABOUT, @@ -214,6 +186,8 @@ SUMO_TAG_CF_KRAUSS, SUMO_TAG_CF_KRAUSS_ORIG1, + SUMO_TAG_CF_SMART_SK, + SUMO_TAG_CF_DANIEL1, SUMO_TAG_CF_IDM, SUMO_TAG_CF_IDMM, SUMO_TAG_CF_PWAGNER2009, @@ -274,26 +248,16 @@ SUMO_ATTR_NOTHING, /* common attributes */ SUMO_ATTR_ID, - SUMO_ATTR_REFID__DEPRECATED, SUMO_ATTR_REFID, SUMO_ATTR_NAME, SUMO_ATTR_TYPE, SUMO_ATTR_PRIORITY, - SUMO_ATTR_NOLANES__DEPRECATED, SUMO_ATTR_NUMLANES, SUMO_ATTR_SPEED, SUMO_ATTR_ONEWAY, SUMO_ATTR_WIDTH, SUMO_ATTR_REMOVE, - /* edge attributes */ SUMO_ATTR_LENGTH, - SUMO_ATTR_FROMNODE, - SUMO_ATTR_TONODE, - SUMO_ATTR_XFROM, - SUMO_ATTR_YFROM, - SUMO_ATTR_XTO, - SUMO_ATTR_YTO, - /* node attributes */ SUMO_ATTR_X, SUMO_ATTR_Y, SUMO_ATTR_Z, @@ -314,24 +278,16 @@ SUMO_ATTR_EDGES, /* vehicle attributes */ SUMO_ATTR_DEPART, - SUMO_ATTR_DEPARTLANE__DEPRECATED, SUMO_ATTR_DEPARTLANE, - SUMO_ATTR_DEPARTPOS__DEPRECATED, SUMO_ATTR_DEPARTPOS, - SUMO_ATTR_DEPARTSPEED__DEPRECATED, SUMO_ATTR_DEPARTSPEED, - SUMO_ATTR_ARRIVALLANE__DEPRECATED, SUMO_ATTR_ARRIVALLANE, - SUMO_ATTR_ARRIVALPOS__DEPRECATED, SUMO_ATTR_ARRIVALPOS, - SUMO_ATTR_ARRIVALSPEED__DEPRECATED, SUMO_ATTR_ARRIVALSPEED, SUMO_ATTR_ROUTE, - SUMO_ATTR_MAXSPEED__DEPRECATED, SUMO_ATTR_MAXSPEED, SUMO_ATTR_ACCEL, SUMO_ATTR_DECEL, - SUMO_ATTR_VCLASS__DEPRECATED, SUMO_ATTR_VCLASS, SUMO_ATTR_REPNUMBER, SUMO_ATTR_SPEEDFACTOR, @@ -341,12 +297,17 @@ /* Car following model attributes */ SUMO_ATTR_SIGMA, // used by: Krauss SUMO_ATTR_TAU, // Krauss + SUMO_ATTR_TMP1, + SUMO_ATTR_TMP2, + SUMO_ATTR_TMP3, + SUMO_ATTR_TMP4, + SUMO_ATTR_TMP5, /* route alternatives / distribution attributes */ SUMO_ATTR_LAST, SUMO_ATTR_COST, SUMO_ATTR_PROB, + SUMO_ATTR_PROBS, SUMO_ATTR_ROUTES, - SUMO_ATTR_VTYPES__DEPRECATED, SUMO_ATTR_VTYPES, /* trip definition attributes */ SUMO_ATTR_LANE, @@ -354,11 +315,11 @@ SUMO_ATTR_FROM, SUMO_ATTR_TO, SUMO_ATTR_PERIOD, - SUMO_ATTR_FROM_TAZ__DEPRECATED, SUMO_ATTR_FROM_TAZ, - SUMO_ATTR_TO_TAZ__DEPRECATED, SUMO_ATTR_TO_TAZ, SUMO_ATTR_REROUTE, + SUMO_ATTR_PERSON_CAPACITY, + SUMO_ATTR_PERSON_NUMBER, /* source definitions */ SUMO_ATTR_FUNCTION, SUMO_ATTR_POSITION, @@ -366,7 +327,6 @@ SUMO_ATTR_STYLE, SUMO_ATTR_FILE, SUMO_ATTR_JUNCTION, - SUMO_ATTR_NO__DEPRECATED, SUMO_ATTR_NUMBER, SUMO_ATTR_DURATION, SUMO_ATTR_UNTIL, @@ -379,12 +339,10 @@ /** link: the traffic light id responsible for this link */ SUMO_ATTR_TLID, /** link: the index of the link within the traffic light */ - SUMO_ATTR_TLLINKNO__DEPRECATED, SUMO_ATTR_TLLINKINDEX, /** edge: the shape in xml-definition */ SUMO_ATTR_SHAPE, /// The information about how to spread the lanes from the given position - SUMO_ATTR_SPREADFUNC__DEPRECATED, SUMO_ATTR_SPREADTYPE, /// A color information SUMO_ATTR_COLOR, @@ -424,10 +382,8 @@ #endif // Attributes for actuated traffic lights: /// minimum duration of a phase - SUMO_ATTR_MINDURATION__DEPRECATED, SUMO_ATTR_MINDURATION, /// maximum duration of a phase - SUMO_ATTR_MAXDURATION__DEPRECATED, SUMO_ATTR_MAXDURATION, // Attributes for junction-internal lanes /// Information within the junction logic which internal lanes block external @@ -435,11 +391,8 @@ // Attributes for detectors /// Information whether the detector shall be continued on the folowing lanes SUMO_ATTR_CONT, - SUMO_ATTR_HALTING_TIME_THRESHOLD__DEPRECATED, SUMO_ATTR_HALTING_TIME_THRESHOLD, - SUMO_ATTR_HALTING_SPEED_THRESHOLD__DEPRECATED, SUMO_ATTR_HALTING_SPEED_THRESHOLD, - SUMO_ATTR_JAM_DIST_THRESHOLD__DEPRECATED, SUMO_ATTR_JAM_DIST_THRESHOLD, SUMO_ATTR_WAUT_ID, @@ -450,12 +403,10 @@ SUMO_ATTR_START_PROG, SUMO_ATTR_OFF, - SUMO_ATTR_FRIENDLY_POS__DEPRECATED, SUMO_ATTR_FRIENDLY_POS, SUMO_ATTR_SPLIT_VTYPE, SUMO_ATTR_UNCONTROLLED, SUMO_ATTR_PASS, - SUMO_ATTR_BUS_STOP__DEPRECATED, SUMO_ATTR_BUS_STOP, SUMO_ATTR_LINE, SUMO_ATTR_LINES, @@ -465,14 +416,14 @@ SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMO_ATTR_PREFER, - SUMO_ATTR_CONTROLLED_INNER__DEPRECATED, SUMO_ATTR_CONTROLLED_INNER, SUMO_ATTR_VEHSPERHOUR, SUMO_ATTR_OUTPUT, SUMO_ATTR_HEIGHT, - SUMO_ATTR_GUIOFFSET, SUMO_ATTR_GUISHAPE, SUMO_ATTR_OSGFILE, + SUMO_ATTR_IMGFILE, + SUMO_ATTR_ANGLE, SUMO_ATTR_EMISSIONCLASS, SUMO_ATTR_STARTPOS, SUMO_ATTR_ENDPOS, @@ -513,6 +464,8 @@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, SUMO_ATTR_GENERATE_WALKS, + SUMO_ATTR_ACTTYPE, + /** * ActivityGen Tags diff -Nru sumo-0.15.0~dfsg/src/utils/xml/XMLSubSys.cpp sumo-0.16.0~dfsg/src/utils/xml/XMLSubSys.cpp --- sumo-0.15.0~dfsg/src/utils/xml/XMLSubSys.cpp 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/XMLSubSys.cpp 2012-12-04 00:02:28.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 1 Jul 2002 -/// @version $Id: XMLSubSys.cpp 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: XMLSubSys.cpp 13114 2012-12-03 09:15:16Z behrisch $ /// // Utility methods for initialising, closing and using the XML-subsystem /****************************************************************************/ @@ -30,12 +30,11 @@ #include #endif -#include -#include #include -#include #include +#include #include "SUMOSAXHandler.h" +#include "SUMOSAXReader.h" #include "XMLSubSys.h" #ifdef CHECK_MEMORY_LEAKS @@ -46,7 +45,7 @@ // =========================================================================== // static member variables // =========================================================================== -std::vector XMLSubSys::myReaders; +std::vector XMLSubSys::myReaders; unsigned int XMLSubSys::myNextFreeReader; bool XMLSubSys::myEnableValidation; @@ -55,44 +54,41 @@ // method definitions // =========================================================================== void -XMLSubSys::init(bool enableValidation) { - myEnableValidation = enableValidation; +XMLSubSys::init() { try { - XMLPlatformUtils::Initialize(); - myReaders.push_back(getSAXReader()); + XERCES_CPP_NAMESPACE::XMLPlatformUtils::Initialize(); myNextFreeReader = 0; - } catch (const XMLException& e) { - throw ProcessError("Error during XML-initialization:\n " + TplConvert::_2str(e.getMessage())); + } catch (const XERCES_CPP_NAMESPACE::XMLException& e) { + throw ProcessError("Error during XML-initialization:\n " + TplConvert::_2str(e.getMessage())); } } void +XMLSubSys::setValidation(bool enableValidation) { + myEnableValidation = enableValidation; +} + + +void XMLSubSys::close() { - for (std::vector::iterator i = myReaders.begin(); i != myReaders.end(); ++i) { + for (std::vector::iterator i = myReaders.begin(); i != myReaders.end(); ++i) { delete *i; } myReaders.clear(); - XMLPlatformUtils::Terminate(); + XERCES_CPP_NAMESPACE::XMLPlatformUtils::Terminate(); } -SAX2XMLReader* +SUMOSAXReader* XMLSubSys::getSAXReader(SUMOSAXHandler& handler) { - SAX2XMLReader* reader = getSAXReader(); - if (reader == 0) { - return 0; - } - reader->setContentHandler(&handler); - reader->setErrorHandler(&handler); - return reader; + return new SUMOSAXReader(handler, myEnableValidation); } void XMLSubSys::setHandler(GenericSAXHandler& handler) { - myReaders[myNextFreeReader - 1]->setContentHandler(&handler); - myReaders[myNextFreeReader - 1]->setErrorHandler(&handler); + myReaders[myNextFreeReader - 1]->setHandler(handler); } @@ -101,13 +97,14 @@ const std::string& file) { try { if (myNextFreeReader == myReaders.size()) { - myReaders.push_back(getSAXReader()); + myReaders.push_back(new SUMOSAXReader(handler, myEnableValidation)); + } else { + myReaders[myNextFreeReader]->setHandler(handler); } myNextFreeReader++; - setHandler(handler); std::string prevFile = handler.getFileName(); handler.setFileName(file); - myReaders[myNextFreeReader - 1]->parse(file.c_str()); + myReaders[myNextFreeReader - 1]->parse(file); handler.setFileName(prevFile); myNextFreeReader--; } catch (ProcessError& e) { @@ -123,33 +120,5 @@ } -SAX2XMLReader* -XMLSubSys::getSAXReader() { - SAX2XMLReader* reader = XMLReaderFactory::createXMLReader(); - if (reader == 0) { - WRITE_ERROR("The XML-parser could not be build"); - return 0; - } - if (!myEnableValidation) { - reader->setProperty(XMLUni::fgXercesScannerName, (void*)XMLUni::fgWFXMLScanner); - } - setFeature(*reader, "http://xml.org/sax/features/namespaces", false); - setFeature(*reader, "http://apache.org/xml/features/validation/schema", myEnableValidation); - setFeature(*reader, "http://apache.org/xml/features/validation/schema-full-checking", myEnableValidation); - setFeature(*reader, "http://xml.org/sax/features/validation", myEnableValidation); - setFeature(*reader, "http://apache.org/xml/features/validation/dynamic", myEnableValidation); - return reader; -} - - -void -XMLSubSys::setFeature(XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader& reader, - const std::string& feature, bool value) { - XMLCh* xmlFeature = XMLString::transcode(feature.c_str()); - reader.setFeature(xmlFeature, value); - XMLString::release(&xmlFeature); -} - - /****************************************************************************/ diff -Nru sumo-0.15.0~dfsg/src/utils/xml/XMLSubSys.h sumo-0.16.0~dfsg/src/utils/xml/XMLSubSys.h --- sumo-0.15.0~dfsg/src/utils/xml/XMLSubSys.h 2012-01-07 20:14:54.000000000 +0000 +++ sumo-0.16.0~dfsg/src/utils/xml/XMLSubSys.h 2012-12-04 00:02:28.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 1 Jul 2002 -/// @version $Id: XMLSubSys.h 11671 2012-01-07 20:14:30Z behrisch $ +/// @version $Id: XMLSubSys.h 13114 2012-12-03 09:15:16Z behrisch $ /// // Utility methods for initialising, closing and using the XML-subsystem /****************************************************************************/ @@ -32,8 +32,6 @@ #endif #include -#include -#include // =========================================================================== @@ -41,6 +39,7 @@ // =========================================================================== class GenericSAXHandler; class SUMOSAXHandler; +class SUMOSAXReader; // =========================================================================== @@ -73,20 +72,24 @@ class XMLSubSys { public: /** - * @brief Initialises the xml-subsystem, returns whether the initialisation succeeded. + * @brief Initialises the xml-subsystem. * * Calls XMLPlatformUtils::Initialize(). If this fails, the exception is - * caught and its content is reported using a ProcessError. Otherwise, a - * static SAX2XMLReader is built using "getSAXReader()" (stored in "myReader"). + * caught and its content is reported using a ProcessError. * - * The information whether validationis wanted is stored in "myEnableValidation" for - * later usage. + * @exception ProcessError If the initialisation fails + */ + static void init(); + + + /** + * @brief Enables or disables validation. + * + * The setting is only valid for parsers created after the call. Existing parsers are not adapted. * * @param[in] enableValidation Whether validation of XML-documents against schemata shall be enabled - * @exception ProcessError If the initialisation fails - * @see getSAXReader() */ - static void init(bool enableValidation) ; + static void setValidation(bool enableValidation); /** @@ -94,7 +97,7 @@ * * Deletes the built reader and calls XMLPlatformUtils::Terminate(); */ - static void close() ; + static void close(); /** @@ -108,7 +111,7 @@ * @return The built Xerces-SAX-reader, 0 if something failed * @see getSAXReader() */ - static XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader* getSAXReader(SUMOSAXHandler& handler) ; + static SUMOSAXReader* getSAXReader(SUMOSAXHandler& handler); /** @@ -139,39 +142,12 @@ * @return true if the parsing was done without errors, false otherwise (error was printed) */ static bool runParser(GenericSAXHandler& handler, - const std::string& file) ; - - -protected: - /** - * @brief Builds a reader - * - * Tries to build a SAX2XMLReader using XMLReaderFactory::createXMLReader. If this - * fails, 0 is returned. Otherwise the validation is set matching the value of - * "myEnableValidation". If validation is not wanted, a WFXMLScanner is used - * (see http://www.ibm.com/developerworks/library/x-xercesperf.html). - * - * @return The built Xerces-SAX-reader, 0 if something failed - */ - static XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader* getSAXReader() ; - - - /** - * @brief Sets the named feature of the given reader to the given value - * - * The given feature name is translated into an XMLCh* and set. - * - * @param[in] reader The reader to set the feature of - * @param[in] feature Name of the feature to set - * @param[in] value Value of the feature to set - */ - static void setFeature(XERCES_CPP_NAMESPACE_QUALIFIER SAX2XMLReader& reader, - const std::string& feature, bool value) ; + const std::string& file); private: /// @brief The XML Readers used for repeated parsing - static std::vector myReaders; + static std::vector myReaders; /// @brief Information whether the reader is parsing static unsigned int myNextFreeReader; diff -Nru sumo-0.15.0~dfsg/src/windows_config.h sumo-0.16.0~dfsg/src/windows_config.h --- sumo-0.15.0~dfsg/src/windows_config.h 2012-03-14 00:02:31.000000000 +0000 +++ sumo-0.16.0~dfsg/src/windows_config.h 2012-12-04 00:02:28.000000000 +0000 @@ -6,7 +6,7 @@ /// @author Michael Behrisch /// @author Felix Brack /// @date Mon, 17 Dec 2001 -/// @version $Id: windows_config.h 12089 2012-03-13 21:57:49Z behrisch $ +/// @version $Id: windows_config.h 13126 2012-12-03 21:16:10Z behrisch $ /// // The general windows configuration file /****************************************************************************/ @@ -48,6 +48,9 @@ /* defines the precision of floats */ #define SUMOReal double +/* defines a long */ +#define SUMOLong long long + /* defines the epsilon to use on position comparison */ #define POSITION_EPS 0.1 @@ -62,7 +65,7 @@ /* Version number of package */ #ifndef HAVE_VERSION_H -#define VERSION_STRING "0.15.0" +#define VERSION_STRING "0.16.0" #endif /* Define if junction internal lanes should be used. */ diff -Nru sumo-0.15.0~dfsg/tools/assign/Assignment.py sumo-0.16.0~dfsg/tools/assign/Assignment.py --- sumo-0.15.0~dfsg/tools/assign/Assignment.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/Assignment.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Yun-Pang Wang @author Michael Behrisch @date 2008-03-28 -@version $Id: Assignment.py 11700 2012-01-10 22:20:15Z behrisch $ +@version $Id: Assignment.py 12248 2012-04-24 07:31:16Z namdre $ This script is for executing the traffic assignment. Three assignment models are available: @@ -140,7 +140,7 @@ else: foutroute = open('routes.rou.xml', 'w') print >> foutroute, """ - + """ % starttime for counter, matrix in enumerate(matrices): #for counter in range (0, len(matrices)): @@ -219,9 +219,10 @@ D,P = dijkstraPlain(startVertex, targets) elif options.dijkstra == 'extend': D,P = dijkstra(startVertex, targets) - vehID, smallDemand, linkChoiceMap = doIncAssign(net, vehicles, options.verbose, options.maxiteration, options.odestimation, - endVertices, start, startVertex, matrixPshort, smallDemand, - D, P, AssignedVeh, AssignedTrip, vehID, assignSmallDemand, linkChoiceMap, odPairsMap) + vehID, smallDemand, linkChoiceMap = doIncAssign( + net, vehicles, options.verbose, options.maxiteration, options.odestimation, + endVertices, start, startVertex, matrixPshort, smallDemand, + D, P, AssignedVeh, AssignedTrip, vehID, assignSmallDemand, linkChoiceMap, odPairsMap) if options.dijkstra != 'extend': linkMap = net._fullEdges diff -Nru sumo-0.15.0~dfsg/tools/assign/addTaz.py sumo-0.16.0~dfsg/tools/assign/addTaz.py --- sumo-0.15.0~dfsg/tools/assign/addTaz.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/addTaz.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file addTaz.py @author Michael Behrisch @date 2009-05-20 -@version $Id: addTaz.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: addTaz.py 12595 2012-08-24 14:07:33Z dkrajzew $ SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2009-2012 DLR (http://www.dlr.de/) and contributors @@ -20,18 +20,18 @@ self._out = out def startElement(self, name, attrs): - if name == 'tripdef': + if name == 'trip': self._idToTaz[attrs['id']] = (attrs['fromtaz'], attrs['totaz']) elif name != 'tripdefs': print >> self._out, '<' + name, for key in attrs.keys(): print >> self._out, '%s="%s"' % (key, attrs[key]), if name == 'vehicle': - print >> self._out, 'fromtaz="%s" totaz="%s"' % self._idToTaz[attrs['id']], + print >> self._out, 'fromTaz="%s" toTaz="%s"' % self._idToTaz[attrs['id']], print >> self._out, '>' def endElement(self, name): - if name != 'tripdefs' and name != 'tripdef': + if name != 'tripdefs' and name != 'trip': print >> self._out, '' % name def parse(trips, routes, out): diff -Nru sumo-0.15.0~dfsg/tools/assign/cadytsIterate.py sumo-0.16.0~dfsg/tools/assign/cadytsIterate.py --- sumo-0.15.0~dfsg/tools/assign/cadytsIterate.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/cadytsIterate.py 2012-12-04 00:26:11.000000000 +0000 @@ -6,7 +6,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2010-09-15 -@version $Id: cadytsIterate.py 11764 2012-01-23 09:35:29Z behrisch $ +@version $Id: cadytsIterate.py 12115 2012-03-16 12:45:19Z namdre $ Run cadyts to calibrate the simulation with given routes and traffic measurements. Respective traffic zones information has to exist in the given route files. @@ -116,7 +116,7 @@ print ">> Running simulation" btime = datetime.now() print ">>> Begin time: %s" % btime - writeSUMOConf(step, options, ",".join(files)) + writeSUMOConf(sumoBinary, step, options, [], ",".join(files)) retCode = call([sumoBinary, "-c", "iteration_%03i.sumocfg" % step], log) etime = datetime.now() print ">>> End time: %s" % etime diff -Nru sumo-0.15.0~dfsg/tools/assign/costMemory.py sumo-0.16.0~dfsg/tools/assign/costMemory.py --- sumo-0.15.0~dfsg/tools/assign/costMemory.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/costMemory.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,142 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +@file duaIterate.py +@author Jakob Erdmann +@date 2012-03-14 +@version $Id: costMemory.py 12747 2012-09-21 08:39:54Z namdre $ + +Perform smoothing of edge costs across successive iterations of duaIterate + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" + +import os,sys +from collections import defaultdict +from xml.sax import saxutils, make_parser, handler + +class EdgeMemory: + def __init__(self, cost): + self.cost = cost + self.seen = True + + def update(self, cost, memory_factor): + self.cost = self.cost * memory_factor + cost * (1 - memory_factor) + self.seen = True + + def decay_unseen(self, memory_factor): + if not self.seen: + self.update(0, memory_factor) + return True + return False + + +class CostMemory(handler.ContentHandler): + # memorize the weighted average of edge costs + def __init__(self, cost_attribute): + # the cost attribute to parse (i.e. 'traveltime') + self.cost_attribute = cost_attribute.decode('utf8') + # the duaIterate iteration index + self.iteration = None + # the main data store: for every interval and edge id we store costs and + # whether data was seen in the last call of load_costs() + # (start,end) -> (edge_id -> EdgeMemory) + self.intervals = defaultdict(dict) + # the intervall currently being parsed + self.current_interval = None + # the combined weigth of all previously loaded costs + self.memory_weight = 0 + # update is done according to: memory * memory_factor + new * (1 - memory_factor) + self.memory_factor = None + # differences between the previously loaded costs and the memorized costs + self.errors = None + # some statistics + self.num_loaded = 0 + self.num_decayed = 0 + + + def startElement(self, name, attrs): + if name == 'interval': + interval_key = (float(attrs['begin']), float(attrs['end'])) + self.current_interval = self.intervals[interval_key] + if name == 'edge': + id = attrs['id'] + if attrs.has_key(self.cost_attribute): # may be missing for some + self.num_loaded += 1 + cost = float(attrs[self.cost_attribute]) + if id in self.current_interval: + edgeMemory = self.current_interval[id] + self.errors.append(edgeMemory.cost - cost) + edgeMemory.update(cost, self.memory_factor) + else: + self.errors.append(0) + self.current_interval[id] = EdgeMemory(cost) + + + def load_costs(self, dumpfile, iteration, weight): + # load costs from dumpfile and update memory according to weight and iteration + if weight <= 0: + sys.stderr.write("Skipped loading of costs because the weight was %s but should have been > 0\n" % weight) + return + assert(weight > 0) + if self.iteration == None and iteration != 0: + # need to reassamble self.memory_weight + raise Exception("Continuation of duaIterate not yet implemented") + # update memory weights. memory is a weighted average across all runs + self.memory_factor = self.memory_weight / (self.memory_weight + weight) + self.memory_weight += weight + self.iteration = iteration + self.errors = [] + # mark all edges as unseen + for edges in self.intervals.itervalues(): + for edgeMemory in edges.itervalues(): + edgeMemory.seen = False + # parse costs + self.num_loaded = 0 + parser = make_parser() + parser.setContentHandler(self) + parser.parse(dumpfile) + # decay costs of unseen edges + self.num_decayed = 0 + for edges in self.intervals.itervalues(): + for edgeMemory in edges.itervalues(): + if edgeMemory.decay_unseen(self.memory_factor): + self.num_decayed += 1 + + + def write_costs(self, weight_file): + with open(weight_file, 'w') as f: + f.write('\n') + for (start, end), edge_costs in self.intervals.iteritems(): + f.write(' \n' % (start,end)) + for id, edgeMemory in edge_costs.iteritems(): + f.write(' \n' % (id, self.cost_attribute, edgeMemory.cost)) + f.write(' \n') + f.write('\n') + + def avg_error(self, values=None): + if not values: + values = self.errors + return sum(values) / len(values) + + def avg_abs_error(self): + return self.avg_error(map(abs,self.errors)) + + def mean_error(self, values=None): + if not values: + values = self.errors + values.sort() + if values: + return values[len(values)/2] + + def mean_abs_error(self): + return self.mean_error(map(abs,self.errors)) + + def loaded(self): + return self.num_loaded + + def decayed(self): + return self.num_decayed + diff -Nru sumo-0.15.0~dfsg/tools/assign/duaIterate.py sumo-0.16.0~dfsg/tools/assign/duaIterate.py --- sumo-0.15.0~dfsg/tools/assign/duaIterate.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/duaIterate.py 2012-12-04 00:26:11.000000000 +0000 @@ -7,7 +7,7 @@ @author Jakob Erdmann @author Yun-Pang Wang @date 2008-02-13 -@version $Id: duaIterate.py 12059 2012-03-12 11:30:53Z namdre $ +@version $Id: duaIterate.py 12991 2012-11-15 16:12:39Z behrisch $ Run duarouter and sumo alternating to perform a dynamic user assignment. Based on the Perl script dua_iterate.pl. @@ -20,8 +20,10 @@ import StringIO from datetime import datetime from optparse import OptionParser -from routeChoices import getRouteChoices +from costMemory import CostMemory +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from sumolib.options import get_long_option_names def addGenericOptions(optParser): # add options which are used by duaIterate and cadytsIterate @@ -87,8 +89,10 @@ help="filter tripinfo attributes") optParser.add_option("--inc-start", dest="incStart", type="float", default=0, help="Start for incrementing scale") + optParser.add_option("--inc-max", dest="incMax", + type="float", default=1, help="Maximum for incrementing scale") optParser.add_option("--inc-base", dest="incBase", - type="int", default=-1, help="Give the incrementation base") + type="int", default=-1, help="Give the incrementation base. Negative values disable incremental scaling") optParser.add_option("--incrementation", dest="incValue", type="int", default=1, help="Give the incrementation") optParser.add_option("--time-inc", dest="timeInc", @@ -122,7 +126,15 @@ optParser.add_option("--router-verbose", action="store_true", default=False, help="let duarouter print some statistics") optParser.add_option("-M", "--external-gawron", action="store_true", dest="externalgawron", - default=False, help="use the external gawron calculation") + default=False, help="use the external gawron calculation") + optParser.add_option("-N", "--calculate-oldprob", action="store_true", dest="caloldprob", + default=False, help="calculate the old route probabilities with the free-flow travel times when using the external gawron calculation") + optParser.add_option("--weight-memory", action="store_true", default=False, dest="weightmemory", + help="smoothe edge weights across iterations") + optParser.add_option("--clean-alt", action="store_true", dest="clean_alt", + default=False, help="Whether old rou.alt.xml files shall be removed") + optParser.add_option("--binary", action="store_true", + default=False, help="Use binary format for intermediate and resulting route files") return optParser def call(command, log): @@ -142,9 +154,6 @@ withExitTimes = False if routesInfo == "detailed": withExitTimes = True - addweights = "" - if options.addweights: - addweights = options.addweights + "," fd = open(cfgname, "w") print >> fd, """ @@ -155,7 +164,7 @@ print >> fd, ' <%s-files value="%s"/>' % (initial_type, file) else: print >> fd, ' ' % file - print >> fd, ' ' % (addweights, step-1, options.aggregation) + print >> fd, ' ' % get_weightfilename(options, step-1, "dump") if options.ecomeasure: print >> fd, ' ' % options.ecomeasure print >> fd, """ @@ -180,7 +189,7 @@ options.gA, options.allroutes, options.routing_algorithm, - ("" if options.routing_algorithm != 'CH' else '\n\n' % options.aggregation), + ("" if 'CH' not in options.routing_algorithm else '\n\n' % options.aggregation), options.max_alternatives, options.logit, options.logitbeta, @@ -207,74 +216,90 @@ # compute scaling factor for simulation # using incValue = 1 (default) and incBase = 10 would produce # iterations with increasing scale 0.1, 0.2, ... 0.9, 1, 1, 1, ... - return min(options.incStart + options.incValue * float(step + 1) / options.incBase, 1) + if options.incBase > 0: + return min(options.incStart + options.incValue * float(step + 1) / options.incBase, options.incMax) + else: + return options.incMax +def get_dumpfilename(options, step, prefix): + # the file to which edge costs (traveltimes) are written + return "%s_%03i_%s.xml" % (prefix, step, options.aggregation) + +def get_weightfilename(options, step, prefix): + # the file from which edge costs are loaded + # this defaults to the dumpfile writen by the simulation but may be + # different if one of the options --addweights or --memory-weights are used + if options.addweights: + prefix = "%s,%s" % (options.addweights, prefix) + if options.weightmemory: + prefix = "memory_" + prefix + return get_dumpfilename(options, step, prefix) + + +def writeSUMOConf(sumoBinary, step, options, additional_args, files): + detectorfile = "dua_dump_%03i.add.xml" % step + comma = (',' if options.additional != "" else '') + sumoCmd = [sumoBinary, + '--save-configuration', "iteration_%03i.sumocfg" % step, + '--net-file', options.net, + '--route-files', files, + '--additional-files', "%s%s%s" % (detectorfile, comma, options.additional), + '--no-step-log', + '--random', options.absrand, + '--begin', options.begin, + '--route-steps', options.routeSteps, + '--no-internal-links', options.internallink, + '--lanechange.allow-swap', options.lanechangeallowed, + '--sloppy-insert', options.sloppy_insert, + '--time-to-teleport', options.timetoteleport, + '--verbose', + '--no-warnings', options.noWarnings, + ] + additional_args -def writeSUMOConf(step, options, files): - fd = open("iteration_%03i.sumocfg" % step, "w") - add = "" - if options.additional != "": - add = "," + options.additional - print >> fd, """ - - - - - - """ % (options.net, files, step, add) - print >> fd, ' ' if hasattr(options, "noSummary") and not options.noSummary: - print >> fd, ' ' % step + sumoCmd += ['--summary-output', "summary_%03i.xml" % step] if hasattr(options, "noTripinfo") and not options.noTripinfo: - print >> fd, ' ' % step + sumoCmd += ['--tripinfo-output', "tripinfo_%03i.xml" % step] if options.ecomeasure: - print >> fd, ' ' + sumoCmd += ['--device.hbefa.probability', '1'] if hasattr(options, "routefile"): if options.routefile == "routesonly": - print >> fd, ' ' % step + sumoCmd += ['--vehroute-output', "vehroute_%03i.xml" % step] elif options.routefile == "detailed": - print >> fd, ' ' % step - print >> fd, ' ' + sumoCmd += ['--vehroute-output', "vehroute_%03i.xml" % step, + '--vehroute-output.exit-times'] if hasattr(options, "lastroute") and options.lastroute: - print >> fd, ' ' % options.lastroute - print >> fd, " " - print >> fd, ' ' % options.absrand - print >> fd, ' - - """ % options.routeSteps - print >> fd, ' ' % options.internallink - print >> fd, ' ' % options.lanechangeallowed - print >> fd, ' ' % options.sloppy_insert - print >> fd, ' ' % options.timetoteleport + sumoCmd += ['--end', options.end] + if hasattr(options, "incBase") and options.incBase > 0: - print >> fd, ' ' % get_scale(options, step) + sumoCmd += ['--scale', get_scale(options, step)] if options.mesosim: - print >> fd, ' ' - print >> fd, ' ' % options.mesorecheck + sumoCmd += ['--mesosim', + '--meso-recheck', options.mesorecheck] if options.mesomultiqueue: - print >> fd, ' ' + sumoCmd += ['--meso-multi-queue'] if options.mesojunctioncontrol: - print >> fd, ' ' - print >> fd, """ - - - - -""" % options.noWarnings - fd.close() - suffix = "_%03i_%s" % (step, options.aggregation) - fd = open("dua_dump_%03i.add.xml" % step, "w") - print >> fd, "" - print >> fd, ' ' % (suffix, options.aggregation, suffix) - if options.ecomeasure: - print >> fd, ' ' % (suffix, options.aggregation, suffix) - print >> fd, "" - fd.close() + sumoCmd += ['--meso-junction-control'] + + # make sure all arguments are strings + sumoCmd = map(str, sumoCmd) + # use sumoBinary to write a config file + subprocess.call(sumoCmd, stdout=subprocess.PIPE) + + # write detectorfile + with open(detectorfile, 'w') as fd: + suffix = "_%03i_%s" % (step, options.aggregation) + print >> fd, "" + print >> fd, ' ' % ( + suffix, options.aggregation, get_dumpfilename(options, step, "dump")) + if options.ecomeasure: + print >> fd, ' ' % (suffix, options.aggregation, suffix) + print >> fd, "" + def filterTripinfo(step, attrs): attrs.add("id") @@ -307,10 +332,45 @@ os.remove(inFile) os.rename(out.name, inFile) +def assign_remaining_args(application, prefix, args): + # assign remaining args [ prefix--o1 a1 prefix--o2 prefix--o3 a3 ...] + # only handles long options! + assigned = [] + ## split into options and arguments + items = [] + item = None + for arg in args: + if "--" in arg: + if item != None: + items.append(item) + item = [arg] + else: + if item == None: + sys.exit('Encounted argument "%s" without a preceeding option' % arg) + item.append(arg) + if item != None: + items.append(item) + + # assign to programs + valid_options = set(get_long_option_names(application)) + for item in items: + prefixed = item[0] + if prefixed[0:len(prefix)] == prefix: + option = prefixed[len(prefix):] + if option in valid_options: + assigned.append(option) + assigned += item[1:] + else: + sys.exit('"%s" is not a valid option for "%s"' % (option, application)) + unassigned += item + + return assigned + + def main(args=None): optParser = initOptions() - (options, args) = optParser.parse_args(args=args) + options, remaining_args = optParser.parse_args(args=args) if not options.net: optParser.error("Option --net-file is mandatory") if (not options.trips and not options.routes and not options.flows) or (options.trips and options.routes): @@ -320,17 +380,20 @@ sumoBinary = os.environ.get("SUMO_BINARY", os.path.join(options.path, "meso")) else: sumoBinary = os.environ.get("SUMO_BINARY", os.path.join(options.path, "sumo")) + if options.addweights and options.weightmemory: + optParser.error("Options --addweights and --weight-memory are mutually exclusive.") # make sure BOTH binaries are callable before we start try: subprocess.call(duaBinary, stdout=subprocess.PIPE) except OSError: - sys.exit("Error: Could not locate duarouter.\nMake sure its on the search path or set environment variable DUAROUTER_BINARY\n") + sys.exit("Error: Could not locate duarouter (%s).\nMake sure its on the search path or set environment variable DUAROUTER_BINARY\n" % duaBinary) try: subprocess.call(sumoBinary, stdout=subprocess.PIPE) except OSError: - sys.exit("Error: Could not locate sumo.\nMake sure its on the search path or set environment variable SUMO_BINARY\n") + sys.exit("Error: Could not locate sumo (%s).\nMake sure its on the search path or set environment variable SUMO_BINARY\n" % sumoBinary) + sumo_args = assign_remaining_args(sumoBinary, 'sumo', remaining_args) log = open("dua-log.txt", "w+") starttime = datetime.now() @@ -343,9 +406,17 @@ else: input_demands = options.routes.split(",") initial_type = "route" - if options.externalgawron:#debug + if options.externalgawron: + # avoid dependency on numpy for normal duaIterate + from routeChoices import getRouteChoices, calFirstRouteProbs print 'use externalgawron' edgesMap = {} + if options.weightmemory: + costmemory = CostMemory('traveltime') + routesSuffix = ".xml" + if options.binary: + routesSuffix = ".sbx" + for step in range(options.firstStep, options.lastStep): btimeA = datetime.now() print "> Executing step %s" % step @@ -358,12 +429,17 @@ for demand_file in input_demands: absPath = os.path.abspath(demand_file) basename = os.path.basename(demand_file) - basename = basename[:basename.find(".")] - output = basename + "_%03i.rou.xml" % step + if 'alt' in basename: + basename = basename[:-12] + elif 'trips' in basename: + basename = basename[:-10] + else: + basename = basename[:basename.find(".")] + output = basename + "_%03i.rou%s" % (step, routesSuffix) if step > 0 and not (options.skipFirstRouting and step == 1): # output of previous step - demand_file = basename + "_%03i.rou.alt.xml" % (step-1) + demand_file = basename + "_%03i.rou.alt%s" % (step-1, routesSuffix) print ">> Running router" btime = datetime.now() @@ -371,30 +447,39 @@ cfgname = writeRouteConf(step, options, demand_file, output, options.routefile, initial_type) log.flush() call([duaBinary, "-c", cfgname], log) + if options.clean_alt and step != 0: + os.remove(demand_file) etime = datetime.now() print ">>> End time: %s" % etime print ">>> Duration: %s" % (etime-btime) print "<<" # use the external gawron if options.externalgawron: - if step == 0: + ecomeasure = None + if options.ecomeasure: + ecomeasure = options.ecomeasure + if step == 1 and options.skipFirstRouting: + if options.caloldprob: + calFirstRouteProbs("dump_000_%s.xml" % (options.aggregation), basename + "_001.rou.alt.xml",options.addweights,ecomeasure) + else: + shutil.copy(basename + "_001.rou.alt.xml", basename + "_001.rou.galt.xml") + shutil.copy(basename + "_001.rou.xml", basename + "_001.grou.xml") + if step == 0 and not options.skipFirstRouting: shutil.copy(basename + "_000.rou.alt.xml", basename + "_000.rou.galt.xml") shutil.copy(basename + "_000.rou.xml", basename + "_000.grou.xml") else: print 'step:', step print 'get externalgawron' dumpfile = "dump_%03i_%s.xml" % (step-1, options.aggregation) - ecomeasure = None - if options.ecomeasure: - ecomeasure = options.ecomeasure - output, edgesMap = getRouteChoices(edgesMap,dumpfile,basename + "_%03i.rou.alt.xml" % step,options.net,options.addweights, options.gA, options.gBeta,step,ecomeasure) + if (not options.skipFirstRouting) or (options.skipFirstRouting and step > 1): + output, edgesMap = getRouteChoices(edgesMap,dumpfile,basename + "_%03i.rou.alt.xml" % step,options.net,options.addweights, options.gA, options.gBeta,step,ecomeasure) files.append(output) - + # simulation print ">> Running simulation" btime = datetime.now() print ">>> Begin time: %s" % btime - writeSUMOConf(step, options, ",".join(files)) # todo: change 'grou.xml' + writeSUMOConf(sumoBinary, step, options, sumo_args, ",".join(files)) # todo: change 'grou.xml' log.flush() call([sumoBinary, "-c", "iteration_%03i.sumocfg" % step], log) if options.tripinfoFilter: @@ -403,9 +488,20 @@ print ">>> End time: %s" % etime print ">>> Duration: %s" % (etime-btime) print "<<" + + if options.weightmemory: + print ">> Smoothing edge weights" + costmemory.load_costs( + get_dumpfilename(options, step,"dump"), step, get_scale(options, step)) + costmemory.write_costs(get_weightfilename(options, step, "dump")) + print ">>> Updated %s edges" % costmemory.loaded() + print ">>> Decayed %s unseen edges" % costmemory.decayed() + print ">>> Error avg:%s mean:%s" % (costmemory.avg_error(), costmemory.mean_error()) + print ">>> Absolute Error avg:%s mean:%s" % (costmemory.avg_abs_error(), costmemory.mean_abs_error()) print "< Step %s ended (duration: %s)" % (step, datetime.now() - btimeA) print "------------------\n" + log.flush() print "dua-iterate ended (duration: %s)" % (datetime.now() - starttime) diff -Nru sumo-0.15.0~dfsg/tools/assign/duaIterate_analysis.py sumo-0.16.0~dfsg/tools/assign/duaIterate_analysis.py --- sumo-0.15.0~dfsg/tools/assign/duaIterate_analysis.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/duaIterate_analysis.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,179 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +@file duaIterate_analysis.py +@author Jakob Erdmann +@date 2012-09-06 +@version $Id: duaIterate_analysis.py 12757 2012-09-26 14:01:46Z namdre $ + +Extract statistics from the outputs of a duaIterate run for plotting. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +import os,sys +import re +from optparse import OptionParser +from collections import defaultdict +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from sumolib.miscutils import Statistics, uMax + +def parse_args(): + USAGE = "Usage: " + sys.argv[0] + " [options]" + optParser = OptionParser() + optParser.add_option("--stdout", + help="also parse the given FILE containing stdout of duaIterate") + optParser.add_option("-o", "--output", default="plot", + help="output prefix for plotting with gnuplot") + optParser.add_option("-l", "--label-size", default=40, dest="label_size", + help="limit length of the plot label to this size") + optParser.add_option("--limit", type=int, default=uMax, + help="only parse the first INT number of iterations") + optParser.add_option("--teleports", default="teleplot", + help="output prefix for plotting teleport-prone edges") + options, args = optParser.parse_args() + if len(args) != 1: + sys.exit(USAGE) + options.dualog = args[0] + return options + +def parse_dualog(dualog, limit): + print "Parsing %s" % dualog + teleStats = Statistics('Teleports') + header = ['#Emitted', 'Running', 'Waiting', 'Teleports', 'Loaded'] + step_values = [] # list of lists + step_counts = [] # list of edge teleport counters + reEmitted = re.compile("Emitted: (\d*)") + reLoaded = re.compile("Loaded: (\d*)") + reRunning = re.compile("Running: (\d*)") + reWaiting = re.compile("Waiting: (\d*)") + reFrom = re.compile("from '([^']*)'") + teleports = 0 + emitted = None + loaded = None + running = None + waiting = None + counts = defaultdict(lambda:0) + for line in open(dualog): + try: + if "Warning: Teleporting vehicle" in line: + teleports += 1 + edge = reFrom.search(line).group(1) + if ':' in edge: # mesosim output + edge = edge.split(':')[0] + counts[edge] += 1 + elif "Emitted:" in line: + emitted = reEmitted.search(line).group(1) + if "Loaded:" in line: # optional output + loaded = reLoaded.search(line).group(1) + else: + loaded = emitted + elif "Running:" in line: + running = reRunning.search(line).group(1) + elif "Waiting:" in line: + iteration = len(step_values) + if iteration > limit: + break + waiting = reWaiting.search(line).group(1) + teleStats.add(teleports, iteration) + step_values.append([emitted, running, waiting, teleports, loaded]) + teleports = 0 + step_counts.append(counts) + counts = defaultdict(lambda:0) + except: + sys.exit("error when parsing line '%s'" % line) + + print " parsed %s steps" % len(step_values) + print teleStats + return [header] + step_values, step_counts + +def parse_stdout(step_values, stdout): + print "Parsing %s" % stdout + step_values[0] += ['routingMinutes', 'simMinutes', 'absAvgError'] + reDuration = re.compile("Duration: (.*)$") + reError = re.compile("Absolute Error avg:(\d*)") + def get_minutes(line): + hours, minutes, seconds = reDuration.search(line).group(1).split(':') + return int(hours) * 60 + int(minutes) + float(seconds) / 60 + step = 1 + routingMinutes = None + simMinutes = None + error = None + for line in open(stdout): + if "Duration" in line: + if routingMinutes is None: + routingMinutes = get_minutes(line) + else: + simMinutes = get_minutes(line) + elif "Absolute" in line: + error = reError.search(line).group(1) + step_values[step] += [routingMinutes, simMinutes, error] + step += 1 + if step >= len(step_values): + break + routingMinutes = None + print " parsed %s steps" % (step - 1) + + +def write_data(outfile, step_values): + with open(outfile, 'w') as f: + for values in step_values: + f.write(' '.join(map(str,values)) + '\n') + +def write_plotfile(outfile, datafile, xlabel): + with open(outfile, 'w') as f: + f.write(""" +set xlabel '%s' +plot \\ +'%s' using 0:1 title 'emitted' with lines, \\ +'%s' using 0:4 title 'teleports' with lines, \\ +'%s' using 0:3 title 'waiting' with lines, \\ +'%s' using 0:5 title 'loaded' with lines, \\ +'%s' using 0:2 title 'running' with lines +""" % ((xlabel,) + (datafile,) * 5)) + + +def create_teleplot(plotfile, step_counts, xlabel): + datafile = plotfile + '.data' + # an edge is interesting if a large proportion of teleports happen on it + interestingness = defaultdict(lambda:0) + all_edges = set() + for counts in step_counts: + teleports = float(sum(counts.itervalues())) + if teleports == 0: + continue + for edge, count in counts.iteritems(): + interestingness[edge] += count/teleports + interesting = sorted([(c,e) for e,c in interestingness.iteritems()])[-7:] + print "most interesting edges:", interesting + interesting = [e for c,e in interesting] + with open(datafile, 'w') as f: + print >>f, '#' + ' '.join(interesting) + for counts in step_counts: + values = [counts[e] for e in interesting] + f.write(' '.join(map(str,values)) + '\n') + # write plotfile + with open(plotfile, 'w') as f: + f.write("set xlabel '%s'\nplot \\\n") + lines = ["'%s' using 0:%s title '%s' with lines" % (datafile, ii+1, edge) + for ii, edge in enumerate(interesting)] + f.write(', \\\n'.join(lines)) + + +def main(): + options = parse_args() + plotfile = options.output + datafile = plotfile + '.data' + step_values, step_counts = parse_dualog(options.dualog, options.limit) + if options.stdout is not None: + parse_stdout(step_values, options.stdout) + write_data(datafile, step_values) + duaPath = os.path.dirname(os.path.abspath(options.dualog))[-options.label_size:] + xlabel = 'Iterations in ' + duaPath + write_plotfile(plotfile, datafile, xlabel) + create_teleplot(options.teleports, step_counts, xlabel) + +################## +if __name__ == "__main__": + main() diff -Nru sumo-0.15.0~dfsg/tools/assign/elements.py sumo-0.16.0~dfsg/tools/assign/elements.py --- sumo-0.15.0~dfsg/tools/assign/elements.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/elements.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: elements.py 11700 2012-01-10 22:20:15Z behrisch $ +@version $Id: elements.py 12567 2012-08-20 10:01:44Z dkrajzew $ This script is to define the classes and functions for - reading network geometric, @@ -36,8 +36,8 @@ """ This class is to store node attributes and the respective incoming/outgoing links. """ - def __init__(self, id, coord=None, incLanes=None): - sumolib.net.Node.__init__(self, id, coord, incLanes) + def __init__(self, id, type=None, coord=None, incLanes=None): + sumolib.net.Node.__init__(self, id, type, coord, incLanes) self.preds = [] self.wasUpdated = False diff -Nru sumo-0.15.0~dfsg/tools/assign/inputs.py sumo-0.16.0~dfsg/tools/assign/inputs.py --- sumo-0.15.0~dfsg/tools/assign/inputs.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/inputs.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: inputs.py 11700 2012-01-10 22:20:15Z behrisch $ +@version $Id: inputs.py 12432 2012-06-26 17:27:07Z yunpangwang $ This script is to retrieve the assignment parameters, the OD districts and the matrix from the input files. Moreover, the link travel time for district connectors will be estimated. @@ -24,7 +24,6 @@ periodList = [] if verbose: print 'matrix:', str(matrix) - odpairs = 0 origins = 0 dest= 0 diff -Nru sumo-0.15.0~dfsg/tools/assign/matrixDailyToHourly.py sumo-0.16.0~dfsg/tools/assign/matrixDailyToHourly.py --- sumo-0.15.0~dfsg/tools/assign/matrixDailyToHourly.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/matrixDailyToHourly.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2008-08-20 -@version $Id: matrixDailyToHourly.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: matrixDailyToHourly.py 12567 2012-08-20 10:01:44Z dkrajzew $ This script is to generate hourly matrices from a VISUM daily matrix. The taffic demand of the traffic zones, which have the same connection links, will be integrated. @@ -52,17 +52,17 @@ self._district = None def startElement(self, name, attrs): - if name == 'district': + if name == 'taz': self._newDistrict = District(attrs['id']) self._district = attrs['id'] self._districtList.append(self._newDistrict) - elif name == 'dsource' and self._district != None: + elif name == 'tazSource' and self._district != None: self._newDistrict.sourcelink = attrs['id'] - elif name == 'dsink' and self._district != None: + elif name == 'tazSink' and self._district != None: self._newDistrict.sinklink = attrs['id'] def endElement(self, name): - if name == 'district': + if name == 'taz': self._district = None def combineDemand(matrix, districtList, startVertices, endVertices): diff -Nru sumo-0.15.0~dfsg/tools/assign/network.py sumo-0.16.0~dfsg/tools/assign/network.py --- sumo-0.15.0~dfsg/tools/assign/network.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/network.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-12-25 -@version $Id: network.py 11700 2012-01-10 22:20:15Z behrisch $ +@version $Id: network.py 12567 2012-08-20 10:01:44Z dkrajzew $ This script is to retrive the network data, the district data and the vehicle data, generated by SUMO, from the respective XML files. Besides, the class 'Net' is also definded here. @@ -34,12 +34,12 @@ self._detectedLinkCounts = 0. self._detectedEdges = [] - def addNode(self, id, coord=None, incLanes=None): + def addNode(self, id, type=None, coord=None, incLanes=None): if id not in self._id2node: node = Vertex(id, coord, incLanes) self._nodes.append(node) self._id2node[id] = node - self.setAdditionalNodeInfo(self._id2node[id], coord, incLanes) + self.setAdditionalNodeInfo(self._id2node[id], type, coord, incLanes) return self._id2node[id] def addEdge(self, id, fromID, toID, prio, function, name): @@ -237,7 +237,7 @@ if verbose: foutkpath = file('kpaths.xml', 'w') print >> foutkpath, """ - + """ % datetime.datetime.now() for start, startVertex in enumerate(startVertices): for vertex in self.getNodes(): @@ -314,18 +314,18 @@ self.I = 100 def startElement(self, name, attrs): - if name in ['district', 'taz']: + if name=='taz': self._node = self._net.addNode(attrs['id']) self._net._startVertices.append(self._node) self._net._endVertices.append(self._node) - elif name in ['dsink', 'tazSink']: + elif name=='tazSink': sinklink = self._net.getEdge(attrs['id']) self.I += 1 newEdge = self._net.addEdge(self._node._id + str(self.I), sinklink._to._id, self._node._id, -1, "connector", "") newEdge._length = 0. newEdge.ratio = attrs['weight'] newEdge.connection = 1 - elif name in ['dsource', 'tazSource']: + elif name=='tazSource': sourcelink = self._net.getEdge(attrs['id']) self.I += 1 newEdge = self._net.addEdge(self._node._id + str(self.I), self._node._id, sourcelink._from._id, -1, "connector", "") diff -Nru sumo-0.15.0~dfsg/tools/assign/one-shot.py sumo-0.16.0~dfsg/tools/assign/one-shot.py --- sumo-0.15.0~dfsg/tools/assign/one-shot.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/one-shot.py 2012-12-04 00:26:11.000000000 +0000 @@ -6,7 +6,7 @@ @author Yun-Pang Wang @author Michael Behrisch @date 2008-03-10 -@version $Id: one-shot.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: one-shot.py 12433 2012-06-26 17:30:19Z yunpangwang $ This script does multiple sumo runs with different rerouting intervals. @@ -39,6 +39,9 @@ print >> fd, ' ' % step if not options.noTripinfo: print >> fd, ' ' % step + if options.weightfiles: + print >> fd, ' ' % options.weightfiles + add = 'dump_%s.add.xml' % step if options.additional: add += "," + options.additional @@ -47,21 +50,27 @@ """ % (add, options.begin, options.routeSteps) + if options.end: print >> fd, ' ' % options.end if options.mesosim: print >> fd, ' ' + if options.routingalgorithm: + print >> fd, ' ' % options.routingalgorithm print >> fd, """ + + + -""" % (step, options.updateInterval, options.withtaz, options.lastRoutes, not options.withWarnings) +""" % (step, options.updateInterval, options.withtaz, options.reroutingexplicit, options.lastRoutes, options.withexittime, options.routesorted, not options.withWarnings) fd.close() fd = open("dump_%s.add.xml" % step, "w") print >> fd, """ @@ -91,8 +100,8 @@ optParser.add_option("-i", "--adaptation-interval", dest="updateInterval", type="int", default=1, help="Set edge weight adaptation interval") -optParser.add_option("-E", "--disable-summary", "--disable-emissions", action="store_true", dest="noSummary", - default=False, help="No summaries are written by the simulation") +optParser.add_option("-E", "--disable-summary", "--disable-emissions", action="store_true", dest="noSummary", + default=False, help="No summaries are written by the simulation") optParser.add_option("-T", "--disable-tripinfos", action="store_true", dest="noTripinfo", default=False, help="No tripinfos are written by the simulation") optParser.add_option("-m", "--mesosim", action="store_true", dest="mesosim", @@ -103,12 +112,21 @@ default="", help="Additional files") optParser.add_option("-L", "--lastRoutes", action="store_true", dest="lastRoutes", default=False, help="only save the last routes in the vehroute-output") - +optParser.add_option("-F", "--weight-files", dest="weightfiles", + help="Load edge/lane weights from FILE", metavar="FILE") +optParser.add_option("-A", "--routing-algorithm", dest="routingalgorithm", type="choice", + choices=('dijkstra', 'astar'), + default="astar", help="type of routing algorithm [default: %default]") +optParser.add_option("-r", "--rerouting-explicit", dest="reroutingexplicit", type="string", + default = "", help="define the ids of the vehicles that should be re-routed.") +optParser.add_option("-x", "--with-exittime", action="store_true", dest="withexittime", + default= False, help="Write the exit times for all edges") +optParser.add_option("-s", "--route-sorted", action="store_true", dest="routesorted", + default= False, help="sorts the output by departure time") optParser.add_option("-p", "--path", dest="path", default=os.environ.get("SUMO_BINDIR", ""), help="Path to binaries") (options, args) = optParser.parse_args() - sumo = "sumo" if options.mesosim: sumo = "meso" diff -Nru sumo-0.15.0~dfsg/tools/assign/outputs.py sumo-0.16.0~dfsg/tools/assign/outputs.py --- sumo-0.15.0~dfsg/tools/assign/outputs.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/outputs.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-12-25 -@version $Id: outputs.py 11700 2012-01-10 22:20:15Z behrisch $ +@version $Id: outputs.py 12595 2012-08-24 14:07:33Z dkrajzew $ This script is for generating the outputs from the choosed traffic assignment. @@ -79,7 +79,7 @@ veh.depart = random.randint(departtime, departtime + 3600*options.hours) vehicles.sort(key=operator.attrgetter('depart')) # sorting by departure times for veh in vehicles: # output the generated routes - foutroute.write(' \n' %(veh.label, veh.depart)) + foutroute.write(' \n' %(veh.label, veh.depart)) foutroute.write(' ') for edge in veh.route[1:-1]: # for generating vehicle routes used in SUMO foutroute.write('%s ' % edge._id) @@ -120,7 +120,7 @@ def linkChoicesOutput(net, startVertices, endVertices, matrixPshort, linkChoiceMap, odPairsMap, outputdir, starttime): foutchoice = file(os.path.join(outputdir, "linkchoices.xml"), 'w') print >> foutchoice, """ - + """ % starttime for e in net._detectedEdges: if len(linkChoiceMap[e.detected])> 0: diff -Nru sumo-0.15.0~dfsg/tools/assign/routeChoices.py sumo-0.16.0~dfsg/tools/assign/routeChoices.py --- sumo-0.15.0~dfsg/tools/assign/routeChoices.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/assign/routeChoices.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Evamarie Wiessner @author Yun-Pang Floetteroed @date 2007-02-27 -@version $Id: routeChoices.py 12093 2012-03-13 22:11:37Z behrisch $ +@version $Id: routeChoices.py 12181 2012-03-26 15:42:38Z yunpangwang $ This script is to calculate the route choice probabilities based on different methods. - Gawron @@ -21,9 +21,6 @@ from xml.sax import saxutils, make_parser, handler from xml.sax import parse from numpy import * -#from matplotlib import pyplot as plt -from math import * - class Vehicle: def __init__(self,label,depart, departlane, departpos, departspeed): @@ -78,8 +75,8 @@ self.label = "%s" % pathNum pathNum += 1 self.edges = edges - self.ex_probability = None - self.act_probability = 0. + #self.ex_probability = None + self.probability = 0. self.selected = False self.ex_cost = 0. self.act_cost = 0. @@ -88,7 +85,7 @@ def __init__(self, edgesList, edgesMap): self._edgesList = edgesList self._edgesMap = edgesMap - self._edgObj = None + self._edgeObj = None def startElement(self, name, attrs): if name == 'edge' and not attrs.has_key('function'): @@ -96,13 +93,14 @@ self._edgeObj = Edge(attrs['id']) self._edgesList.append(self._edgeObj) self._edgesMap[attrs['id']] = self._edgeObj - if self._edgeObj and name == 'lane': - self._edgeObj.length = float(attrs['length']) - self._edgeObj.freespeed = float(attrs['speed']) #todo when no data in dump. default for fuel consumption? - self._edgeObj.freetraveltime = self._edgeObj.length/self._edgeObj.speed + if self._edgeObj and name == 'lane': + self._edgeObj.length = float(attrs['length']) + self._edgeObj.freespeed = float(attrs['speed']) + self._edgeObj.freetraveltime = self._edgeObj.length/self._edgeObj.freespeed + def endElement(self, name): if name == 'edge': - self._edgObj = None + self._edgeObj = None class addweightsReader(handler.ContentHandler): def __init__(self, edgesList, edgesMap): @@ -139,8 +137,7 @@ if attrs.has_key('CO2_abs'): self._edgeObj.CO2_abs_default = float(attrs['CO2_abs']) if attrs.has_key('CO_abs'): - self._edgeObj.CO_abs_default = float(attrs['CO_abs']) - + self._edgeObj.CO_abs_default = float(attrs['CO_abs']) class routeReader(handler.ContentHandler): def __init__(self, vehList, vehMap): @@ -185,9 +182,7 @@ def startElement(self, name, attrs): if name == 'vehicle': - self._vehObj = Vehicle(attrs['id'], attrs['depart'], attrs['departLane'], attrs['departPos'], attrs['departSpeed']) - self._vehMap[attrs['id']] = self._vehObj - self._vehList.append(self._vehObj) + self._vehObj = self._vehMap[attrs['id']] if self._vehObj and name == 'routeDistribution': self._currentSelected = attrs['last'] @@ -204,11 +199,14 @@ if not self._existed: self._routObj = Route(attrs['edges']) self._vehObj.routesList.append(self._routObj) + if attrs.has_key('probability'): - self._routObj.ex_probability = float(attrs['probability']) + self._routObj.probability = float(attrs['probability']) + if self._routObj.probability == 0.0: + self._routObj.probability = 1.02208127529e-16 # check with Micha if there is a better way to avoid the prob. = 0. if attrs.has_key('cost'): self._routObj.ex_cost = float(attrs['cost']) - for e in attrs['edges'].split(' '): + for e in self._routObj.edges.split(' '): eObj = self._edgesMap[e] if self._ecoMeasure != 'fuel' and eObj.traveltime == 0.: self._routObj.act_cost += eObj.freetraveltime @@ -218,45 +216,71 @@ self._routObj.act_cost += eObj.fuel_perVeh_default elif self._ecoMeasure == 'fuel' and eObj.fuel_perVeh > 0.: self._routObj.act_cost += eObj.fuel_perVeh + if self._routObj.ex_cost == 0.: + self._routObj.ex_cost = self._routObj.act_cost def endElement(self, name): if name == 'vehicle': - if len(self._vehObj.routesList) == 1: - self._vehObj.routesList[0].ex_probability = 1. + #if len(self._vehObj.routesList) == 1: + # self._vehObj.routesList[0].probability = 1. + # for the routes which are from the sumo's rou.alt.xml file for r in self._vehObj.routesList: - if not r.ex_probability: - r.ex_probability = 1./float(len(self._vehObj.routesList)) - print 'new probability is calculated.' + if r.act_cost == 0.: + for e in r.edges.split(' '): + eObj = self._edgesMap[e] + if self._ecoMeasure != 'fuel' and eObj.traveltime == 0.: + r.act_cost += eObj.freetraveltime + elif self._ecoMeasure != 'fuel' and eObj.traveltime > 0.: + r.act_cost += eObj.traveltime + elif self._ecoMeasure == 'fuel' and eObj.fuel_perVeh == 0.: + r.act_cost += eObj.fuel_perVeh_default + elif self._ecoMeasure == 'fuel' and eObj.fuel_perVeh > 0.: + r.act_cost += eObj.fuel_perVeh + if r.ex_cost == 0.: + r.ex_cost = r.act_cost + # calcuate the probabilites for the new routes + if not r.probability: + r.probability = 1./float(len(self._vehObj.routesList)) + print 'new probability for route', r.label, 'for veh', self._vehObj.label self._newroutesList.append(r) + + # adjust the probabilites of the existing routes due to the new routes if len(self._newroutesList) > 0: addProb = 0. origProbSum = 0. for r in self._vehObj.routesList: if r in self._newroutesList: - addProb += r.ex_probability + addProb += r.probability else: - origProbSum += r.ex_probability + origProbSum += r.probability for r in self._vehObj.routesList: if r not in self._newroutesList: - r.ex_probability = r.ex_probability/origProbSum * (1. - addProb) + r.probability = r.probability/origProbSum * (1. - addProb) + # update the costs of routes not used by the driver + for r in self._vehObj.routesList: + if r.edges != self._vehObj.selectedRouteEdges: + r.act_cost = self._beta * r.act_cost + (1. - self._beta) * r.ex_cost + + # calcuate the route choice probabilities based on Gawron for r1 in self._vehObj.routesList: # todo: add "one used route to all routes" for r2 in self._vehObj.routesList: if r1.label != r2.label: - gawron(r1, r2, self._alpha, self._beta, self._vehObj.selectedRouteEdges) - + gawron(r1, r2, self._alpha) + + # decide which route will be selected randProb = random.random() if len(self._vehObj.routesList) == 1: - self._vehObj.routesList[0].act_probability = 1. + self._vehObj.routesList[0].probability = 1. self._selected = 0 else: + cumulatedProbs = 0. for i, r in enumerate(self._vehObj.routesList): - if i == 0 and r.act_probability >= randProb: - self._selected = i - break - elif i > 0 and (self._vehObj.routesList[i-1].act_probability + self._vehObj.routesList[i].act_probability) >= randProb: + cumulatedProbs += r.probability + if cumulatedProbs >= randProb: self._selected = i break + # generate the *.rou.xml self._foutrout.write(' \n' % (self._vehObj.label, self._vehObj.depart, self._vehObj.departlane, self._vehObj.departpos, self._vehObj.departspeed)) @@ -269,7 +293,7 @@ self._fout.write(' \n' % self._selected) for route in self._vehObj.routesList: - self._fout.write(' \n' % (route.act_cost, route.act_probability, route.edges)) + self._fout.write(' \n' % (route.act_cost, route.probability, route.edges)) self._fout.write(' \n') self._fout.write(' \n') @@ -332,8 +356,8 @@ if name == 'edge': self._edgeObj = None -def resetEdges(edgesList,edgesMap): - for eid in edgesList: +def resetEdges(edgesMap): + for eid in edgesMap: e = edgesMap[eid] e.traveltime = 0. e.CO_abs = 0. @@ -359,20 +383,19 @@ outputPath = os.path.abspath(routeAltfile) outputPath = os.path.dirname(outputPath) prefix = os.path.basename(routeAltfile) - prefix = prefix[:prefix.find('.')] + #prefix = prefix[:prefix.find('.')] + prefix = prefix[:-12] print 'outputPath:', outputPath print 'prefix:', prefix outputAltfile = os.path.join(outputPath, prefix + '.rou.galt.xml') outputRoufile = os.path.join(outputPath, prefix + '.grou.xml') - print outputAltfile - print outputRoufile - if step == 1: + if len(edgesMap) == 0: print 'parse network file' parse(netfile, netReader(edgesList, edgesMap)) parse(addWeightsfile, addweightsReader(edgesList,edgesMap)) else: - resetEdges(edgesList, edgesMap) + resetEdges(edgesMap) fout = open(outputAltfile, 'w') foutrout = open(outputRoufile, 'w') @@ -395,89 +418,93 @@ parse(routeAltfile, routeReader(vehList, vehMap)) # parse routeAltfile from SUMO print 'parse routeAltfile from externalGawron' ex_outputAltFile = prefix[:prefix.rfind('_')] + '_%03i' %(step-1) + '.rou.galt.xml' - ex_outputAltFile = os.path.join(outputPath,ex_outputAltFile) print 'ex_outputAltFile:', ex_outputAltFile - parse(ex_outputAltFile, vehrouteReader(vehList, vehMap, edgesMap,fout, foutrout,ecoMeasure,alpha, beta)) - + parse(ex_outputAltFile, vehrouteReader(vehList,vehMap,edgesMap,fout,foutrout,ecoMeasure,alpha,beta)) return outputRoufile, edgesMap -def gawron(r1, r2, alpha, beta,selectedRouteEdges): +def gawron(r1, r2, alpha): a = alpha - #print 'run gawron' - if r1.edges != selectedRouteEdges: - r1.act_cost = beta * r1.act_cost + (1. - beta) * r1.ex_cost - if r2.edges != selectedRouteEdges: - r2.act_cost = beta * r2.act_cost + (1. - beta) * r2.ex_cost - - delta = (r2.act_cost - r1.act_cost)/(r2.act_cost + r1.act_cost) - + delta = (r2.act_cost - r1.act_cost)/(r1.act_cost + r2.act_cost) g = math.exp(a*delta/(1-delta*delta)) - - r1.act_probability = (r1.ex_probability*(r1.ex_probability + r2.ex_probability)*g)/(r1.ex_probability*g + r2.ex_probability) # check together with Eva - r2.act_probability = r1.ex_probability + r2.ex_probability - r1.act_probability + ex_prob = r1.probability + r1.probability = (r1.probability*(r1.probability + r2.probability)*g)/(r1.probability*g + r2.probability) # check together with Eva + r2.probability = ex_prob + r2.probability - r1.probability + +def calFirstRouteProbs(dumpfile, sumoAltFile, addweights, ecoMeasure=None): + basename = sumoAltFile.split('_')[0] + outputAltFile = basename + "_001.rou.galt.xml" + outputRouFile = basename + "_001.rou.alt.xml" + edgesList = [] + edgesMap = {} + vehList = [] + vehMap = {} + parse(netfile, netReader(edgesList, edgesMap)) + parse(addweights, addweightsReader(edgesList,edgesMap)) + parse(dumpfile, dumpsReader(edgesList, edgesMap)) + parse(sumoAltFile, routeReader(vehList, vehMap)) -#Eva -# gegeben: 3 Routen -# fuel consumption - -#def get_costs(p, l): -# C = 1000 -# v = 10 -# F = 5000 -# Vi = 30 -# v0 = 16.67 -# c = 1 -# k = 0.5 -# q = 1000 - -# Ti = l/v*(1+(p*F/(2*C))*(p*F/(2*C))) -# return c*Ti*(1 + k*p*F/q + 0.5*math.pow(Vi/v0,3)/math.pow(1+k*p*F/q,2)) - -#def gawron(p1, p2, c1, c2, l1, l2): -# a = 0.5 -# b = 0.9 -# delta = (c2-c1)/(c2 + c1) -# g = math.exp(a*delta/(1-delta*delta)) -# tmp = p1 -# -# p1 = (p1*(p1 + p2)*g)/(p1*g + p2) -# p2 = tmp+p2-p1 -# c1 = get_costs(p1, l1) -# c2 = b*get_costs(p2, l2) + (1-b)*c2 -# -# return p1, p2, c1, c2 -# -#anz = 100 -# -#l1 = 100 -#l2 = 150 -#l3 = 200 -# -#c1 = get_costs(0,l1) # fuel consumuption -#c2 = get_costs(0,l2) # fuel consumuption -#c3 = get_costs(0,l3) # fuel consumuption -# -#p1 = 1 -#p2 = 0 -#p3 = 0 -# -#for i in arange(anz): -# -# if (i==1): -# p1 = 0.5 -# p2 = 0.5 -# -# if (i==2): -# p1 = p1-(0.33*p1) -# p2 = 0.67-p1 -# p3 = 0.33 -# -# p1, p2, c1, c2 = gawron (p1, p2, c1, c2, l1, l2) -# p1, p3, c1, c3 = gawron (p1, p3, c1, c3, l1, l3) -# # p2, p3, c2, c3 = gawron (p2, p3, c2, c3, l2, l3) -# plt.plot(i, p1, ls='', marker='o', mew=0, ms=2, color = 'b') -# plt.plot(i, p2, ls='', marker='o', mew=0, ms=2, color = 'r') -# plt.plot(i, p3, ls='', marker='o', mew=0, ms=2, color = 'g') - -#plt.draw() -#plt.show() \ No newline at end of file + fout = open(outputAltFile, 'w') + foutrout = open(outputRouFile, 'w') + fout.write('\n') + fout.write('\n') + fout.write('\n') + foutrout.write('\n') + foutrout.write('\n') + foutrout.write('') + + for v in vehMap: + vehObj = vehMap[v] + for r in vehObj.routesList: + for e in r.edges.split(' '): + eObj = edgesMap[e] + if ecoMeasure != 'fuel' and eObj.traveltime == 0.: + r.act_cost += eObj.freetraveltime + r.ex_cost += eObj.freetraveltime + elif ecoMeasure != 'fuel' and eObj.traveltime > 0.: + r.act_cost += eObj.traveltime + r.ex_cost += eObj.freetraveltime + elif ecoMeasure == 'fuel' and eObj.fuel_perVeh == 0.: + r.act_cost += eObj.fuel_perVeh_default + r.ex_cost += eObj.fuel_perVeh_default + elif ecoMeasure == 'fuel' and eObj.fuel_perVeh > 0.: + r.act_cost += eObj.fuel_perVeh + r.ex_cost += eObj.fuel_perVeh + costSum = 0. + for r in vehObj.routesList: + costSum += r.ex_cost + for r in vehObj.routesList: + r.ex_probability = r.ex_cost/costSum + + randProb = random.random() + selected = 0 + if len(vehObj.routesList) > 1: + cumulatedProbs = 0. + for i, r in enumerate(vehObj.routesList): + cumulatedProbs += r.ex_probability + if cumulatedProbs >= randProb: + selected = i + break + + # generate the *.rou.xml + foutrout.write(' \n' + % (vehObj.label, vehObj.depart, vehObj.departlane, vehObj.departpos, vehObj.departspeed)) + self._foutrout.write(' \n'% vehObj.routesList[selected].edges) + self._foutrout.write(' \n') + + #generate the *.rou.alt.xml + self._fout.write(' \n' + % (vehObj.label, vehObj.depart, vehObj.departlane, vehObj.departpos, vehObj.departspeed)) + self._fout.write(' \n' % selected) + + for route in self._vehObj.routesList: + self._fout.write(' \n' % (route.act_cost, route.ex_probability, route.edges)) + self._fout.write(' \n') + self._fout.write(' \n') + self._fout.write('\n') + self._fout.close() + self._foutrout.write('\n') + self._foutrout.close() diff -Nru sumo-0.15.0~dfsg/tools/build/checkAuthors.py sumo-0.16.0~dfsg/tools/build/checkAuthors.py --- sumo-0.15.0~dfsg/tools/build/checkAuthors.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/build/checkAuthors.py 2012-12-04 00:26:11.000000000 +0000 @@ -2,7 +2,7 @@ """ @file checkSvnProps.py @author Michael Behrisch -@version $Id: checkAuthors.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: checkAuthors.py 12130 2012-03-19 11:58:21Z dkrajzew $ Checks authors for all files. @@ -112,7 +112,7 @@ out.close() os.rename(out.name, fullName) -ignoreRevisions = set(["11445", "10974", "9705", "9477", "9429", "9348", "8566", +ignoreRevisions = set(["12129", "12128", "11445", "10974", "9705", "9477", "9429", "9348", "8566", "8439", "8000", "7728", "7533", "6958", "6589", "6537", "6399", "6069", "5922", "5048", "4669", "4389", "4257", "4166", "4165", "4084", "4076", "4015", "3966", "3486"]) diff -Nru sumo-0.15.0~dfsg/tools/build/checkSvnProps.py sumo-0.16.0~dfsg/tools/build/checkSvnProps.py --- sumo-0.15.0~dfsg/tools/build/checkSvnProps.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/build/checkSvnProps.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file checkSvnProps.py @author Michael Behrisch @date 2010 -@version $Id: checkSvnProps.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: checkSvnProps.py 12434 2012-06-26 19:17:45Z behrisch $ Checks svn property settings for all files. @@ -16,7 +16,8 @@ from optparse import OptionParser _SOURCE_EXT = [".h", ".cpp", ".py", ".pl", ".java", ".am"] -_TESTDATA_EXT = [".xml", ".prog", ".complex", ".dfrouter", ".duarouter", ".jtrrouter", +_TESTDATA_EXT = [".xml", ".prog", ".csv", + ".complex", ".dfrouter", ".duarouter", ".jtrrouter", ".netconvert", ".netgen", ".od2trips", ".polyconvert", ".sumo", ".meso", ".tools", ".traci", ".activitygen", ".scenario", ".sumocfg", ".netccfg", ".netgcfg"] diff -Nru sumo-0.15.0~dfsg/tools/build/dailyBuildMSVC.py sumo-0.16.0~dfsg/tools/build/dailyBuildMSVC.py --- sumo-0.15.0~dfsg/tools/build/dailyBuildMSVC.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/build/dailyBuildMSVC.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Jakob Erdmann @author Laura Bieker @date 2008 -@version $Id: dailyBuildMSVC.py 12086 2012-03-13 13:49:59Z behrisch $ +@version $Id: dailyBuildMSVC.py 12917 2012-11-02 08:52:02Z namdre $ Does the nightly svn update on the windows server and the visual studio build. The script is also used for the meso build. @@ -42,6 +42,9 @@ default=False, help="force rebuild even if no source changed") (options, args) = optParser.parse_args() +sys.path.append(os.path.join(options.rootDir, options.testsDir)) +import runInternalTests + env = os.environ env["SMTP_SERVER"]="smtprelay.dlr.de" env["TEMP"]=env["TMP"]=r"D:\Delphi\texttesttmp" @@ -77,7 +80,13 @@ else: open(makeLog, 'a').write("Error parsing svn revision\n") sys.exit() - update_lines = len(update_log[:update_log.index('Fetching external')].splitlines()) + end_marker = 'Fetching external' + if end_marker in update_log: + update_lines = len(update_log[:update_log.index(end_marker)].splitlines()) + else: + open(makeLog, 'a').write("Error parsing svn output\n") + sys.exit() + if update_lines < 3 and not options.force: open(makeLog, 'a').write("No changes since last update, skipping build and test\n") print "No changes since last update, skipping build and test" @@ -123,7 +132,10 @@ files_to_zip = ( glob.glob(os.path.join(env["XERCES"+envSuffix], "bin", "xerces-c_?_?.dll")) + glob.glob(os.path.join(env["PROJ_GDAL"+envSuffix], "bin", "*.dll")) + - glob.glob(os.path.join(env["FOX16"+envSuffix], "lib", "FOXDLL-?.?.dll")) + + glob.glob(os.path.join(env["FOX16"+envSuffix], "lib", + "FOXDLL-1.6.dll")) + + glob.glob(os.path.join(env["FOX16"+envSuffix], "lib", + "libpng*.dll")) + glob.glob(os.path.join(nightlyDir, "msvc?100.dll")) + glob.glob(os.path.join(options.rootDir, options.binDir, "*.exe")) + glob.glob(os.path.join(options.rootDir, options.binDir, "*.jar")) + @@ -143,9 +155,10 @@ print >> log, "I/O error(%s): %s" % (errno, strerror) if platform == "Win32" and options.sumoExe == "sumo": try: - subprocess.call(os.path.join(os.path.dirname(__file__), '..', game, 'setup.py'), stdout=log, stderr=subprocess.STDOUT) - except: - print >> log, "Warning: Could not create nightly sumogame.zip!" + setup = os.path.join(os.path.dirname(__file__), '..', 'game', 'setup.py') + subprocess.call(['python', setup], stdout=log, stderr=subprocess.STDOUT) + except Exception as e: + print >> log, "Warning: Could not create nightly sumogame.zip! (%s)" % e log.close() subprocess.call(compiler+" /rebuild Debug|%s %s\\%s /out %s" % (platform, options.rootDir, options.project, makeAllLog)) if options.addConf: @@ -154,16 +167,14 @@ # run tests env["TEXTTEST_TMP"] = os.path.join(options.rootDir, env["FILEPREFIX"]+"texttesttmp") env["TEXTTEST_HOME"] = os.path.join(options.rootDir, options.testsDir) + if "SUMO_HOME" not in env: + env["SUMO_HOME"] = options.rootDir shutil.rmtree(env["TEXTTEST_TMP"], True) shutil.rmtree(env["SUMO_REPORT"], True) os.mkdir(env["SUMO_REPORT"]) - for name in ["dfrouter", "duarouter", "jtrrouter", "netconvert", "netgen", "od2trips", "sumo", "polyconvert", "sumo-gui", "activitygen"]: + for name in ["dfrouter", "duarouter", "jtrrouter", "netconvert", "netgenerate", "od2trips", "sumo", "polyconvert", "sumo-gui", "activitygen"]: binary = os.path.join(options.rootDir, options.binDir, name + programSuffix + ".exe") - if name == "sumo": - binary = os.path.join(options.rootDir, options.binDir, options.sumoExe + programSuffix + ".exe") if name == "sumo-gui": - if options.sumoExe == "meso": - binary = os.path.join(options.rootDir, options.binDir, "meso-gui" + programSuffix + ".exe") if os.path.exists(binary): env["GUISIM_BINARY"] = binary elif os.path.exists(binary): @@ -171,7 +182,10 @@ log = open(testLog, 'w') # provide more information than just the date: nameopt = " -name %sr%s" % (date.today().strftime("%d%b%y"), svnrev) - subprocess.call("texttest.py -b "+env["FILEPREFIX"]+nameopt, stdout=log, stderr=subprocess.STDOUT, shell=True) + if options.sumoExe == "meso": + runInternalTests.runInternal(programSuffix, "-b "+env["FILEPREFIX"]+nameopt, log) + else: + subprocess.call("texttest.py -b "+env["FILEPREFIX"]+nameopt, stdout=log, stderr=subprocess.STDOUT, shell=True) subprocess.call("texttest.py -a sumo.gui -b "+env["FILEPREFIX"]+nameopt, stdout=log, stderr=subprocess.STDOUT, shell=True) subprocess.call("texttest.py -b "+env["FILEPREFIX"]+" -coll", stdout=log, stderr=subprocess.STDOUT, shell=True) ago = datetime.datetime.now() - datetime.timedelta(30) diff -Nru sumo-0.15.0~dfsg/tools/build/dailyUpdateMakeGCC sumo-0.16.0~dfsg/tools/build/dailyUpdateMakeGCC --- sumo-0.15.0~dfsg/tools/build/dailyUpdateMakeGCC 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/build/dailyUpdateMakeGCC 2012-12-04 00:26:11.000000000 +0000 @@ -27,7 +27,9 @@ # echo "no changes since last run, skipping build and test" exit fi -tools/build/checkSvnProps.py +if test -d "$NIGHTDIR"; then + tools/build/checkSvnProps.py +fi make -f Makefile.cvs >> $MAKELOG 2>&1 || (echo "autoreconf failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) ./configure --prefix=$PREFIX/sumo \ --with-gtest=$PREFIX/gtest >> $MAKELOG 2>&1 || (echo "configure failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) @@ -65,7 +67,11 @@ export TEXTTEST_TMP=$PREFIX/texttesttmp find $SUMO_BATCH_RESULT -mtime +20 -type f | xargs -r rm rm -rf $SUMO_REPORT/* $TEXTTEST_TMP/* - tests/runTests.sh -b $FILEPREFIX &> $TESTLOG + if test $FILEPREFIX == meso; then + tests/runInternalTests.py "b $FILEPREFIX" &> $TESTLOG + else + tests/runTests.sh -b $FILEPREFIX &> $TESTLOG + fi if which Xvfb &>/dev/null; then tests/runTests.sh -a sumo.gui -b $FILEPREFIX >> $TESTLOG 2>&1 fi @@ -76,8 +82,8 @@ echo "--" >> $STATUSLOG basename $MAKEALLLOG >> $STATUSLOG -export CXXFLAGS="-Wall -W -pedantic -Wno-long-long" -./configure --program-suffix=D --prefix=$PREFIX/sumo \ +export CXXFLAGS="-Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security" +./configure --prefix=$PREFIX/sumo --with-python \ --disable-double-precision --disable-subsecond --disable-internal-lanes \ --enable-debug --enable-memcheck --enable-messages &> $MAKEALLLOG || (echo "configure with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) if make >> $MAKEALLLOG 2>&1; then diff -Nru sumo-0.15.0~dfsg/tools/build/status.py sumo-0.16.0~dfsg/tools/build/status.py --- sumo-0.15.0~dfsg/tools/build/status.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/build/status.py 2012-12-04 00:26:11.000000000 +0000 @@ -35,8 +35,8 @@ if f.startswith("batchreport"): b = open(join(root, f)) l = b.readline() - if l.startswith("FAILED") or l.startswith("succeeded"): - print >> out, f, l, + if l.startswith("FAILED") or l.startswith("succeeded") or l.startswith("killed"): + print >> out, f, l, b.close() print >> out, "--" print >> out, basename(makeAllLog) diff -Nru sumo-0.15.0~dfsg/tools/build/version.py sumo-0.16.0~dfsg/tools/build/version.py --- sumo-0.15.0~dfsg/tools/build/version.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/build/version.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,12 +5,14 @@ @author Daniel Krajzewicz @author Jakob Erdmann @date 2007 -@version $Id: version.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: version.py 12274 2012-04-27 07:58:02Z namdre $ This script rebuilds "../../src/version.h", the file which lets the applications know the version of their build. -If a version file exists, it is kept, otherwise the current - SVN revision is used as version information. +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 SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors @@ -18,32 +20,103 @@ """ import sys -from os.path import dirname, exists, getmtime, join +import re +from os.path import dirname, exists, getmtime, join, isdir -versionDir = entriesDir = join(dirname(__file__), '..', '..', 'src') -if len(sys.argv) > 1: - versionDir = sys.argv[1] -if len(sys.argv) > 2: - entriesDir = sys.argv[2] -versionFile = join(versionDir, 'version.h') -entriesFile = join(entriesDir, '.svn', 'entries') - -svnRevision = "UNKNOWN" -if exists(entriesFile): - if exists(versionFile) and getmtime(versionFile) > getmtime(entriesFile): - sys.exit() - entries = open(entriesFile) - for i, l in enumerate(entries): - if i == 3 and l.strip().isdigit(): - svnRevision = l.strip() - revIndex = l.find('revision="') - if revIndex >= 0: - revIndex += 10 - svnRevision = l[revIndex:l.index('"', revIndex)] - break - entries.close() - -print('generating %s from revision in %s' % (versionFile, entriesFile)) -version = open(versionFile, 'w') -print >> version, '#define VERSION_STRING "dev-SVN-r%s"' % svnRevision -version.close() +UNKNOWN_REVISION = "UNKNOWN" +SVNDIR = '.svn' +SVN16FILE = 'entries' +SVN16FILE2 = 'all-wcprops' +SVN17FILE = 'wc.db' + +def find_svnDir(searchRoot): + # we need to find the .svn folder + # for subversion 1.7 and later, it only exists at the wc root and each externals root + candidates = [ + join(searchRoot, SVNDIR), # src + join(searchRoot, '..', SVNDIR), # sumo + join(searchRoot, '..', '..', SVNDIR)] # trunk + for d in candidates: + if isdir(d): + return d + return None + + +def find_svnFile(svnDir): + candidates = [ + join(svnDir, SVN17FILE), + join(svnDir, SVN16FILE2), + join(svnDir, SVN16FILE)] + for f in candidates: + if exists(f): + return f + return None + + +def parseRevision(svnFile): + if SVN17FILE in svnFile or SVN16FILE2 in svnFile: + # new style wc.db + svnRevision = -1 + for l in open(svnFile, 'rb'): + m = re.search('[!]svn[/]ver[/](\d*)', l) + if m: + try: + svnRevision = max(svnRevision, int(m.group(1))) + except ValueError: + pass + if svnRevision >= 0: + return svnRevision + else: + return UNKNOWN_REVISION + else: + # old style entries file + for i, l in enumerate(open(svnFile)): + if i == 3 and l.strip().isdigit(): + svnRevision = l.strip() + revIndex = l.find('revision="') + if revIndex >= 0: + revIndex += 10 + svnRevision = l[revIndex:l.index('"', revIndex)] + return svnRevision + return UNKNOWN_REVISION + + +def create_version_file(versionFile, svnRevision, svnFile): + print('generating %s from revision in %s' % (versionFile, svnFile)) + with open(versionFile, 'w') as f: + print >>f, '#define VERSION_STRING "dev-SVN-r%s"' % svnRevision + + +def main(): + sumoSrc = join(dirname(__file__), '..', '..', 'src') + # determine output file + if len(sys.argv) > 1: + versionDir = sys.argv[1] + else: + versionDir = sumoSrc + versionFile = join(versionDir, 'version.h') + + # determine svn dir + if len(sys.argv) > 2: + svnDir = sys.argv[2] + else: + svnDir = find_svnDir(sumoSrc) + if svnDir == None or not exists(svnDir): + print "unknown revision - svn dir '%s' not found" % svnDir + if not exists(versionFile): + create_version_file(versionFile, UNKNOWN_REVISION, "") + else: + # determine svn file + svnFile = find_svnFile(svnDir) + if svnFile == None: + print "unknown revision - no svn file found in %s" % svnDir + if not exists(versionFile): + create_version_file(versionFile, UNKNOWN_REVISION, "") + if not exists(versionFile) or getmtime(versionFile) < getmtime(svnFile): + # svnFile is newer. lets update the revision number + svnRevision = parseRevision(svnFile) + create_version_file(versionFile, svnRevision, svnFile) + + +if __name__ == "__main__": + main() diff -Nru sumo-0.15.0~dfsg/tools/contributed/Castellon/castellon.edg.xml sumo-0.16.0~dfsg/tools/contributed/Castellon/castellon.edg.xml --- sumo-0.15.0~dfsg/tools/contributed/Castellon/castellon.edg.xml 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/contributed/Castellon/castellon.edg.xml 2012-12-04 00:26:11.000000000 +0000 @@ -2,116 +2,116 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/tools/detector/aggregateFlows.py sumo-0.16.0~dfsg/tools/detector/aggregateFlows.py --- sumo-0.15.0~dfsg/tools/detector/aggregateFlows.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/detector/aggregateFlows.py 2012-12-04 00:26:11.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # This script aggregates flows as they come from the Datenverteiler # into files suitable for the dfrouter. # It takes as an optional argument a file listing the detectors of diff -Nru sumo-0.15.0~dfsg/tools/detector/deleteUnusedDetectors.py sumo-0.16.0~dfsg/tools/detector/deleteUnusedDetectors.py --- sumo-0.15.0~dfsg/tools/detector/deleteUnusedDetectors.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/detector/deleteUnusedDetectors.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,6 +4,7 @@ @author Laura Bieker @author Michael Behrisch @date 2010-03-03 +@version $Id: deleteUnusedDetectors.py 12590 2012-08-24 07:46:31Z dkrajzew $ This script reads a network as first parameter and a file with the positions of detectors as second parameter. As result the script writes a new file @@ -26,12 +27,12 @@ fd = open("detectors.xml", "w") fd.write("\n") for det in usedDet: - fd.write(" \n") diff -Nru sumo-0.15.0~dfsg/tools/detector/detector.py sumo-0.16.0~dfsg/tools/detector/detector.py --- sumo-0.15.0~dfsg/tools/detector/detector.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/detector/detector.py 2012-12-04 00:26:11.000000000 +0000 @@ -1,4 +1,16 @@ -#!/usr/bin/python +#!/usr/bin/env python +""" +@file detector.py +@author Michael Behrisch +@date 2007-06-28 +@version $Id: detector.py 12599 2012-08-27 11:15:34Z dkrajzew $ + + + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2007-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" import sys from xml.sax import make_parser, handler @@ -59,7 +71,7 @@ self._det2edge[id] = edge def startElement(self, name, attrs): - if name == 'detector_definition': + if name == 'detectorDefinition': self.addDetector(attrs['id'], float(attrs['pos']), self._laneMap.get(attrs['lane'], self._currentEdge)) elif name == 'group': diff -Nru sumo-0.15.0~dfsg/tools/detector/flowFromRoutes.py sumo-0.16.0~dfsg/tools/detector/flowFromRoutes.py --- sumo-0.15.0~dfsg/tools/detector/flowFromRoutes.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/detector/flowFromRoutes.py 2012-12-04 00:26:11.000000000 +0000 @@ -14,8 +14,6 @@ class DetectorRouteEmitterReader(handler.ContentHandler): def __init__(self, detFile): - self._routeID = '' - self._routeString = '' self._routes = {} self._detReader = detector.DetectorReader(detFile, LaneMap()) self._edgeFlow = {} @@ -29,30 +27,11 @@ def startElement(self, name, attrs): if name == 'route': - self._routeID = attrs['id'] - if name == 'trigger' or name == 'emitter': - self._parser.parse(attrs['file']) - if name == 'routedistelem': - if not options.dfrstyle: - flow = int(attrs['probability']) - for edge in self._routes[attrs['id']]: - self.addEdgeFlow(edge, flow) - if name == 'emit': - if options.dfrstyle: - for det in self._route2dets[attrs['route']]: - self.addEdgeFlow(edge, 1) - - def characters(self, content): - if self._routeID != '': - self._routeString += content - - def endElement(self, name): - if name == 'route': - self._routes[self._routeID] = self._routeString.split() - if not options.respectsink: - self._routes[self._routeID].pop() - self._routeID = '' - self._routeString = '' + if 'id' in attrs: + self._routes[attrs['id']] = attrs['edges'].split() + if name == 'vehicle': + for edge in self._routes[attrs['route']]: + self.addEdgeFlow(edge, 1) def readDetFlows(self, flowFile): self._detReader.readFlows(flowFile) @@ -119,8 +98,6 @@ help="read detector flows to compare to from FILE", metavar="FILE") optParser.add_option("-z", "--respect-zero", action="store_true", dest="respectzero", default=False, help="respect detectors without data (or with permanent zero) with zero flow") -optParser.add_option("-s", "--respect-sinks", action="store_true", dest="respectsink", - default=False, help="respect last edge of the route (although a SUMO car probably will not use it)") optParser.add_option("-D", "--dfrouter-style", action="store_true", dest="dfrstyle", default=False, help="emitter files in dfrouter style (explicit routes)") optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", diff -Nru sumo-0.15.0~dfsg/tools/detector/flowrouter.py sumo-0.16.0~dfsg/tools/detector/flowrouter.py --- sumo-0.15.0~dfsg/tools/detector/flowrouter.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/detector/flowrouter.py 2012-12-04 00:26:11.000000000 +0000 @@ -56,7 +56,6 @@ self.kind = kind self.maxSpeed = 0.0 self.length = 0.0 - self.finalizer = None self.detGroup = [] self.routes = [] @@ -343,8 +342,6 @@ def writeRoutes(self, routeFileName): routeOut = open(routeFileName, 'w') - unfinalizedEdges = set() - unfinalizedRoutes = set() print >> routeOut, "" for edge in self._source.outEdges: for id, route in enumerate(edge.routes): @@ -353,22 +350,16 @@ routeString = '' for redge in route.edges: if redge.kind == "real": - routeString += redge.label + " " + if options.lanebased: + routeString += redge.label[:redge.label.rfind("_")] + " " + else: + routeString += redge.label + " " if firstReal == '': firstReal = redge.label lastReal = redge assert firstReal != '' and lastReal != None routeID = "%s.%s" % (firstReal, id) - if lastReal.finalizer: - routeString += lastReal.finalizer - else: - routeString = routeString.strip() - unfinalizedEdges.add(lastReal.label) - unfinalizedRoutes.add(routeID) - print >> routeOut, ' %s' % (routeID, routeString) - if len(unfinalizedRoutes) > 0: - warn("Warning! No finalizers for %s." % unfinalizedEdges) - warn("The routes %s will be one edge too short." % unfinalizedRoutes) + print >> routeOut, ' ' % (routeID, routeString.strip()) print >> routeOut, "" routeOut.close() @@ -379,20 +370,14 @@ if len(srcEdge.routes) == 0: continue assert len(srcEdge.target.outEdges) == 1 - for edge in srcEdge.target.outEdges: pass - srcFile = "src_" + edge.label + ".def.xml" - print >> emitOut, ' > emitOut, 'pos="0"', - print >> emitOut, 'friendly_pos="x" objectid="' + edge.label + '_0"', - print >> emitOut, 'file="' + srcFile + '"/>' - srcOut = open(srcFile, 'w') - print >> srcOut, "" + edge = iter(srcEdge.target.outEdges).next() + print >> emitOut, ' ' for id, route in enumerate(srcEdge.routes): - print >> srcOut, ' > srcOut, 'probability="%s"/>' % route.frequency - print >> srcOut, ' ' % srcEdge.flow - print >> srcOut, "" - srcOut.close() + print >> emitOut, ' > emitOut, 'probability="%s"/>' % route.frequency + print >> emitOut, ' ' + print >> emitOut, ' > emitOut, 'route="dist_%s" number="%s" begin="0"/>' % (edge.label, srcEdge.flow) print >> emitOut, "" emitOut.close() @@ -433,22 +418,25 @@ def startElement(self, name, attrs): if name == 'edge' and (not attrs.has_key('function') or attrs['function'] != 'internal'): - self._net.addIsolatedRealEdge(attrs['id']) - elif name == 'succ': - self._edge = attrs['edge'] - if self._edge[0]==':': - self._edge = '' - elif name == 'succlane' and self._edge != '': - fromEdge = self._net.getEdge(self._edge) - l = attrs['lane'] - toEdge = self._net.getEdge(l[:l.rfind('_')]) - newEdge = Edge(self._edge+"_"+attrs['id'], fromEdge.target, toEdge.source) + self._edge = attrs['id'] + if not options.lanebased: + self._net.addIsolatedRealEdge(attrs['id']) + elif name == 'connection': + fromEdgeID = attrs['from'] + toEdgeID = attrs['to'] + if options.lanebased: + fromEdgeID += "_" + attrs["fromLane"] + toEdgeID += "_" + attrs["toLane"] + newEdge = Edge(fromEdgeID+"_"+toEdgeID, self._net.getEdge(fromEdgeID).target, + self._net.getEdge(toEdgeID).source) self._net.addEdge(newEdge) - fromEdge.finalizer = attrs['id'] elif name == 'lane' and self._edge != '': + if options.lanebased: + self._net.addIsolatedRealEdge(attrs['id']) + self._edge = attrs['id'] self._lane2edge[attrs['id']] = self._edge edgeObj = self._net.getEdge(self._edge) - edgeObj.maxSpeed = max(edgeObj.maxSpeed, float(attrs['maxspeed'])) + edgeObj.maxSpeed = max(edgeObj.maxSpeed, float(attrs['speed'])) edgeObj.length = float(attrs['length']) def endElement(self, name): @@ -461,7 +449,7 @@ for group in detGroups: if group.isValid: self._net.getEdge(edge).detGroup.append(group) - + def readFlows(self, flowFile): self._detReader.readFlows(flowFile) @@ -503,6 +491,8 @@ default=False, help='keep edges with detectors when deleting "slow" edges') optParser.add_option("-z", "--respect-zero", action="store_true", dest="respectzero", default=False, help="respect detectors without data (or with permanent zero) with zero flow") +optParser.add_option("-l", "--lane-based", action="store_true", dest="lanebased", + default=False, help="do not aggregate detector data and connections to edges") optParser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False, help="suppress warnings") optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", @@ -536,7 +526,7 @@ if options.routefile: net.writeRoutes(options.routefile) else: - for edge in net._source.outEdges: + for edge in sorted(net._source.outEdges, key=lambda e: e.label): for route in edge.routes: print route if options.emitfile: diff -Nru sumo-0.15.0~dfsg/tools/district/countConnectionsInDistricts.py sumo-0.16.0~dfsg/tools/district/countConnectionsInDistricts.py --- sumo-0.15.0~dfsg/tools/district/countConnectionsInDistricts.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/district/countConnectionsInDistricts.py 2012-12-04 00:26:11.000000000 +0000 @@ -1,38 +1,50 @@ +#!/usr/bin/env python +""" +@file countConnectionsInDistricts.py +@author Daniel Krajzewicz +@date 2007-07-26 +@version $Id: countConnectionsInDistricts.py 12567 2012-08-20 10:01:44Z dkrajzew $ + + + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2007-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" from xml.sax import saxutils, make_parser, handler from optparse import OptionParser import math - # written into the net. All members are "private". class NetDistrictConnectionCountingHandler(handler.ContentHandler): - def __init__(self): - self._currentID = "" - self._districtSinkNo = {} - self._districtSourceNo = {} - - def startElement(self, name, attrs): - if name == 'district': - self._currentID = attrs['id'] - elif name == 'dsink': - if self._currentID in self._districtSinkNo: - self._districtSinkNo[self._currentID] = self._districtSinkNo[self._currentID] + 1 - else: - self._districtSinkNo[self._currentID] = 1 - elif name == 'dsource': - if self._currentID in self._districtSinkNo: - self._districtSourceNo[self._currentID] = self._districtSourceNo[self._currentID] + 1 - else: - self._districtSourceNo[self._currentID] = 1 - - - def writeResults(self, output): - fd = open(output, "w") - for district in self._districtSourceNo: - fd.write(district + ";" + str(self._districtSourceNo[district ]) + ";" + str(self._districtSinkNo[district ]) + "\n") - fd.close() - - + def __init__(self): + self._currentID = "" + self._districtSinkNo = {} + self._districtSourceNo = {} + + def startElement(self, name, attrs): + if name == 'taz': + self._currentID = attrs['id'] + elif name == 'tazSink': + if self._currentID in self._districtSinkNo: + self._districtSinkNo[self._currentID] = self._districtSinkNo[self._currentID] + 1 + else: + self._districtSinkNo[self._currentID] = 1 + elif name == 'tazSource': + if self._currentID in self._districtSinkNo: + self._districtSourceNo[self._currentID] = self._districtSourceNo[self._currentID] + 1 + else: + self._districtSourceNo[self._currentID] = 1 + + + def writeResults(self, output): + fd = open(output, "w") + for district in self._districtSourceNo: + fd.write(district + ";" + str(self._districtSourceNo[district ]) + ";" + str(self._districtSinkNo[district ]) + "\n") + fd.close() + + optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", @@ -47,7 +59,7 @@ reader = NetDistrictConnectionCountingHandler() parser.setContentHandler(reader) if options.verbose: - print "Reading net '" + options.netfile + "'" + print "Reading net '" + options.netfile + "'" parser.parse(options.netfile) reader.writeResults(options.output) diff -Nru sumo-0.15.0~dfsg/tools/district/districtMapper.py sumo-0.16.0~dfsg/tools/district/districtMapper.py --- sumo-0.15.0~dfsg/tools/district/districtMapper.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/district/districtMapper.py 2012-12-04 00:26:11.000000000 +0000 @@ -1,100 +1,113 @@ +#!/usr/bin/env python +""" +@file districtMapper.py +@author Daniel Krajzewicz +@date 2007-07-26 +@version $Id: districtMapper.py 12567 2012-08-20 10:01:44Z dkrajzew $ + + + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2007-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" from xml.sax import saxutils, make_parser, handler from optparse import OptionParser import math def parseShape(shape): - poses = shape.split() - ret = [] - for pos in poses: - xy = pos.split(",") - ret.append((float(xy[0]), float(xy[1]))) - return ret + poses = shape.split() + ret = [] + for pos in poses: + xy = pos.split(",") + ret.append((float(xy[0]), float(xy[1]))) + return ret # All members are "private". class JunctionPositionsReader(handler.ContentHandler): - def __init__(self): - self._xPos = {} - self._yPos = {} - - def startElement(self, name, attrs): - if name == 'junction': - self._xPos[attrs['id']] = float(attrs['x']) - self._yPos[attrs['id']] = float(attrs['y']) - - def getJunctionXPoses(self, junctions1): - ret = [] - for junction in junctions1: - ret.append(self._xPos[junction]) - return ret - - def getJunctionYPoses(self, junctions1): - ret = [] - for junction in junctions1: - ret.append(self._yPos[junction]) - return ret + def __init__(self): + self._xPos = {} + self._yPos = {} + + def startElement(self, name, attrs): + if name == 'junction': + self._xPos[attrs['id']] = float(attrs['x']) + self._yPos[attrs['id']] = float(attrs['y']) + + def getJunctionXPoses(self, junctions1): + ret = [] + for junction in junctions1: + ret.append(self._xPos[junction]) + return ret + + def getJunctionYPoses(self, junctions1): + ret = [] + for junction in junctions1: + ret.append(self._yPos[junction]) + return ret # All members are "private". class DistrictMapper(handler.ContentHandler): - def __init__(self): - self._haveDistrict = False - self._parsingDistrictShape = False - self._districtShapes = {} - self._currentID = "" - self._shape = "" - - def startElement(self, name, attrs): - if name == 'district': - self._haveDistrict = True - self._currentID = attrs['id'] - elif name == 'shape' and self._haveDistrict: - self._parsingDistrictShape = True - - def characters(self, content): - if self._parsingDistrictShape: - self._shape += content - - def endElement(self, name): - if name == 'district': - self._haveDistrict = False - elif name == 'shape' and self._haveDistrict: - self._parsingDistrictShape = False - if self._shape!='': - self._districtShapes[self._currentID] = parseShape(self._shape) - self._shape = "" - - def convertShapes(self, xoff1, xoff2, xscale, yoff1, yoff2, yscale): - for district in self._districtShapes: - shape = self._districtShapes[district] - nshape = [] - for i in range(0, len(shape)): - nx = ((shape[i][0]-xoff1) * xscale + xoff2) - ny = ((shape[i][1]-yoff1) * yscale + yoff2) - nshape.append((nx, ny)) - self._districtShapes[district] = nshape - - def writeResults(self, output, color): - fd = open(output, "w") - fd.write("\n") - for district in self._districtShapes: - shape = self._districtShapes[district] - shapeStr = "" - for i in range(0, len(shape)): - if i!=0: - shapeStr = shapeStr + " " - shapeStr = shapeStr + str(shape[i][0]) + "," + str(shape[i][1]) - fd.write(" \n") - fd.write(" " + shapeStr + "\n") - fd.write(" \n") - fd.write(" " + shapeStr + "\n") - fd.write("\n") - fd.close() + def __init__(self): + self._haveDistrict = False + self._parsingDistrictShape = False + self._districtShapes = {} + self._currentID = "" + self._shape = "" + + def startElement(self, name, attrs): + if name == 'taz': + self._haveDistrict = True + self._currentID = attrs['id'] + elif name == 'shape' and self._haveDistrict: + self._parsingDistrictShape = True + + def characters(self, content): + if self._parsingDistrictShape: + self._shape += content + + def endElement(self, name): + if name == 'taz': + self._haveDistrict = False + elif name == 'shape' and self._haveDistrict: + self._parsingDistrictShape = False + if self._shape!='': + self._districtShapes[self._currentID] = parseShape(self._shape) + self._shape = "" + + def convertShapes(self, xoff1, xoff2, xscale, yoff1, yoff2, yscale): + for district in self._districtShapes: + shape = self._districtShapes[district] + nshape = [] + for i in range(0, len(shape)): + nx = ((shape[i][0]-xoff1) * xscale + xoff2) + ny = ((shape[i][1]-yoff1) * yscale + yoff2) + nshape.append((nx, ny)) + self._districtShapes[district] = nshape + + def writeResults(self, output, color): + fd = open(output, "w") + fd.write("\n") + for district in self._districtShapes: + shape = self._districtShapes[district] + shapeStr = "" + for i in range(0, len(shape)): + if i!=0: + shapeStr = shapeStr + " " + shapeStr = shapeStr + str(shape[i][0]) + "," + str(shape[i][1]) + fd.write(" \n") + fd.write(" " + shapeStr + "\n") + fd.write(" \n") + fd.write(" " + shapeStr + "\n") + fd.write("\n") + fd.close() - + optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", @@ -115,12 +128,12 @@ parser = make_parser() if options.verbose: - print "Reading net#1" + print "Reading net#1" reader1 = JunctionPositionsReader() parser.setContentHandler(reader1) parser.parse(options.netfile1) if options.verbose: - print "Reading net#2" + print "Reading net#2" reader2 = JunctionPositionsReader() parser.setContentHandler(reader2) parser.parse(options.netfile2) diff -Nru sumo-0.15.0~dfsg/tools/district/edgesInDistricts.py sumo-0.16.0~dfsg/tools/district/edgesInDistricts.py --- sumo-0.15.0~dfsg/tools/district/edgesInDistricts.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/district/edgesInDistricts.py 2012-12-04 00:26:11.000000000 +0000 @@ -1,15 +1,28 @@ +#!/usr/bin/env python +""" +@file edgesInDistricts.py +@author Daniel Krajzewicz +@date 2007-07-26 +@version $Id: edgesInDistricts.py 12595 2012-08-24 14:07:33Z dkrajzew $ + + + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2007-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" from xml.sax import saxutils, make_parser, handler from optparse import OptionParser import math def parseShape(shape): - poses = shape.split() - ret = [] - for pos in poses: - xy = pos.split(",") - ret.append((float(xy[0]), float(xy[1]))) - return ret + poses = shape.split() + ret = [] + for pos in poses: + xy = pos.split(",") + ret.append((float(xy[0]), float(xy[1]))) + return ret def angle2D(p1, p2): @@ -21,122 +34,122 @@ while dtheta < -3.1415926535897932384626433832795: dtheta += 2.0*3.1415926535897932384626433832795 return dtheta - + def isWithin(pos, shape): - angle = 0. - for i in range(0, len(shape)-1): - p1 = ( (shape[i][0] - pos[0]), (shape[i][1] - pos[1]) ) - p2 = ( (shape[i+1][0] - pos[0]), (shape[i+1][1] - pos[1]) ) - angle = angle + angle2D(p1, p2) - i = len(shape)-1 - p1 = ( (shape[i][0] - pos[0]), (shape[i][1] - pos[1]) ) - p2 = ( (shape[0][0] - pos[0]), (shape[0][1] - pos[1]) ) - angle = angle + angle2D(p1, p2) - return math.fabs(angle)>=3.1415926535897932384626433832795 + angle = 0. + for i in range(0, len(shape)-1): + p1 = ( (shape[i][0] - pos[0]), (shape[i][1] - pos[1]) ) + p2 = ( (shape[i+1][0] - pos[0]), (shape[i+1][1] - pos[1]) ) + angle = angle + angle2D(p1, p2) + i = len(shape)-1 + p1 = ( (shape[i][0] - pos[0]), (shape[i][1] - pos[1]) ) + p2 = ( (shape[0][0] - pos[0]), (shape[0][1] - pos[1]) ) + angle = angle + angle2D(p1, p2) + return math.fabs(angle)>=3.1415926535897932384626433832795 # written into the net. All members are "private". class NetDistrictEdgeHandler(handler.ContentHandler): - def __init__(self): - self._haveDistrict = False - self._parsingDistrictShape = False - self._parsingLaneShape = False - self._currentID = "" - self._shape = "" - self._districtShapes = {} - self._laneShapes = {} - self._districtLanes = {} - self._laneDisttricts = {} - self._invalidatedLanes = [] - self._laneSpeeds = {} - self._laneLengths = {} - self._noLanes = {} - - def startElement(self, name, attrs): - if name == 'district': - self._haveDistrict = True - self._currentID = attrs['id'] - self._districtLanes[self._currentID] = [] - elif name == 'shape' and self._haveDistrict: - self._parsingDistrictShape = True - elif name == 'lane': - self._currentID = attrs['id'] - self._parsingLaneShape = True - self._laneDisttricts[self._currentID] = [] - self._laneSpeeds[self._currentID] = float(attrs['maxspeed']) - self._laneLengths[self._currentID] = float(attrs['length']) - edgeid = self._currentID - edgeid = edgeid[:edgeid.rfind("_")] - if edgeid in self._noLanes: - self._noLanes[edgeid] = self._noLanes[edgeid] + 1 - else: - self._noLanes[edgeid] = 1 - - def characters(self, content): - if self._parsingDistrictShape: - self._shape += content - if self._parsingLaneShape: - self._shape += content - - def endElement(self, name): - if name == 'district': - self._haveDistrict = False - elif name == 'shape' and self._haveDistrict: - self._parsingDistrictShape = False - if self._shape!='': - self._districtShapes[self._currentID] = parseShape(self._shape) - self._shape = "" - elif name == 'lane': - self._parsingLaneShape = False - if self._shape!='': - self._laneShapes[self._currentID] = parseShape(self._shape) - self._shape = "" - - def computeWithin(self, complete): - for lane in self._laneShapes: - lshape = self._laneShapes[lane] - for district in self._districtShapes: - dshape = self._districtShapes[district] - found = False - for pos in lshape: - if not found and isWithin(pos, dshape): - found = True - self._districtLanes[district].append(lane) - self._laneDisttricts[lane].append(district) - if complete: - for lane in self._laneDisttricts: - if len(self._laneDisttricts[lane])>1: - self._invalidatedLanes.append(lane) - - def writeResults(self, output, maxspeed, weighted): - fd = open(output, "w") - fd.write("\n") - for district in self._districtLanes: - lanes = 0 - for lane in self._districtLanes[district]: - if lane not in self._invalidatedLanes and self._laneSpeeds[lane]\n") - for lane in self._districtLanes[district]: - edgeid = lane - edgeid = edgeid[:edgeid.rfind("_")] - if edgeid not in edges and lane not in self._invalidatedLanes and self._laneSpeeds[lane]\n") - fd.write(" \n") - edges[edgeid] = 1 - fd.write(" \n") - fd.write("\n") - fd.close() - - + def __init__(self): + self._haveDistrict = False + self._parsingDistrictShape = False + self._parsingLaneShape = False + self._currentID = "" + self._shape = "" + self._districtShapes = {} + self._laneShapes = {} + self._districtLanes = {} + self._laneDisttricts = {} + self._invalidatedLanes = [] + self._laneSpeeds = {} + self._laneLengths = {} + self._noLanes = {} + + def startElement(self, name, attrs): + if name == 'taz': + self._haveDistrict = True + self._currentID = attrs['id'] + self._districtLanes[self._currentID] = [] + elif name == 'shape' and self._haveDistrict: + self._parsingDistrictShape = True + elif name == 'lane': + self._currentID = attrs['id'] + self._parsingLaneShape = True + self._laneDisttricts[self._currentID] = [] + self._laneSpeeds[self._currentID] = float(attrs['speed']) + self._laneLengths[self._currentID] = float(attrs['length']) + edgeid = self._currentID + edgeid = edgeid[:edgeid.rfind("_")] + if edgeid in self._noLanes: + self._noLanes[edgeid] = self._noLanes[edgeid] + 1 + else: + self._noLanes[edgeid] = 1 + + def characters(self, content): + if self._parsingDistrictShape: + self._shape += content + if self._parsingLaneShape: + self._shape += content + + def endElement(self, name): + if name == 'district': + self._haveDistrict = False + elif name == 'shape' and self._haveDistrict: + self._parsingDistrictShape = False + if self._shape!='': + self._districtShapes[self._currentID] = parseShape(self._shape) + self._shape = "" + elif name == 'lane': + self._parsingLaneShape = False + if self._shape!='': + self._laneShapes[self._currentID] = parseShape(self._shape) + self._shape = "" + + def computeWithin(self, complete): + for lane in self._laneShapes: + lshape = self._laneShapes[lane] + for district in self._districtShapes: + dshape = self._districtShapes[district] + found = False + for pos in lshape: + if not found and isWithin(pos, dshape): + found = True + self._districtLanes[district].append(lane) + self._laneDisttricts[lane].append(district) + if complete: + for lane in self._laneDisttricts: + if len(self._laneDisttricts[lane])>1: + self._invalidatedLanes.append(lane) + + def writeResults(self, output, maxspeed, weighted): + fd = open(output, "w") + fd.write("\n") + for district in self._districtLanes: + lanes = 0 + for lane in self._districtLanes[district]: + if lane not in self._invalidatedLanes and self._laneSpeeds[lane]\n") + for lane in self._districtLanes[district]: + edgeid = lane + edgeid = edgeid[:edgeid.rfind("_")] + if edgeid not in edges and lane not in self._invalidatedLanes and self._laneSpeeds[lane]\n") + fd.write(" \n") + edges[edgeid] = 1 + fd.write(" \n") + fd.write("\n") + fd.close() + + optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", @@ -157,13 +170,12 @@ reader = NetDistrictEdgeHandler() parser.setContentHandler(reader) for netfile in options.netfiles.split(","): - if options.verbose: - print "Reading net '" + netfile + "'" - parser.parse(netfile) + if options.verbose: + print "Reading net '" + netfile + "'" + parser.parse(netfile) if options.verbose: - print "Calculating" + print "Calculating" reader.computeWithin(options.complete) if options.verbose: - print "Writing results" + print "Writing results" reader.writeResults(options.output, options.maxspeed, options.weighted) - diff -Nru sumo-0.15.0~dfsg/tools/game/cross/cross.edg.xml sumo-0.16.0~dfsg/tools/game/cross/cross.edg.xml --- sumo-0.15.0~dfsg/tools/game/cross/cross.edg.xml 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/game/cross/cross.edg.xml 2012-12-04 00:26:11.000000000 +0000 @@ -1,22 +1,22 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + diff -Nru sumo-0.15.0~dfsg/tools/game/cross/cross.tls_opt.add.xml sumo-0.16.0~dfsg/tools/game/cross/cross.tls_opt.add.xml --- sumo-0.15.0~dfsg/tools/game/cross/cross.tls_opt.add.xml 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/game/cross/cross.tls_opt.add.xml 2012-12-04 00:26:11.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.15.0~dfsg/tools/game/input_additional.add.xml sumo-0.16.0~dfsg/tools/game/input_additional.add.xml --- sumo-0.15.0~dfsg/tools/game/input_additional.add.xml 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/game/input_additional.add.xml 2012-12-04 00:26:11.000000000 +0000 @@ -1,5 +1,5 @@ - - - + + + diff -Nru sumo-0.15.0~dfsg/tools/game/runner.py sumo-0.16.0~dfsg/tools/game/runner.py --- sumo-0.15.0~dfsg/tools/game/runner.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/game/runner.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Michael Behrisch @author Jakob Erdmann @date 2010-01-30 -@version $Id: runner.py 11786 2012-01-25 09:26:08Z namdre $ +@version $Id: runner.py 12275 2012-04-27 08:33:25Z namdre $ This script runs the gaming GUI for the LNdW traffic light game. It checks for possible scenarios in the current working directory @@ -60,7 +60,7 @@ self.name = '' # setup gui self.root = Tkinter.Tk() - self.root.title("Traffic Light Game") + self.root.title("Interactive Traffic Light") self.root.minsize(250, 50) # we use a grid layout with 4 columns COL_DLRLOGO, COL_START, COL_HIGH, COL_SUMOLOGO = range(4) diff -Nru sumo-0.15.0~dfsg/tools/import/vissim/vissim_parseBusStops.py sumo-0.16.0~dfsg/tools/import/vissim/vissim_parseBusStops.py --- sumo-0.15.0~dfsg/tools/import/vissim/vissim_parseBusStops.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/import/vissim/vissim_parseBusStops.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file vissim_parseBusStops.py @author Daniel Krajzewicz @date 2009-05-27 -@version $Id: vissim_parseBusStops.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: vissim_parseBusStops.py 12720 2012-09-14 22:05:49Z behrisch $ Parses bus stops and bus routes given in the Vissim file (first parameter). @@ -78,7 +78,7 @@ stops.insert(0, int(vals[i])) except: i = len(vals) + 1 - return (id, name, startKante, ziel, zeiten, stops) + return (id, name, startKante, ziel, zeiten, stops) def sorter(idx): def t(i, j): @@ -179,5 +179,3 @@ fdo.write("\n") fdo.close() - - diff -Nru sumo-0.15.0~dfsg/tools/import/visum/visum_convertEdgeTypes.py sumo-0.16.0~dfsg/tools/import/visum/visum_convertEdgeTypes.py --- sumo-0.15.0~dfsg/tools/import/visum/visum_convertEdgeTypes.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/import/visum/visum_convertEdgeTypes.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2009-05-27 -@version $Id: visum_convertEdgeTypes.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: visum_convertEdgeTypes.py 12599 2012-08-27 11:15:34Z dkrajzew $ This script converts edge type definitions (STRECKENTYP) into their @@ -37,7 +37,7 @@ map[attributes[i]] = values[i] fdo.write(' \n') diff -Nru sumo-0.15.0~dfsg/tools/import/visum/visum_convertTurnPercentages.py sumo-0.16.0~dfsg/tools/import/visum/visum_convertTurnPercentages.py --- sumo-0.15.0~dfsg/tools/import/visum/visum_convertTurnPercentages.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/import/visum/visum_convertTurnPercentages.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2009-06-12 -@version $Id: visum_convertTurnPercentages.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: visum_convertTurnPercentages.py 12599 2012-08-27 11:15:34Z dkrajzew $ Converts VISUM turning percentages into @@ -96,10 +96,10 @@ # write as read by jtrrouter print "Writing jtrrouter turning percentages..." fd = open(sys.argv[3], "w") -fd.write('\n') +fd.write('\n') fd.write(' \n') for i in emap: - fd.write(' \n') + fd.write(' \n') sum = 0 for o in emap[i]: sum = sum + emap[i][o] @@ -108,8 +108,8 @@ no = emap[i][o]/sum else: no = 0 - fd.write(' \n') - fd.write(' \n') + fd.write(' \n') + fd.write(' \n') fd.write(' \n') -fd.write('\n') +fd.write('\n') diff -Nru sumo-0.15.0~dfsg/tools/net/netcheck.py sumo-0.16.0~dfsg/tools/net/netcheck.py --- sumo-0.15.0~dfsg/tools/net/netcheck.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/net/netcheck.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Daniel Krajzewicz @author Laura Bieker @date 2007-03-20 -@version $Id: netcheck.py 11825 2012-02-02 07:46:23Z namdre $ +@version $Id: netcheck.py 12371 2012-06-07 20:27:10Z behrisch $ This script does simple check for the network. It tests whether the network is (weakly) connected. @@ -94,7 +94,7 @@ components = getWeaklyConnected(net) if len(components) != 1: print "Warning! Net is not connected." - for idx, comp in enumerate(components): + for idx, comp in enumerate(sorted(components, key=lambda c: iter(c).next())): print "Component", idx print " ".join(comp) print diff -Nru sumo-0.15.0~dfsg/tools/net/netdiff.py sumo-0.16.0~dfsg/tools/net/netdiff.py --- sumo-0.15.0~dfsg/tools/net/netdiff.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/net/netdiff.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file netdiff.py @author Jakob Erdmann @date 2011-10-04 -@version $Id: netdiff.py 11558 2011-11-28 12:06:41Z namdre $ +@version $Id: netdiff.py 12133 2012-03-19 13:20:44Z namdre $ Reads two networks (source, dest) and tries to produce the minimal plain-xml input which can be loaded with netconvert alongside source to create dest @@ -54,13 +54,10 @@ TAG_CONNECTION = 'connection' # see CAVEAT1 -def get_id_attrs(tag): - if tag == TAG_TLL: - return ('id', 'programID') - elif tag == TAG_CONNECTION: - return ('from', 'to', 'fromLane', 'toLane') - else: - return ('id',) +IDATTRS = defaultdict(lambda: ('id',)) +IDATTRS[TAG_TLL] = ('id', 'programID') +IDATTRS[TAG_CONNECTION] = ('from', 'to', 'fromLane', 'toLane') +IDATTRS['interval'] = ('begin', 'end') DELETE_ELEMENT = 'delete' # the xml element for signifying deletes @@ -74,6 +71,7 @@ # default values for the given attribute (needed when attributes appear in source but do not appear in dest) DEFAULT_VALUES = defaultdict(lambda: "") DEFAULT_VALUES['width'] = "-1" +DEFAULT_VALUES['offset'] = "0" RESET = 0 @@ -90,7 +88,7 @@ # sets of (tag, id) preserve order to avoid dangling references during loading self.ids_deleted = OrderedMultiSet() self.ids_created = OrderedMultiSet() - # dict from (tag, id) to (names, values) + # dict from (tag, id) to (names, values, children) self.id_attrs = {} # dict from tag to (names, values)-sets, need to preserve order (CAVEAT5) self.idless_deleted = defaultdict(lambda:OrderedMultiSet()) @@ -106,7 +104,7 @@ def getNames(self, xmlnode): - idattrs = get_id_attrs(xmlnode.localName) + idattrs = IDATTRS[xmlnode.localName] a = xmlnode.attributes all = [a.item(i).localName for i in range(a.length)] instance = tuple([n for n in all if n not in idattrs]) @@ -123,7 +121,7 @@ if any([c.nodeType == Node.ELEMENT_NODE for c in xmlnode.childNodes]): children = AttributeStore(self.type, self.level + 1) tag = xmlnode.localName - id = tuple([xmlnode.getAttribute(a) for a in get_id_attrs(tag) if xmlnode.hasAttribute(a)]) + id = tuple([xmlnode.getAttribute(a) for a in IDATTRS[tag] if xmlnode.hasAttribute(a)]) return tag, id, children, (names, values, children) @@ -182,7 +180,7 @@ def no_children_supported(self, children, tag): if children: - print("WARNING: Handling of children only supported for elements without id. Ignored for element '%s'" % tag) + print("WARNING: Handling of children only supported for elements with id. Ignored for element '%s'" % tag) def compareAttrs(self, sourceAttrs, destAttrs, tag): @@ -283,7 +281,7 @@ return ' '.join(['%s="%s"' % (n,v) for n,v in zip(names, values) if v != None]) def id_string(self, tag, id): - idattrs = get_id_attrs(tag) + idattrs = IDATTRS[tag] return ' '.join(['%s="%s"' % (n,v) for n,v in zip(idattrs, id)]) @@ -294,11 +292,15 @@ default=False, help="Give more output") optParser.add_option("-p", "--use-prefix", action="store_true", default=False, help="interpret source and dest as plain-xml prefix instead of network names") + optParser.add_option("-d", "--direct", action="store_true", + default=False, help="compare source and dest files directly") optParser.add_option("--path", dest="path", default=os.environ.get("SUMO_BINDIR", ""), help="Path to binaries") options, args = optParser.parse_args() if len(args) != 3: sys.exit(USAGE) + if options.use_prefix and options.direct: + optParser.error("Options --use-prefix and --direct are mutually exclusive") options.source, options.dest, options.outprefix = args return options @@ -370,15 +372,22 @@ # run def main(): options = parse_args() - if not options.use_prefix: - netconvert = checkBinary("netconvert", options.path) - options.source = create_plain(options.source, netconvert) - options.dest = create_plain(options.dest, netconvert) - for type in PLAIN_TYPES: - xmldiff(options.source + type, - options.dest + type, + if options.direct: + type = '.xml' + xmldiff(options.source, + options.dest, options.outprefix + type, type) + else: + if not options.use_prefix: + netconvert = checkBinary("netconvert", options.path) + options.source = create_plain(options.source, netconvert) + options.dest = create_plain(options.dest, netconvert) + for type in PLAIN_TYPES: + xmldiff(options.source + type, + options.dest + type, + options.outprefix + type, + type) if __name__ == "__main__": main() diff -Nru sumo-0.15.0~dfsg/tools/net/netextract_subPart.py sumo-0.16.0~dfsg/tools/net/netextract_subPart.py --- sumo-0.15.0~dfsg/tools/net/netextract_subPart.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/net/netextract_subPart.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-02-21 -@version $Id: netextract_subPart.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: netextract_subPart.py 12599 2012-08-27 11:15:34Z dkrajzew $ This script reads in the network given as first parameter. @@ -36,11 +36,11 @@ fd = open(file, "w") fd.write("\n") for edge in net._edges: - fd.write(" =0: id = getAttr(line, "id") if id in lanes: - indexB = line.find("nolanes") + indexB = line.find("numLanes") indexB = line.find('"', indexB)+1 indexE = line.find('"', indexB) line = line[:indexB] + str(lanes[id]) + line[indexE:] diff -Nru sumo-0.15.0~dfsg/tools/net/visum_mapDistricts.py sumo-0.16.0~dfsg/tools/net/visum_mapDistricts.py --- sumo-0.15.0~dfsg/tools/net/visum_mapDistricts.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/net/visum_mapDistricts.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: visum_mapDistricts.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: visum_mapDistricts.py 12599 2012-08-27 11:15:34Z dkrajzew $ This script reads a network and a dump file and @@ -422,15 +422,15 @@ runningInLaneNumber = runningInLaneNumber + 1 fd = open("districts.xml", "w") -fd.write("\n") +fd.write("\n") for d in newDistricts: - fd.write(' \n') + fd.write(' \n') if d in districtSources: - fd.write(' \n') + fd.write(' \n') if d in districtSinks: - fd.write(' \n') - fd.write(' \n') -fd.write("\n") + fd.write(' \n') + fd.write(' \n') +fd.write("\n") fd.close() @@ -438,12 +438,12 @@ fd.write(" \n") def writeEdge(fd, edge, withGeom=True): - fd.write(" >f, ' '.join(map(str,[step, waitingStepCounts[step], collisionStepCounts[step]])) + +if __name__ == "__main__": + main(*sys.argv[1:]) diff -Nru sumo-0.15.0~dfsg/tools/output/generateTLSE3Detectors.py sumo-0.16.0~dfsg/tools/output/generateTLSE3Detectors.py --- sumo-0.15.0~dfsg/tools/output/generateTLSE3Detectors.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/output/generateTLSE3Detectors.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ @author Karol Stosiek @author Michael Behrisch @date 2007-10-25 -@version $Id: generateTLSE3Detectors.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: generateTLSE3Detectors.py 13082 2012-11-29 13:49:22Z dkrajzew $ SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2009-2012 DLR (http://www.dlr.de/) and contributors @@ -87,7 +87,7 @@ detectors_xml = xml.dom.minidom.Element("additional") generated_detectors = 0 for tls in network._tlss: - for edge in sorted(tls.getEdges(), key=sumolib.net.Edge.getID): + for edge in sorted(tls.getEdges(), key=sumolib.net.edge.Edge.getID): detector_xml = xml.dom.minidom.Element("e3Detector") detector_xml.setAttribute("id", "e3_" + str(tls._id) + "_" + str(edge._id)) detector_xml.setAttribute("freq", str(options.frequency)) diff -Nru sumo-0.15.0~dfsg/tools/projects/TLS-Evaluationsszenarien/changeNet.py sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/changeNet.py --- sumo-0.15.0~dfsg/tools/projects/TLS-Evaluationsszenarien/changeNet.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/changeNet.py 2012-12-04 00:26:11.000000000 +0000 @@ -5,7 +5,7 @@ tree = dom.parse(file) net = tree.getElementsByTagName('net')[0] - tlLogic = net.getElementsByTagName('tl-logic')[0] + tlLogic = net.getElementsByTagName('tlLogic')[0] phases = tlLogic.getElementsByTagName('phase') phases[0].setAttribute('duration',str(greenNS)) @@ -21,7 +21,7 @@ tree = dom.parse(file) net = tree.getElementsByTagName('net')[0] - tlLogic = net.getElementsByTagName('tl-logic')[0] + tlLogic = net.getElementsByTagName('tlLogic')[0] tlLogic.setAttribute('type',type) writer = open(file, 'w') @@ -31,15 +31,15 @@ tree = dom.parse(file) net = tree.getElementsByTagName('net')[0] - tlLogic = net.getElementsByTagName('tl-logic')[0] + tlLogic = net.getElementsByTagName('tlLogic')[0] phases = tlLogic.getElementsByTagName('phase') phases[0].setAttribute('duration',str(minNS)) - phases[0].setAttribute('min',str(minNS)) - phases[0].setAttribute('max',str(maxNS)) + phases[0].setAttribute('minDur',str(minNS)) + phases[0].setAttribute('maxDur',str(maxNS)) phases[2].setAttribute('duration',str(minWE)) - phases[2].setAttribute('min',str(minWE)) - phases[2].setAttribute('max',str(maxWE)) + phases[2].setAttribute('minDur',str(minWE)) + phases[2].setAttribute('maxDur',str(maxWE)) writer = open(file, 'w') tree.writexml(writer) @@ -47,7 +47,7 @@ def setDetFreq(file, N): tree = dom.parse(file) - dets = (tree.getElementsByTagName('additional')[0]).getElementsByTagName('e1-detector') + dets = (tree.getElementsByTagName('additional')[0]).getElementsByTagName('e1Detector') for det in dets: det.setAttribute('freq',str(N)) diff -Nru sumo-0.15.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.det.xml sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.det.xml --- sumo-0.15.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.det.xml 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.det.xml 2012-12-04 00:26:11.000000000 +0000 @@ -1,3 +1,3 @@ - + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.det.xml sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.det.xml --- sumo-0.15.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.det.xml 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.det.xml 2012-12-04 00:26:11.000000000 +0000 @@ -1,3 +1,3 @@ - + \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/tools/route/extract_route_edges.py sumo-0.16.0~dfsg/tools/route/extract_route_edges.py --- sumo-0.15.0~dfsg/tools/route/extract_route_edges.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/route/extract_route_edges.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,29 @@ +#!/usr/bin/env python +""" +@file randomTrips.py +@author Jakob Erdmann +@date 2012-10-11 +@version $Id: extract_route_edges.py 12845 2012-10-16 17:46:11Z behrisch $ + +Extract all used edges from routes and person plans and output a file suitable +for pruning edges with netconvert + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2010-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" + +import os,sys +from collections import defaultdict +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from sumolib.output import parse, parse_fast + +route_file, keep_file = sys.argv[1:] +edges = set() +for route in parse_fast(route_file, 'route', ['edges']): + edges.update(route.edges.split()) +for walk in parse_fast(route_file, 'walk', ['edges']): + edges.update(walk.edges.split()) + +with open(keep_file, 'w') as outf: + outf.write(','.join(edges) + '\n') diff -Nru sumo-0.15.0~dfsg/tools/route/route2poly.py sumo-0.16.0~dfsg/tools/route/route2poly.py --- sumo-0.15.0~dfsg/tools/route/route2poly.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/route/route2poly.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,75 @@ +#!/usr/bin/python +""" +@file route2poly.py +@author Jakob Erdmann +@date 2012-11-15 +@version $Id: route2poly.py 13106 2012-12-02 13:44:57Z behrisch $ + +From a sumo network and a route file, this script generates a polygon (polyline) for every route +which can be loaded with sumo-gui for visualization + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2007-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +import sys +import os +import colorsys +import itertools +from random import random +from optparse import OptionParser +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) +from sumolib.output import parse +from sumolib.net import readNet + +def parse_args(): + USAGE = "Usage: " + sys.argv[0] + " [options]" + optParser = OptionParser() + optParser.add_option("-o", "--outfile", help="name of output file") + optParser.add_option("-u", "--hue", default="random", help="hue for polygons (float from [0,1] or 'random')") + optParser.add_option("-s", "--saturation", default=1, help="saturation for polygons (float from [0,1] or 'random')") + optParser.add_option("-b", "--brightness", default=1, help="brightness for polygons (float from [0,1] or 'random')") + optParser.add_option("-l", "--layer", default=100, help="layer for generated polygons") + options, args = optParser.parse_args() + try: + options.net, options.routefile = args + options.colorgen = Colorgen((options.hue, options.saturation, options.brightness)) + except: + sys.exit(USAGE) + if options.outfile is None: + options.outfile = options.routefile + ".poly.xml" + return options + + +class Colorgen: + def __init__(self, hsv): + self.hsv = hsv + + def get_value(self, opt): + if opt == 'random': + return random() + else: + return float(opt) + + def __call__(self): + """return constant or randomized rgb-color string""" + return ','.join(map(str, colorsys.hsv_to_rgb(*map(self.get_value, self.hsv)))) + + +def generate_poly(net, id, color, layer, edges, outf): + shape = list(itertools.chain(*list(net.getEdge(e).getShape() for e in edges))) + shapeString = ' '.join('%s,%s' % (x,y) for x,y in shape) + outf.write('\n' % ( + id, color, layer, shapeString)) + +def main(): + options = parse_args() + net = readNet(options.net) + with open(options.outfile, 'w') as outf: + outf.write('\n') + for vehicle in parse(options.routefile, 'vehicle'): + generate_poly(net, vehicle.id, options.colorgen(), options.layer, vehicle.route[0].edges.split(), outf) + outf.write('\n') + +if __name__ == "__main__": + main() diff -Nru sumo-0.15.0~dfsg/tools/route/routecompare.py sumo-0.16.0~dfsg/tools/route/routecompare.py --- sumo-0.15.0~dfsg/tools/route/routecompare.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/route/routecompare.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-03-25 -@version $Id: routecompare.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: routecompare.py 12567 2012-08-20 10:01:44Z dkrajzew $ This script compares two route sets by calculating a similarity for any two routes based on the number of common edges @@ -67,15 +67,15 @@ self._districtID = '' def startElement(self, name, attrs): - if name == 'district': + if name == 'taz': self._districtID = attrs['id'] - elif name == 'dsource': + elif name == 'tazSource': if attrs['id'] in self._edges: self._sources[self._edges[attrs['id']]] = self._districtID else: if options.verbose: print "Warning! No routes touching source edge %s of %s." % (attrs['id'], self._districtID) - elif name == 'dsink': + elif name == 'tazSink': if attrs['id'] in self._edges: self._sinks[self._edges[attrs['id']]] = self._districtID else: diff -Nru sumo-0.15.0~dfsg/tools/route/sort_routes.py sumo-0.16.0~dfsg/tools/route/sort_routes.py --- sumo-0.15.0~dfsg/tools/route/sort_routes.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/route/sort_routes.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Jakob Erdmann @author Michael Behrisch @date 2011-07-14 -@version $Id: sort_routes.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: sort_routes.py 12618 2012-08-30 08:02:33Z namdre $ This script sorts the vehicles in the given route file by their depart time SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ @@ -15,6 +15,25 @@ import os import re from xml.dom import pulldom +from xml.sax import handler +from xml.sax import make_parser +from xml.sax import handler +from optparse import OptionParser + +def parse_args(): + USAGE = "Usage: " + sys.argv[0] + " " + optParser = OptionParser() + optParser.add_option("-o", "--outfile", help="name of output file") + optParser.add_option("-b", "--big", action="store_true", default=False, + help="Use alternative sortign strategy for large files (slower but more memory efficient)") + options, args = optParser.parse_args() + if len(args) != 1: + sys.exit(USAGE) + options.routefile = args[0] + if options.outfile is None: + options.outfile = options.routefile + ".sorted" + return options + def sort_departs(routefilename, outfile): routes_doc = pulldom.parse(sys.argv[1]) @@ -29,25 +48,93 @@ elif (parsenode.localName == 'flow'): begin = int(float(vehicle.getAttribute('begin'))) vehicles.append((begin, vehicle.toprettyxml(indent="", newl=""))) - print('read %s vehicles.' % len(vehicles)) + print('read %s elements.' % len(vehicles)) vehicles.sort() for depart, vehiclexml in vehicles: outfile.write(" "*4) outfile.write(vehiclexml) outfile.write("\n") - print('wrote %s vehicles.' % len(vehicles)) + print('wrote %s elements.' % len(vehicles)) + + +class RouteHandler(handler.ContentHandler): + def __init__(self, elements_with_depart): + self.DEPART_ATTR = {'vehicle' : 'depart', 'flow' : 'begin'} + self.elements_with_depart = elements_with_depart + self._depart = None + + def setDocumentLocator(self,locator): + self.locator = locator + + def startElement(self,name,attrs): + if name in self.DEPART_ATTR.keys(): + self._depart = attrs[self.DEPART_ATTR[name]] + self._start_line = self.locator.getLineNumber() + + def endElement(self,name): + if name in self.DEPART_ATTR.keys(): + end_line = self.locator.getLineNumber() + self.elements_with_depart.append((self._depart, self._start_line, end_line)) + + +def create_line_index(file): + print "Building line offset index for %s" % file + result = [] + offset = 0 + with open(file, 'rb') as f: + for line in f: + result.append(offset) + offset += len(line) + return result + + +def get_element_lines(routefilename): + # [(depart, line_index_where_element_starts, line_index_where_element_ends), ...] + print "Parsing %s for line indices and departs" % routefilename + result = [] + parser = make_parser() + parser.setContentHandler(RouteHandler(result)) + parser.parse(open(routefilename)) + print " found %s items" % len(result) + return result + + +def copy_elements(routefilename, outfilename, element_lines, line_offsets): + print "Copying elements from %s to %s sorted by departure" % ( + routefilename, outfilename) + outfile = open(outfilename, 'w') + # copy header + for line in open(routefilename): + outfile.write(line) + if '') + outfile.close() + + +def main(): + options = parse_args() + if options.big: + line_offsets = create_line_index(options.routefile) + element_lines = get_element_lines(options.routefile) + element_lines.sort() + copy_elements(options.routefile, options.outfile, element_lines, line_offsets) + else: + outfile = open(options.outfile, 'w') + for line in open(options.routefile): + outfile.write(line) + if '') + outfile.close() -if len(sys.argv) != 2: - print("Supply exactly one argument: the routefile to be sorted") - sys.exit(1) - -routefilename = sys.argv[1] -outfile = open(routefilename + ".sorted", 'w') -for line in open(routefilename): - outfile.write(line) - if '') -outfile.close() +if __name__ == "__main__": + main() diff -Nru sumo-0.15.0~dfsg/tools/shapes/pois2inductionLoops.py sumo-0.16.0~dfsg/tools/shapes/pois2inductionLoops.py --- sumo-0.15.0~dfsg/tools/shapes/pois2inductionLoops.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/shapes/pois2inductionLoops.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2010-02-18 -@version $Id: pois2inductionLoops.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: pois2inductionLoops.py 12590 2012-08-24 07:46:31Z dkrajzew $ Converts a given pois located on lanes into induction loop detectors; @@ -43,7 +43,7 @@ edge = poi._lane[:poi._lane.rfind('_')] edge = net._id2edge[edge] for i, l in enumerate(edge._lanes): - print >> fdo, ' ' % (poi._id, i, l.getID(), poi._pos) + print >> fdo, ' ' % (poi._id, i, l.getID(), poi._pos) print >> fdo, '' print >> fdo, '' fdo.close() diff -Nru sumo-0.15.0~dfsg/tools/sumolib/miscutils.py sumo-0.16.0~dfsg/tools/sumolib/miscutils.py --- sumo-0.15.0~dfsg/tools/sumolib/miscutils.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/miscutils.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,129 @@ +#!/usr/bin/env python +""" +@file miscutils.py +@author Jakob.Erdmann@dlr.de +@date 2012-05-08 +@version $Id: miscutils.py 12617 2012-08-30 08:01:43Z namdre $ + +Common utility functions + +Copyright (C) 2007 DLR/FS, Germany +All rights reserved + +This is a duplicate of tools/util/miscutils.py from the VABENE repository +""" +import StringIO +import sys +import subprocess +import time +import os +import imp +import csv +import math +from collections import defaultdict + +# append import path stanca: +#THIS_DIR == os.path.basename(__file__) +#sys.path.append(os.path.join(THIS_DIR, 'foo', 'bar')) + +# http://www.python.org/dev/peps/pep-0326/ +class _ExtremeType(object): + + def __init__(self, cmpr, rep): + object.__init__(self) + self._cmpr = cmpr + self._rep = rep + + def __cmp__(self, other): + if isinstance(other, self.__class__) and\ + other._cmpr == self._cmpr: + return 0 + return self._cmpr + + def __repr__(self): + return self._rep + +uMax = _ExtremeType(1, "uMax") +uMin = _ExtremeType(-1, "uMin") + +# decorator for timing a function +def benchmark(func): + def benchmark_wrapper(*args, **kwargs): + started = time.time() + now = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) + print('function %s called at %s' % (func.__name__, now)) + sys.stdout.flush() + result = func(*args, **kwargs) + print('function %s finished after %f seconds' % (func.__name__, time.time() - started)) + sys.stdout.flush() + return result + return benchmark_wrapper + + +class Statistics: + def __init__(self, label=None, abs=False, histogram=False, printMin=True): + self.label = label + self.min = uMax + self.min_label = None + self.max = uMin + self.max_label = None + self.values = [] + self.abs = abs + self.printMin = printMin + if histogram: + self.counts = defaultdict(lambda:0) + else: + self.counts = None + + def add(self, v, label=None): + self.values.append(v) + if v < self.min: + self.min = v + self.min_label = label + if v > self.max: + self.max = v + self.max_label = label + if self.counts is not None: + self.counts[v] += 1 + + def count(self): + return len(self.values) + + def avg(self): + return sum(self.values) / float(len(self.values)) + + def avg_abs(self): + return sum(map(abs, self.values)) / float(len(self.values)) + + def mean(self): + if len(self.values) > 0: + return sorted(self.values)[len(self.values) / 2] + else: + return None + + def mean_abs(self): + return sorted(map(abs,self.values))[len(self.values) / 2] + + def __str__(self): + if len(self.values) > 0: + min = 'min %.2f (%s), ' % (self.min, self.min_label) if self.printMin else '' + result = '"%s": count %s, %smax %.2f (%s), avg %.2f, mean %.2f' % ( + self.label, len(self.values), min, + self.max, self.max_label, self.avg(), self.mean()) + if self.abs: + result += ', avg_abs %.2f, mean_abs %.2f' % (self.avg_abs(), self.mean_abs()) + if self.counts is not None: + result += '\nhistogram: %s' % [(k,self.counts[k]) for k in sorted(self.counts.keys())] + return result + else: + return '"%s": no values' % self.label + + +def geh(m,c): + """Error function for hourly traffic flow measures after Geoffrey E. Havers""" + if m+c == 0: + return 0 + else: + return math.sqrt(2 * (m-c) * (m-c) / (m+c)) + + diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net/__init__.py sumo-0.16.0~dfsg/tools/sumolib/net/__init__.py --- sumo-0.15.0~dfsg/tools/sumolib/net/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net/__init__.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,349 @@ +""" +@file __init__.py +@author Daniel Krajzewicz +@author Laura Bieker +@author Karol Stosiek +@author Michael Behrisch +@date 2008-03-27 +@version $Id: __init__.py 13066 2012-11-28 11:01:10Z dkrajzew $ + +This file contains a content handler for parsing sumo network xml files. +It uses other classes from this module to represent the road network. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" + +import os, sys +import math +from xml.sax import saxutils, parse, handler +from copy import copy +from itertools import * +import lane, edge, node, connection, roundabout + + +class TLS: + """Traffic Light Signal for a sumo network""" + def __init__(self, id): + self._id = id + self._connections = [] + self._maxConnectionNo = -1 + self._programs = {} + + def addConnection(self, inLane, outLane, linkNo): + self._connections.append( [inLane, outLane, linkNo] ) + if linkNo>self._maxConnectionNo: + self._maxConnectionNo = linkNo + + def getConnections(self): + return self._connections + + def getID(self): + return self._id + + def getLinks(self): + links = {} + for connection in self._connections: + if connection[2] not in links: + links[connection[2]] = [] + links[connection[2]].append(connection) + return links + + def getEdges(self): + edges = set() + for c in self._connections: + edges.add(c[0].getEdge()) + return edges + + def addProgram(self, program): + self._programs[program._id] = program + + +class TLSProgram: + def __init__(self, id, offset, type): + self._id = id + self._type = type + self._offset = offset + self._phases = [] + + def addPhase(self, state, duration): + self._phases.append( (state, duration) ) + + +class Net: + """The whole sumo network.""" + def __init__(self): + self._id2node = {} + self._id2edge = {} + self._id2tls = {} + self._nodes = [] + self._edges = [] + self._tlss = [] + self._ranges = [ [10000, -10000], [10000, -10000] ] + self._roundabouts = [] + + def addNode(self, id, type=None, coord=None, incLanes=None): + if id not in self._id2node: + n = node.Node(id, type, coord, incLanes) + self._nodes.append(n) + self._id2node[id] = n + self.setAdditionalNodeInfo(self._id2node[id], type, coord, incLanes) + return self._id2node[id] + + def setAdditionalNodeInfo(self, node, type, coord, incLanes): + if coord!=None and node._coord==None: + node._coord = coord + self._ranges[0][0] = min(self._ranges[0][0], coord[0]) + self._ranges[0][1] = max(self._ranges[0][1], coord[0]) + self._ranges[1][0] = min(self._ranges[1][0], coord[1]) + self._ranges[1][1] = max(self._ranges[1][1], coord[1]) + if incLanes!=None and node._incLanes==None: + node._incLanes = incLanes + if type!=None and node._type==None: + node._type = type + + def addEdge(self, id, fromID, toID, prio, function, name): + if id not in self._id2edge: + fromN = self.addNode(fromID) + toN = self.addNode(toID) + e = edge.Edge(id, fromN, toN, prio, function, name) + self._edges.append(e) + self._id2edge[id] = e + return self._id2edge[id] + + def addLane(self, edge, speed, length): + return lane.Lane(edge, speed, length) + + def addRoundabout(self, nodes): + r = roundabout.Roundabout(nodes) + self._roundabouts.append(r) + return r + + def addConnection(self, fromEdge, toEdge, fromlane, tolane, direction, tls, tllink): + conn = connection.Connection(fromEdge, toEdge, fromlane, tolane, direction, tls, tllink) + fromEdge.addOutgoing(conn) + fromlane.addOutgoing(conn) + toEdge._addIncoming(conn) + + def getEdges(self): + return self._edges + + def getRoundabouts(self): + return self._roundabouts + + def hasEdge(self, id): + return id in self._id2edge + + def getEdge(self, id): + return self._id2edge[id] + + def getNode(self, id): + return self._id2node[id] + + def getNodes(self): + return self._nodes + + def getTLSSecure(self, tlid): + if tlid in self._id2tls: + tls = self._id2tls[tlid] + else: + tls = TLS(tlid) + self._id2tls[tlid] = tls + self._tlss.append(tls) + return tls + + def addTLS(self, tlid, inLane, outLane, linkNo): + tls = self.getTLSSecure(tlid) + tls.addConnection(inLane, outLane, linkNo) + return tls + + def addTLSProgram(self, tlid, programID, offset, type): + tls = self.getTLSSecure(tlid) + program = TLSProgram(programID, offset, type) + tls.addProgram(program) + return program + + + def setFoes(self, junctionID, index, foes, prohibits): + self._id2node[junctionID].setFoes(index, foes, prohibits) + + def forbids(self, possProhibitor, possProhibited): + return possProhibitor[0].getEdge()._to.forbids(possProhibitor, possProhibited) + + def getDownstreamEdges(self, edge, distance, stopOnTLS): + ret = [] + seen = set() + toProc = [] + toProc.append( [edge, 0, [] ] ) + while not len(toProc)==0: + ie = toProc.pop() + if ie[0] in seen: + continue + seen.add(ie[0]) + if ie[1] + ie[0].getLength() >= distance: + ret.append( [ie[0], ie[0].getLength()+ie[1]-distance, ie[2], False] ) + continue + if len(ie[0]._incoming)==0: + ret.append( [ie[0], ie[0].getLength()+ie[1], ie[2], True] ) + continue + mn = [] + hadTLS = False + for ci in ie[0]._incoming: + if ci not in seen: + prev = copy(ie[2]) + if stopOnTLS and ci._tls and ci!=edge and not hadTLS: + ret.append( [ie[0], ie[1], prev, True ] ) + hadTLS = True + else: + prev.append(ie[0]) + mn.append( [ci, ie[0].getLength()+ie[1], prev ] ) + if not hadTLS: + toProc.extend(mn) + return ret + + # the diagonal of the bounding box of all nodes + def getBBoxDiameter(self): + return math.sqrt( + (self._ranges[0][0] - self._ranges[0][1]) ** 2 + + (self._ranges[1][0] - self._ranges[1][1]) ** 2) + + + +class NetReader(handler.ContentHandler): + """Reads a network, storing the edge geometries, lane numbers and max. speeds""" + + def __init__(self, **others): + self._net = others.get('net', Net()) + self._currentEdge = None + self._currentNode = None + self._currentLane = None + self._currentShape = "" + self._withPhases = others.get('withPrograms', False) + self._withConnections = others.get('withConnections', True) + self._withFoes = others.get('withFoes', True) + + def startElement(self, name, attrs): + if name == 'edge': + if not attrs.has_key('function') or attrs['function'] != 'internal': + prio = -1 + if attrs.has_key('priority'): + prio = int(attrs['priority']) + function = "" + if attrs.has_key('function'): + function = attrs['function'] + name = "" + if attrs.has_key('name'): + name = attrs['name'] + self._currentEdge = self._net.addEdge(attrs['id'], + attrs['from'], attrs['to'], prio, function, name) + if attrs.has_key('shape'): + self.processShape(self._currentEdge, attrs['shape']) + else: + self._currentEdge = None + if name == 'lane' and self._currentEdge!=None: + self._currentLane = self._net.addLane(self._currentEdge, float(attrs['speed']), float(attrs['length'])) + if attrs.has_key('shape'): + self._currentShape = attrs['shape'] # deprecated: at some time, this is mandatory + else: + self._currentShape = "" + if name == 'junction': + if attrs['id'][0]!=':': + self._currentNode = self._net.addNode(attrs['id'], attrs['type'], [ float(attrs['x']), float(attrs['y']) ], attrs['incLanes'].split(" ") ) + if name == 'succ' and self._withConnections: # deprecated + if attrs['edge'][0]!=':': + self._currentEdge = self._net.getEdge(attrs['edge']) + self._currentLane = attrs['lane'] + self._currentLane = int(self._currentLane[self._currentLane.rfind('_')+1:]) + else: + self._currentEdge = None + if name == 'succlane' and self._withConnections: # deprecated + lid = attrs['lane'] + if lid[0]!=':' and lid!="SUMO_NO_DESTINATION" and self._currentEdge: + connected = self._net.getEdge(lid[:lid.rfind('_')]) + tolane = int(lid[lid.rfind('_')+1:]) + if attrs.has_key('tl') and attrs['tl']!="": + tl = attrs['tl'] + tllink = int(attrs['linkIdx']) + tlid = attrs['tl'] + toEdge = self._net.getEdge(lid[:lid.rfind('_')]) + tolane2 = toEdge._lanes[tolane] + tls = self._net.addTLS(tlid, self._currentEdge._lanes[self._currentLane], tolane2, tllink) + self._currentEdge.setTLS(tls) + else: + tl = "" + tllink = -1 + toEdge = self._net.getEdge(lid[:lid.rfind('_')]) + tolane = toEdge._lanes[tolane] + self._net.addConnection(self._currentEdge, connected, self._currentEdge._lanes[self._currentLane], tolane, attrs['dir'], tl, tllink) + if name == 'connection' and self._withConnections and attrs['from'][0] != ":": + fromEdge = self._net.getEdge(attrs['from']) + toEdge = self._net.getEdge(attrs['to']) + fromLane = fromEdge.getLane(int(attrs['fromLane'])) + toLane = toEdge.getLane(int(attrs['toLane'])) + if attrs.has_key('tl') and attrs['tl']!="": + tl = attrs['tl'] + tllink = int(attrs['linkIndex']) + tls = self._net.addTLS(tl, fromLane, toLane, tllink) + fromEdge.setTLS(tls) + else: + tl = "" + tllink = -1 + self._net.addConnection(fromEdge, toEdge, fromLane, toLane, attrs['dir'], tl, tllink) + if self._withFoes and name=='ROWLogic': # 'row-logic' is deprecated!!! + self._currentNode = attrs['id'] + if name == 'logicitem' and self._withFoes: # deprecated + self._net.setFoes(self._currentNode, int(attrs['request']), attrs["foes"], attrs["response"]) + if name == 'request' and self._withFoes: + self._currentNode.setFoes(int(attrs['index']), attrs["foes"], attrs["response"]) + if self._withPhases and name=='tlLogic': # tl-logic is deprecated!!! + self._currentProgram = self._net.addTLSProgram(attrs['id'], attrs['programID'], int(attrs['offset']), attrs['type']) + if self._withPhases and name=='phase': + self._currentProgram.addPhase(attrs['state'], int(attrs['duration'])) + if name == 'roundabout': + self._net.addRoundabout(attrs['nodes'].split()) + + def characters(self, content): + if self._currentLane!=None: + self._currentShape = self._currentShape + content + + + def endElement(self, name): + if name == 'lane': + if self._currentLane: + self.processShape(self._currentLane, self._currentShape) + self._currentShape = "" + self._currentLane = None + if name == 'edge': + if self._currentEdge and self._currentEdge._shape is None: + self._currentEdge.rebuildShape(); + self._currentEdge = None + if name=='ROWLogic' or name=='row-logic': # 'row-logic' is deprecated!!! + self._haveROWLogic = False + if self._withPhases and (name=='tlLogic' or name=='tl-logic'): # tl-logic is deprecated!!! + self._currentProgram = None + + def processShape(self, object, shapeString): + cshape = [] + es = shapeString.rstrip().split(" ") + for e in es: + p = e.split(",") + cshape.append((float(p[0]), float(p[1]))) + object.setShape(cshape) + + + def getNet(self): + return self._net + + +def readNet(filename, **others): + netreader = NetReader(**others) + try: + if not os.path.isfile(filename): + print >> sys.stderr, "Network file '%s' not found" % filename + raise + parse(filename, netreader) + except KeyError: + print >> sys.stderr, "Please mind that the network format has changed in 0.13.0, you may need to update your network!" + raise + return netreader.getNet() diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net/connection.py sumo-0.16.0~dfsg/tools/sumolib/net/connection.py --- sumo-0.15.0~dfsg/tools/sumolib/net/connection.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net/connection.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,24 @@ +""" +@file connection.py +@author Daniel Krajzewicz +@author Laura Bieker +@author Karol Stosiek +@author Michael Behrisch +@date 2011-11-28 +@version $Id: connection.py 13106 2012-12-02 13:44:57Z behrisch $ + +This file contains a Python-representation of a single connection. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +class Connection: + """edge connection for a sumo network""" + def __init__(self, fromEdge, toEdge, fromLane, toLane, direction, tls, tllink): + self._from = fromEdge + self._to = toEdge + self._fromLane = fromLane + self._toLane = toLane + self._tls = tls + self._tlLink = tllink diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net/edge.py sumo-0.16.0~dfsg/tools/sumolib/net/edge.py --- sumo-0.15.0~dfsg/tools/sumolib/net/edge.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net/edge.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,120 @@ +""" +@file edge.py +@author Daniel Krajzewicz +@author Laura Bieker +@author Karol Stosiek +@author Michael Behrisch +@date 2011-11-28 +@version $Id: edge.py 13106 2012-12-02 13:44:57Z behrisch $ + +This file contains a Python-representation of a single edge. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +class Edge: + """ Edges from a sumo network """ + + def __init__(self, id, fromN, toN, prio, function, name): + self._id = id + self._from = fromN + self._to = toN + self._priority = prio + fromN.addOutgoing(self) + toN.addIncoming(self) + self._lanes = [] + self._speed = None + self._length = None + self._incoming = {} + self._outgoing = {} + self._shape = None + self._function = function + self._tls = None + self._name = name + + def getName(self): + return self._name + + def getTLS(self): + return self._tls + + def addLane(self, lane): + self._lanes.append(lane) + self._speed = lane.getSpeed() + self._length = lane.getLength() + + def addOutgoing(self, conn): + if conn._to not in self._outgoing: + self._outgoing[conn._to] = [] + self._outgoing[conn._to].append(conn) + + def _addIncoming(self, conn): + if conn._from not in self._incoming: + self._incoming[conn._from] = [] + self._incoming[conn._from].append(conn) + + def setShape(self, shape): + self._shape = shape + + def getID(self): + return self._id + + def getIncoming(self): + return self._incoming + + def getOutgoing(self): + return self._outgoing + + def getShape(self): + if not self._shape: + shape = [] + shape.append(self._from._coord) + shape.append(self._to._coord) + return shape + return self._shape + + def getSpeed(self): + return self._speed + + def getLaneNumber(self): + return len(self._lanes) + + def getLane(self, idx): + return self._lanes[idx] + + def rebuildShape(self): + noShapes = len(self._lanes) + if noShapes%2 == 1: + self.setShape(self._lanes[int(noShapes/2)]._shape) + else: + shape = [] + minLen = -1 + for l in self._lanes: + if minLen==-1 or minLen>len(l.getShape()): + minLen = len(l._shape) + for i in range(0, minLen): + x = 0. + y = 0. + for j in range(0, len(self._lanes)): + x = x + self._lanes[j]._shape[i][0] + y = y + self._lanes[j]._shape[i][1] + x = x / float(len(self._lanes)) + y = y / float(len(self._lanes)) + shape.append( [ x, y ] ) + self.setShape(shape) + + def getLength(self): + return self._lanes[0].getLength() + + def setTLS(self, tls): + self._tls = tls + + def getFromNode(self): + return self._from + + def getToNode(self): + return self._to + + def is_fringe(self): + return len(self.getIncoming()) == 0 or len(self.getOutgoing()) == 0 diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net/lane.py sumo-0.16.0~dfsg/tools/sumolib/net/lane.py --- sumo-0.15.0~dfsg/tools/sumolib/net/lane.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net/lane.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,46 @@ +""" +@file lane.py +@author Daniel Krajzewicz +@author Laura Bieker +@author Karol Stosiek +@author Michael Behrisch +@date 2011-11-28 +@version $Id: lane.py 13106 2012-12-02 13:44:57Z behrisch $ + +This file contains a Python-representation of a single lane. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +class Lane: + """ Lanes from a sumo network """ + + def __init__(self, edge, speed, length): + self._edge = edge + self._speed = speed + self._length = length + self._shape = [] + self._outgoing = [] + edge.addLane(self) + + def getSpeed(self): + return self._speed + + def getLength(self): + return self._length + + def setShape(self, shape): + self._shape = shape + + def getShape(self): + return self._shape + + def getID(self): + return self._edge._id + "_" + str(self._edge._lanes.index(self)) + + def getEdge(self): + return self._edge + + def addOutgoing(self, conn): + self._outgoing.append(conn) diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net/node.py sumo-0.16.0~dfsg/tools/sumolib/net/node.py --- sumo-0.15.0~dfsg/tools/sumolib/net/node.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net/node.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,74 @@ +""" +@file node.py +@author Daniel Krajzewicz +@author Laura Bieker +@author Karol Stosiek +@author Michael Behrisch +@date 2011-11-28 +@version $Id: node.py 13106 2012-12-02 13:44:57Z behrisch $ + +This file contains a Python-representation of a single node. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +class Node: + """ Nodes from a sumo network """ + def __init__(self, id, type, coord, incLanes): + self._id = id + self._type = type + self._coord = coord + self._incoming = [] + self._outgoing = [] + self._foes = {} + self._prohibits = {} + self._incLanes = incLanes + + def getID(self): + return self._id + + def addOutgoing(self, edge): + self._outgoing.append(edge) + + def getOutgoing(self): + return self._outgoing + + def addIncoming(self, edge): + self._incoming.append(edge) + + def getIncoming(self): + return self._incoming + + def setFoes(self, index, foes, prohibits): + self._foes[index] = foes + self._prohibits[index] = prohibits + + def areFoes(self, link1, link2): + return self._foes[link1][len(self._foes[link1]) - link2 - 1] == '1' + + def getLinkIndex(self, link): + ret = 0 + for lid in self._incLanes: + (e, l) = lid.split("_") + lane = None + for et in self._incoming: + for l in et._lanes: + if l==link[0]: + lane = l + + if l[0]==link[0] and l[1]==link[1]: + return ret + ret += 1 + return -1 + + def forbids(self, possProhibitor, possProhibited): + possProhibitorIndex = self.getLinkIndex(possProhibitor) + possProhibitedIndex = self.getLinkIndex(possProhibited) + if possProhibitorIndex < 0 or possProhibitedIndex < 0: + return False + ps = self._prohibits[possProhibitedIndex] + return ps[-(possProhibitorIndex-1)]=='1' + + def getCoord(self): + return self._coord diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net/roundabout.py sumo-0.16.0~dfsg/tools/sumolib/net/roundabout.py --- sumo-0.15.0~dfsg/tools/sumolib/net/roundabout.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net/roundabout.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,21 @@ +""" +@file roundabout.py +@author Daniel Krajzewicz +@author Laura Bieker +@author Karol Stosiek +@author Michael Behrisch +@date 2011-11-28 +@version $Id: roundabout.py 13106 2012-12-02 13:44:57Z behrisch $ + +This file contains a Python-representation of a single roundabout. + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" +class Roundabout: + def __init__(self, nodes): + self._nodes = nodes + + def getNodes(self): + return self._nodes diff -Nru sumo-0.15.0~dfsg/tools/sumolib/net.py sumo-0.16.0~dfsg/tools/sumolib/net.py --- sumo-0.15.0~dfsg/tools/sumolib/net.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/net.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,531 +0,0 @@ -""" -@file net.py -@author Daniel Krajzewicz -@author Laura Bieker -@author Karol Stosiek -@author Michael Behrisch -@date 2008-03-27 -@version $Id: net.py 11825 2012-02-02 07:46:23Z namdre $ - -This file contains a content handler for parsing sumo network xml files -and classes that represent the network. - -SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors -All rights reserved -""" - -import os, sys -from xml.sax import saxutils, parse, handler -from copy import copy -from itertools import * - -class Lane: - """ Lanes from a sumo network """ - - def __init__(self, edge, speed, length): - self._edge = edge - self._speed = speed - self._length = length - self._shape = [] - self._outgoing = [] - edge.addLane(self) - - def getSpeed(self): - return self._speed - - def getLength(self): - return self._length - - def setShape(self, shape): - self._shape = shape - - def getShape(self): - return self._shape - - def getID(self): - return self._edge._id + "_" + str(self._edge._lanes.index(self)) - - def getEdge(self): - return self._edge - - def addOutgoing(self, conn): - self._outgoing.append(conn) - - -class Edge: - """ Edges from a sumo network """ - - def __init__(self, id, fromN, toN, prio, function, name): - self._id = id - self._from = fromN - self._to = toN - self._priority = prio - fromN.addOutgoing(self) - toN.addIncoming(self) - self._lanes = [] - self._speed = None - self._length = None - self._incoming = {} - self._outgoing = {} - self._shape = None - self._function = function - self._tls = None - self._name = name - - def getName(self): - return self._name - - def getTLS(self): - return self._tls - - def addLane(self, lane): - self._lanes.append(lane) - self._speed = lane.getSpeed() - self._length = lane.getLength() - - def addOutgoing(self, conn): - if conn._to not in self._outgoing: - self._outgoing[conn._to] = [] - self._outgoing[conn._to].append(conn) - - def _addIncoming(self, conn): - if conn._from not in self._incoming: - self._incoming[conn._from] = [] - self._incoming[conn._from].append(conn) - - def setShape(self, shape): - self._shape = shape - - def getID(self): - return self._id - - def getIncoming(self): - return self._incoming - - def getOutgoing(self): - return self._outgoing - - def getShape(self): - if not self._shape: - shape = [] - shape.append(self._from._coord) - shape.append(self._to._coord) - return shape - return self._shape - - def getSpeed(self): - return self._speed - - def getLaneNumber(self): - return len(self._lanes) - - def getLane(self, idx): - return self._lanes[idx] - - def rebuildShape(self): - noShapes = len(self._lanes) - if noShapes%2 == 1: - self.setShape(self._lanes[int(noShapes/2)]._shape) - else: - shape = [] - minLen = -1 - for l in self._lanes: - if minLen==-1 or minLen>len(l.getShape()): - minLen = len(l._shape) - for i in range(0, minLen): - x = 0. - y = 0. - for j in range(0, len(self._lanes)): - x = x + self._lanes[j]._shape[i][0] - y = y + self._lanes[j]._shape[i][1] - x = x / float(len(self._lanes)) - y = y / float(len(self._lanes)) - shape.append( [ x, y ] ) - self.setShape(shape) - - def getLength(self): - return self._lanes[0].getLength() - - def setTLS(self, tls): - self._tls = tls - - -class Node: - """ Nodes from a sumo network """ - def __init__(self, id, coord, incLanes): - self._id = id - self._coord = coord - self._incoming = [] - self._outgoing = [] - self._foes = {} - self._prohibits = {} - self._incLanes = incLanes - - def addOutgoing(self, edge): - self._outgoing.append(edge) - - def getOutgoing(self): - return self._outgoing - - def addIncoming(self, edge): - self._incoming.append(edge) - - def getIncoming(self): - return self._incoming - - def setFoes(self, index, foes, prohibits): - self._foes[index] = foes - self._prohibits[index] = prohibits - - def areFoes(self, link1, link2): - return self._foes[link1][len(self._foes[link1]) - link2 - 1] == '1' - - def getLinkIndex(self, link): - ret = 0 - for lid in self._incLanes: - (e, l) = lid.split("_") - lane = None - for et in self._incoming: - for l in et._lanes: - if l==link[0]: - lane = l - - if l[0]==link[0] and l[1]==link[1]: - return ret - ret += 1 - return -1 - - def forbids(self, possProhibitor, possProhibited): - possProhibitorIndex = self.getLinkIndex(possProhibitor) - possProhibitedIndex = self.getLinkIndex(possProhibited) - if possProhibitorIndex < 0 or possProhibitedIndex < 0: - return False - ps = self._prohibits[possProhibitedIndex] - return ps[-(possProhibitorIndex-1)]=='1' - - -class Connection: - """edge connection for a sumo network""" - def __init__(self, fromEdge, toEdge, fromLane, toLane, direction, tls, tllink): - self._from = fromEdge - self._to = toEdge - self._fromLane = fromLane - self._toLane = toLane - self._tls = tls - self._tlLink = tllink - - -class TLS: - """Traffic Light Signal for a sumo network""" - def __init__(self, id): - self._id = id - self._connections = [] - self._maxConnectionNo = -1 - self._programs = {} - - def addConnection(self, inLane, outLane, linkNo): - self._connections.append( [inLane, outLane, linkNo] ) - if linkNo>self._maxConnectionNo: - self._maxConnectionNo = linkNo - - def getConnections(self): - return self._connections - - def getID(self): - return self._id - - def getLinks(self): - links = {} - for connection in self._connections: - if connection[2] not in links: - links[connection[2]] = [] - links[connection[2]].append(connection) - return links - - def getEdges(self): - edges = set() - for c in self._connections: - edges.add(c[0].getEdge()) - return edges - - def addProgram(self, program): - self._programs[program._id] = program - - -class TLSProgram: - def __init__(self, id, offset, type): - self._id = id - self._type = type - self._offset = offset - self._phases = [] - - def addPhase(self, state, duration): - self._phases.append( (state, duration) ) - - -class Roundabout: - def __init__(self, nodes): - self._nodes = nodes - - def getNodes(self): - return self._nodes - - -class Net: - """The whole sumo network.""" - def __init__(self): - self._id2node = {} - self._id2edge = {} - self._id2tls = {} - self._nodes = [] - self._edges = [] - self._tlss = [] - self._ranges = [ [10000, -10000], [10000, -10000] ] - self._roundabouts = [] - - def addNode(self, id, coord=None, incLanes=None): - if id not in self._id2node: - node = Node(id, coord, incLanes) - self._nodes.append(node) - self._id2node[id] = node - self.setAdditionalNodeInfo(self._id2node[id], coord, incLanes) - return self._id2node[id] - - def setAdditionalNodeInfo(self, node, coord, incLanes): - if coord!=None and node._coord==None: - node._coord = coord - self._ranges[0][0] = min(self._ranges[0][0], coord[0]) - self._ranges[0][1] = max(self._ranges[0][1], coord[0]) - self._ranges[1][0] = min(self._ranges[1][0], coord[1]) - self._ranges[1][1] = max(self._ranges[1][1], coord[1]) - if incLanes!=None and node._incLanes==None: - node._incLanes = incLanes - - def addEdge(self, id, fromID, toID, prio, function, name): - if id not in self._id2edge: - fromN = self.addNode(fromID) - toN = self.addNode(toID) - edge = Edge(id, fromN, toN, prio, function, name) - self._edges.append(edge) - self._id2edge[id] = edge - return self._id2edge[id] - - def addLane(self, edge, speed, length): - return Lane(edge, speed, length) - - def addRoundabout(self, nodes): - roundabout = Roundabout(nodes) - self._roundabouts.append(roundabout) - return roundabout - - def addConnection(self, fromEdge, toEdge, fromlane, tolane, direction, tls, tllink): - conn = Connection(fromEdge, toEdge, fromlane, tolane, direction, tls, tllink) - fromEdge.addOutgoing(conn) - fromlane.addOutgoing(conn) - toEdge._addIncoming(conn) - - def getEdges(self): - return self._edges - - def getRoundabouts(self): - return self._roundabouts - - def hasEdge(self, id): - return id in self._id2edge - - def getEdge(self, id): - return self._id2edge[id] - - def getNode(self, id): - return self._id2node[id] - - def getNodes(self): - return self._nodes - - def getTLSSecure(self, tlid): - if tlid in self._id2tls: - tls = self._id2tls[tlid] - else: - tls = TLS(tlid) - self._id2tls[tlid] = tls - self._tlss.append(tls) - return tls - - def addTLS(self, tlid, inLane, outLane, linkNo): - tls = self.getTLSSecure(tlid) - tls.addConnection(inLane, outLane, linkNo) - return tls - - def addTLSProgram(self, tlid, programID, offset, type): - tls = self.getTLSSecure(tlid) - program = TLSProgram(programID, offset, type) - tls.addProgram(program) - return program - - - def setFoes(self, junctionID, index, foes, prohibits): - self._id2node[junctionID].setFoes(index, foes, prohibits) - - def forbids(self, possProhibitor, possProhibited): - return possProhibitor[0].getEdge()._to.forbids(possProhibitor, possProhibited) - - def getDownstreamEdges(self, edge, distance, stopOnTLS): - ret = [] - seen = set() - toProc = [] - toProc.append( [edge, 0, [] ] ) - while not len(toProc)==0: - ie = toProc.pop() - if ie[0] in seen: - continue - seen.add(ie[0]) - if ie[1] + ie[0].getLength() >= distance: - ret.append( [ie[0], ie[0].getLength()+ie[1]-distance, ie[2], False] ) - continue - if len(ie[0]._incoming)==0: - ret.append( [ie[0], ie[0].getLength()+ie[1], ie[2], True] ) - continue - mn = [] - hadTLS = False - for ci in ie[0]._incoming: - if ci not in seen: - prev = copy(ie[2]) - if stopOnTLS and ci._tls and ci!=edge and not hadTLS: - ret.append( [ie[0], ie[1], prev, True ] ) - hadTLS = True - else: - prev.append(ie[0]) - mn.append( [ci, ie[0].getLength()+ie[1], prev ] ) - if not hadTLS: - toProc.extend(mn) - return ret - - -class NetReader(handler.ContentHandler): - """Reads a network, storing the edge geometries, lane numbers and max. speeds""" - - def __init__(self, **others): - self._net = others.get('net', Net()) - self._currentEdge = None - self._currentNode = None - self._currentLane = None - self._currentShape = "" - self._withPhases = others.get('withPrograms', False) - self._withConnections = others.get('withConnections', True) - self._withFoes = others.get('withFoes', True) - - def startElement(self, name, attrs): - if name == 'edge': - if not attrs.has_key('function') or attrs['function'] != 'internal': - prio = -1 - if attrs.has_key('priority'): - prio = int(attrs['priority']) - function = "" - if attrs.has_key('function'): - function = attrs['function'] - name = "" - if attrs.has_key('name'): - name = attrs['name'] - self._currentEdge = self._net.addEdge(attrs['id'], - attrs['from'], attrs['to'], prio, function, name) - else: - self._currentEdge = None - if name == 'lane' and self._currentEdge!=None: - self._currentLane = self._net.addLane(self._currentEdge, float(attrs['speed']), float(attrs['length'])) - if attrs.has_key('shape'): - self._currentShape = attrs['shape'] # deprecated: at some time, this is mandatory - else: - self._currentShape = "" - if name == 'junction': - if attrs['id'][0]!=':': - self._currentNode = self._net.addNode(attrs['id'], [ float(attrs['x']), float(attrs['y']) ], attrs['incLanes'].split(" ") ) - if name == 'succ' and self._withConnections: # deprecated - if attrs['edge'][0]!=':': - self._currentEdge = self._net.getEdge(attrs['edge']) - self._currentLane = attrs['lane'] - self._currentLane = int(self._currentLane[self._currentLane.rfind('_')+1:]) - else: - self._currentEdge = None - if name == 'succlane' and self._withConnections: # deprecated - lid = attrs['lane'] - if lid[0]!=':' and lid!="SUMO_NO_DESTINATION" and self._currentEdge: - connected = self._net.getEdge(lid[:lid.rfind('_')]) - tolane = int(lid[lid.rfind('_')+1:]) - if attrs.has_key('tl') and attrs['tl']!="": - tl = attrs['tl'] - tllink = int(attrs['linkIdx']) - tlid = attrs['tl'] - toEdge = self._net.getEdge(lid[:lid.rfind('_')]) - tolane2 = toEdge._lanes[tolane] - tls = self._net.addTLS(tlid, self._currentEdge._lanes[self._currentLane], tolane2, tllink) - self._currentEdge.setTLS(tls) - else: - tl = "" - tllink = -1 - toEdge = self._net.getEdge(lid[:lid.rfind('_')]) - tolane = toEdge._lanes[tolane] - self._net.addConnection(self._currentEdge, connected, self._currentEdge._lanes[self._currentLane], tolane, attrs['dir'], tl, tllink) - if name == 'connection' and self._withConnections and attrs['from'][0] != ":": - fromEdge = self._net.getEdge(attrs['from']) - toEdge = self._net.getEdge(attrs['to']) - fromLane = fromEdge.getLane(int(attrs['fromLane'])) - toLane = toEdge.getLane(int(attrs['toLane'])) - if attrs.has_key('tl') and attrs['tl']!="": - tl = attrs['tl'] - tllink = int(attrs['linkIndex']) - tls = self._net.addTLS(tl, fromLane, toLane, tllink) - fromEdge.setTLS(tls) - else: - tl = "" - tllink = -1 - self._net.addConnection(fromEdge, toEdge, fromLane, toLane, attrs['dir'], tl, tllink) - if self._withFoes and (name=='ROWLogic' or name=='row-logic'): # 'row-logic' is deprecated!!! - self._currentNode = attrs['id'] - if name == 'logicitem' and self._withFoes: # deprecated - self._net.setFoes(self._currentNode, int(attrs['request']), attrs["foes"], attrs["response"]) - if name == 'request' and self._withFoes: - self._currentNode.setFoes(int(attrs['index']), attrs["foes"], attrs["response"]) - if self._withPhases and (name=='tlLogic' or name=='tl-logic'): # tl-logic is deprecated!!! - self._currentProgram = self._net.addTLSProgram(attrs['id'], attrs['programID'], int(attrs['offset']), attrs['type']) - if self._withPhases and name=='phase': - self._currentProgram.addPhase(attrs['state'], int(attrs['duration'])) - if name == 'roundabout': - self._net.addRoundabout(attrs['nodes'].split()) - - def characters(self, content): - if self._currentLane!=None: - self._currentShape = self._currentShape + content - - - def endElement(self, name): - if name == 'lane' and self._currentLane: - cshape = [] - es = self._currentShape.split(" ") - for e in es: - p = e.split(",") - cshape.append((float(p[0]), float(p[1]))) - self._currentLane.setShape(cshape) - self._currentLane = None - self._currentShape = "" - if name == 'edge' and self._currentEdge: - self._currentEdge.rebuildShape(); - if name == 'edge': - self._currentEdge = None - if name=='ROWLogic' or name=='row-logic': # 'row-logic' is deprecated!!! - self._haveROWLogic = False - if self._withPhases and (name=='tlLogic' or name=='tl-logic'): # tl-logic is deprecated!!! - self._currentProgram = None - - def getNet(self): - return self._net - - -def readNet(filename, **others): - netreader = NetReader(**others) - try: - parse(filename, netreader) - except KeyError: - print >> sys.stderr, "Please mind that the network format has changed in 0.13.0, you may need to update your network!" - raise - return netreader.getNet() diff -Nru sumo-0.15.0~dfsg/tools/sumolib/options.py sumo-0.16.0~dfsg/tools/sumolib/options.py --- sumo-0.15.0~dfsg/tools/sumolib/options.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/options.py 2012-12-04 00:26:11.000000000 +0000 @@ -0,0 +1,38 @@ +""" +@file options.py +@author Jakob Erdmann +@date 2012-03-15 +@version $Id: options.py 12112 2012-03-16 07:41:59Z bieker $ + +Provides utility functions for dealing with program options + +SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors +All rights reserved +""" + +import os, sys +import subprocess +import re +from xml.sax import saxutils, parse, handler +from xml.dom import pulldom + + +def get_long_option_names(application): + # using option --save-template and parsing xml would be prettier + # but we do not want to rely on a temporary file + output,error = subprocess.Popen( + [application, '--help'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE).communicate() + reprog = re.compile('(--\S*)\s') + result = [] + for line in output.split(os.linesep): + m = reprog.search(line) + if m: + result.append(m.group(1)) + return result + + + + diff -Nru sumo-0.15.0~dfsg/tools/sumolib/output/__init__.py sumo-0.16.0~dfsg/tools/sumolib/output/__init__.py --- sumo-0.15.0~dfsg/tools/sumolib/output/__init__.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/sumolib/output/__init__.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Jakob Erdmann @date 2011-06-23 -@version $Id: __init__.py 12055 2012-03-12 08:37:20Z namdre $ +@version $Id: __init__.py 12859 2012-10-18 12:32:36Z namdre $ Python interface to SUMO especially for parsing output files. @@ -12,43 +12,105 @@ Copyright (C) 2011-2012 DLR (http://www.dlr.de/) and contributors All rights reserved """ +import sys import dump, inductionloop import re - +import xml.dom from xml.dom import pulldom -from collections import namedtuple +from collections import namedtuple, defaultdict from keyword import iskeyword -def parse(xmlfile, element_name): - # parses the attributes of all nodes with element_name and returns a list of namedtuples - # @note the first node in xmlfile will determine the set of attributes - # @note attribute names which are also python keywords will be prefixed with 'attr_' - elementType = [] # mutable, will be [namedtuple] +def compound_object(element_name, attrnames): + """return a class which delegates attribute acces to a namedtuple instance and + bracket access to an internal dict. Missing attributes are deletegated to + the child dict for convenience + @note: Care must be taken when child nodes and attributes have the same names""" + nt = namedtuple(element_name, attrnames) + class CompoundObject(): + _fields = attrnames + def __init__(self, values, child_dict): + self.nt_instance = nt(*values) + self.child_dict = child_dict + def __getattr__(self, name): + try: + return getattr(self.nt_instance, name) + except AttributeError: + return self.child_dict.get(name, None) + def __getitem__(self, name): + return self.child_dict[name] + def __str__(self): + return "<%s,child_dict=%s>" % (self.nt_instance, dict(self.child_dict)) + def __repr__(self): + return str(self) + + return CompoundObject + + +def parse(xmlfile, element_names, element_attrs={}, attr_conversions={}): + """ + 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 follow provide all element attributes of + the first read element 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 (attribute names may be modified to avoid name clashes + with python keywords). + 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, ...] + @Note: all elements with the same name must have the same type regardless of + the subtree in which they occur + """ + elementTypes = {} xml_doc = pulldom.parse(xmlfile) - return [_get_attrs(parsenode, elementType, element_name) for event, parsenode in xml_doc - if event == pulldom.START_ELEMENT and parsenode.localName == element_name] - -def _get_attrs(node, elementType, element_name): - # get all attributes defined in elementType from the parsed node - # if elementType is not yet defined create it as a a named tuple named element_name - if not elementType: - # initialized the named tuple type (only once) - # note: for unfathomable reasons NamedNodeMap does not support pythonic iteration - attrnames = [node.attributes.item(i).localName for i in range(node.attributes.length)] + for event, parsenode in xml_doc: + if event == pulldom.START_ELEMENT and parsenode.localName in element_names: + xml_doc.expandNode(parsenode) + yield _get_compound_object(parsenode, elementTypes, + parsenode.localName, element_attrs, attr_conversions) + + +_NO_CHILDREN = defaultdict(lambda:[]) +_IDENTITY = lambda x:x +def _get_compound_object(node, elementTypes, element_name, element_attrs, attr_conversions): + if not element_name in elementTypes: + # initialized the compound_object type from the first encountered # element + attrnames = element_attrs.get(element_name, + [node.attributes.item(i).localName for i in range(node.attributes.length)]) + if len(attrnames) != len(set(attrnames)): + raise Exception("non-unique attributes %s for element '%s'" % (attrnames, element_name)) attrnames = [_prefix_keyword(a) for a in attrnames] - elementType.append(namedtuple(element_name, attrnames)) - return elementType[0](*[node.getAttribute(a) for a in elementType[0]._fields]) - - -def _prefix_keyword(name): - return 'attr_' + name if iskeyword(name) else name + elementTypes[element_name] = compound_object(element_name, attrnames) + # prepare children + child_dict = _NO_CHILDREN # conserve space by reusing singleton + child_elements = [c for c in node.childNodes if c.nodeType == xml.dom.Node.ELEMENT_NODE] + if child_elements: + child_dict = defaultdict(lambda:[]) + for c in child_elements: + child_dict[c.localName].append(_get_compound_object( + c, elementTypes, c.localName, element_attrs, attr_conversions)) + attrnames = elementTypes[element_name]._fields + return elementTypes[element_name]( + [(attr_conversions.get(a, _IDENTITY)(node.getAttribute(a)) if node.hasAttribute(a) else None) for a in attrnames], + child_dict) + + +def _prefix_keyword(name, warn=False): + result = name + if iskeyword(name): + result = 'attr_' + name + if warn: + print >>sys.stderr, "Warning: Renaming attribute '%s' to '%s' because it conflicts with a python keyword" % (name, result) + return result def sum(elements, attrname): # for the given elements (as returned by method parse) compute the sum for attrname # attrname must be the name of a numerical attribute - return reduce(lambda x,y: x+y, [float(e.__getattribute__(attrname)) for e in elements]) + return reduce(lambda x,y: x+y, [float(getattr(e, attrname)) for e in elements]) def average(elements, attrname): @@ -64,13 +126,14 @@ # parses the given attribute from all elements with element_name # note that the element must be on its own line and # the attributes must appear in the given order - Record = namedtuple(element_name, attrnames) + # example: parse_fast('plain.edg.xml', 'edge', ['id', 'speed']) pattern = '.*'.join(['<%s' % element_name] + ['%s="([^"]*)"' % attr for attr in attrnames]) + attrnames = [_prefix_keyword(a, True) for a in attrnames] + Record = namedtuple(element_name, attrnames) reprog = re.compile(pattern) for line in open(xmlfile): m = reprog.search(line) if m: yield Record(*m.groups()) - diff -Nru sumo-0.15.0~dfsg/tools/tls/tls_check.py sumo-0.16.0~dfsg/tools/tls/tls_check.py --- sumo-0.15.0~dfsg/tools/tls/tls_check.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/tls/tls_check.py 2012-12-04 00:26:11.000000000 +0000 @@ -1,10 +1,10 @@ #!/usr/bin/env python """ -@file tls_csv2SUMO.py +@file tls_check.py @author Daniel Krajzewicz @author Michael Behrisch @date 2009-08-01 -@version $Id: tls_check.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: tls_check.py 12372 2012-06-07 20:28:54Z behrisch $ Verifies the traffic lights in the given network. Currently verified: @@ -21,7 +21,7 @@ if len(sys.argv)<2: - print >> sys.stderr, "Call: tls_csv2SUMO.py " + print >> sys.stderr, "Call: tls_check.py " sys.exit() net1 = sumolib.net.readNet(sys.argv[1], withPrograms=True) @@ -34,5 +34,5 @@ print " Checking program '%s'" % prog prog = tls._programs[prog] for i, phase in enumerate(prog._phases): - if len(phase[0])!=noConnections: + if len(phase[0]) != noConnections: print " Error: phase %s describes %s signals instead of %s." % (i, len(phase[0]), noConnections) diff -Nru sumo-0.15.0~dfsg/tools/tls/tls_csv2SUMO.py sumo-0.16.0~dfsg/tools/tls/tls_csv2SUMO.py --- sumo-0.15.0~dfsg/tools/tls/tls_csv2SUMO.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/tls/tls_csv2SUMO.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2009-08-01 -@version $Id: tls_csv2SUMO.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: tls_csv2SUMO.py 12372 2012-06-07 20:28:54Z behrisch $ Converts a csv-tls-description into one SUMO can read as additional file. Format of the csv-file: @@ -107,7 +107,7 @@ net1 = sumolib.net.readNet(sys.argv[2]) -print '\n' +print '\n' for keyIndex, key in enumerate(allKeys): minTimes = allMinTimes[keyIndex] maxTimes = allMaxTimes[keyIndex] @@ -128,18 +128,18 @@ lo = tl_c[1] # outgoing lane in our net for l in links: valid = True - if l[0].find('_')<0: + if l[0].find('_') < 0: # edge only given - if l[0]!=li.getEdge().getID(): + if l[0] != li.getEdge().getID(): valid = False else: # lane given - if l[0]!=li.getID(): + if l[0] != li.getID(): valid = False if l[1]!="": - if l[1].find('_')<0: + if l[1].find('_') < 0: # edge only given - if l[1]!=lo.getEdge().getID(): + if l[1] != lo.getEdge().getID(): valid = False else: # lane given @@ -148,7 +148,9 @@ if valid: linkMap[tl_c[2]] = l[2] laneMap[tl_c[2]] = (li, lo) -#print linkMap + if laneMap[tl_c[2]] == None: + print >> sys.stderr, "Error: No link definition for connection (%s, %s)!" % (li.getID(), lo.getID()) + sys.exit() nodes = set() for l in laneMap: @@ -169,7 +171,7 @@ for l in range(0, len(linkMap)): if linkMap[l] not in links2index: - print >> sys.stderr, "Link %s is not described (%s)" % (l, linkMap[l]) + print >> sys.stderr, "Error: Link %s is not described (%s)!" % (l, linkMap[l]) sys.exit() print ' ' diff -Nru sumo-0.15.0~dfsg/tools/traceExporter/src/ns2/Lane.java sumo-0.16.0~dfsg/tools/traceExporter/src/ns2/Lane.java --- sumo-0.15.0~dfsg/tools/traceExporter/src/ns2/Lane.java 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traceExporter/src/ns2/Lane.java 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ /** * model for lanes * @author Thimor Bohn - * @author Matthias Röckl + * @author Matthias Roeckl * */ public class Lane { diff -Nru sumo-0.15.0~dfsg/tools/traceExporter/src/ns2/MobilityWriter.java sumo-0.16.0~dfsg/tools/traceExporter/src/ns2/MobilityWriter.java --- sumo-0.15.0~dfsg/tools/traceExporter/src/ns2/MobilityWriter.java 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traceExporter/src/ns2/MobilityWriter.java 2012-12-04 00:26:11.000000000 +0000 @@ -16,7 +16,7 @@ /** * class for writing ns2 mobility files * @author Thimor Bohn - * @author Matthias Röckl + * @author Matthias Roeckl * */ public class MobilityWriter { diff -Nru sumo-0.15.0~dfsg/tools/traceExporter/src/ns2/NetReader.java sumo-0.16.0~dfsg/tools/traceExporter/src/ns2/NetReader.java --- sumo-0.15.0~dfsg/tools/traceExporter/src/ns2/NetReader.java 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traceExporter/src/ns2/NetReader.java 2012-12-04 00:26:11.000000000 +0000 @@ -14,7 +14,7 @@ /** * class for reading net file * @author Thimor Bohn - * @author Matthias Röckl + * @author Matthias Roeckl * */ public class NetReader { diff -Nru sumo-0.15.0~dfsg/tools/traci/__init__.py sumo-0.16.0~dfsg/tools/traci/__init__.py --- sumo-0.15.0~dfsg/tools/traci/__init__.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/__init__.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Lena Kalleske @date 2008-10-09 -@version $Id: __init__.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: __init__.py 12913 2012-11-01 11:31:06Z behrisch $ Python implementation of the TraCI interface. @@ -20,6 +20,7 @@ _embedded = False _RESULTS = {0x00: "OK", 0x01: "Not implemented", 0xFF: "Error"} +_DEBUG = False def isEmbedded(): return _embedded @@ -35,7 +36,7 @@ class FatalTraCIError(Exception): """Exception class for all TraCI errors""" def __init__(self, desc): - self._desc = desc + Exception.__init__(self, desc) class Message: """ A named tuple for internal usage. @@ -83,10 +84,51 @@ length = self.read("!B")[0] return [self.read("!dd") for i in range(length)] - def ready(self): return self._pos < len(self._content) + def printDebug(self): + if _DEBUG: + for char in self._content[self._pos:]: + print "%03i %02x %s" % (ord(char), ord(char), char) + +class SubscriptionResults: + def __init__(self, valueFunc): + self._results = {} + self._contextResults = {} + self._valueFunc = valueFunc + + def _parse(self, varID, data): + if not varID in self._valueFunc: + raise FatalTraCIError("Unknown variable %02x." % varID) + return self._valueFunc[varID](data) + + def reset(self): + self._results.clear() + self._contextResults.clear() + + def add(self, refID, varID, data): + if refID not in self._results: + self._results[refID] = {} + self._results[refID][varID] = self._parse(varID, data) + + def get(self, refID=None): + if refID == None: + return self._results + return self._results.get(refID, None) + + def addContext(self, refID, domain, objID, varID, data): + if refID not in self._contextResults: + self._contextResults[refID] = {} + if objID not in self._contextResults[refID]: + self._contextResults[refID][objID] = {} + self._contextResults[refID][objID][varID] = domain._parse(varID, data) + + def getContext(self, refID=None): + if refID == None: + return self._contextResults + return self._contextResults.get(refID, None) + import constants import inductionloop, multientryexit, trafficlights @@ -106,7 +148,37 @@ constants.RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE: junction, constants.RESPONSE_SUBSCRIBE_EDGE_VARIABLE: edge, constants.RESPONSE_SUBSCRIBE_SIM_VARIABLE: simulation, - constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE: gui} + constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE: gui, + + constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT: inductionloop, + constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT:\ + multientryexit, + constants.RESPONSE_SUBSCRIBE_TL_CONTEXT: trafficlights, + constants.RESPONSE_SUBSCRIBE_LANE_CONTEXT: lane, + constants.RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT: vehicle, + constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT: vehicletype, + constants.RESPONSE_SUBSCRIBE_ROUTE_CONTEXT: route, + constants.RESPONSE_SUBSCRIBE_POI_CONTEXT: poi, + constants.RESPONSE_SUBSCRIBE_POLYGON_CONTEXT: polygon, + constants.RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT: junction, + constants.RESPONSE_SUBSCRIBE_EDGE_CONTEXT: edge, + constants.RESPONSE_SUBSCRIBE_SIM_CONTEXT: simulation, + constants.RESPONSE_SUBSCRIBE_GUI_CONTEXT: gui, + + constants.CMD_GET_INDUCTIONLOOP_VARIABLE: inductionloop, + constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE:\ + multientryexit, + constants.CMD_GET_TL_VARIABLE: trafficlights, + constants.CMD_GET_LANE_VARIABLE: lane, + constants.CMD_GET_VEHICLE_VARIABLE: vehicle, + constants.CMD_GET_VEHICLETYPE_VARIABLE: vehicletype, + constants.CMD_GET_ROUTE_VARIABLE: route, + constants.CMD_GET_POI_VARIABLE: poi, + constants.CMD_GET_POLYGON_VARIABLE: polygon, + constants.CMD_GET_JUNCTION_VARIABLE: junction, + constants.CMD_GET_EDGE_VARIABLE: edge, + constants.CMD_GET_SIM_VARIABLE: simulation, + constants.CMD_GET_GUI_VARIABLE: gui} _connections = {} _message = Message() @@ -146,8 +218,8 @@ if prefix[2] or err: print prefix, _RESULTS[prefix[2]], err elif prefix[1] != command: - print "Error! Received answer %s for command %s." % (prefix[1], - command) + raise FatalTraCIError("Received answer %s for command %s." % (prefix[1], + command)) elif prefix[1] == constants.CMD_STOP: length = result.read("!B")[0] - 1 result.read("!%sx" % length) @@ -179,6 +251,11 @@ _message.string += struct.pack("!Bd", constants.TYPE_DOUBLE, value) _sendExact() +def _sendByteCmd(cmdID, varID, objID, value): + _beginMessage(cmdID, varID, objID, 1+1) + _message.string += struct.pack("!BB", constants.TYPE_BYTE, value) + _sendExact() + def _sendStringCmd(cmdID, varID, objID, value): _beginMessage(cmdID, varID, objID, 1+4+len(value)) _message.string += struct.pack("!Bi", constants.TYPE_STRING, @@ -191,24 +268,44 @@ response, retVarID = result.read("!BB") objectID = result.readString() if response - cmdID != 16 or retVarID != varID or objectID != objID: - print "Error! Received answer %s,%s,%s for command %s,%s,%s."\ - % (response, retVarID, objectID, cmdID, varID, objID) + raise FatalTraCIError("Received answer %s,%s,%s for command %s,%s,%s."\ + % (response, retVarID, objectID, cmdID, varID, objID)) result.read("!B") # Return type of the variable return result def _readSubscription(result): +# result.printDebug() # to enable this you also need to set _DEBUG to True result.readLength() response = result.read("!B")[0] + isVariableSubscription = response>=constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE and response<=constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE objectID = result.readString() + if not isVariableSubscription: + domain = result.read("!B")[0] numVars = result.read("!B")[0] - while numVars > 0: - varID = result.read("!B")[0] - status, varType = result.read("!BB") - if status: - print "Error!", result.readString() - elif response in _modules: - _modules[response]._addSubscriptionResult(objectID, varID, result) - numVars -= 1 + if isVariableSubscription: + while numVars > 0: + varID = result.read("!B")[0] + status, varType = result.read("!BB") + if status: + print "Error!", result.readString() + elif response in _modules: + _modules[response].subscriptionResults.add(objectID, varID, result) + else: + raise FatalTraCIError("Cannot handle subscription response %02x for %s." % (response, objectID)) + numVars -= 1 + else: + objectNo = result.read("!i")[0] + for o in range(0, objectNo): + oid = result.readString() + for v in range(0, numVars): + varID = result.read("!B")[0] + status, varType = result.read("!BB") + if status: + print "Error!", result.readString() + elif response in _modules: + _modules[response].subscriptionResults.addContext(objectID, _modules[domain].subscriptionResults, oid, varID, result) + else: + raise FatalTraCIError("Cannot handle subscription response %02x for %s." % (response, objectID)) return response, objectID def _subscribe(cmdID, begin, end, objID, varIDs): @@ -218,16 +315,30 @@ _message.string += struct.pack("!B", length) else: _message.string += struct.pack("!Bi", 0, length+4) - _message.string += struct.pack("!Biii", cmdID, - begin, end, len(objID)) + objID + _message.string += struct.pack("!Biii", cmdID, begin, end, len(objID)) + objID _message.string += struct.pack("!B", len(varIDs)) for v in varIDs: _message.string += struct.pack("!B", v) result = _sendExact() response, objectID = _readSubscription(result) if response - cmdID != 16 or objectID != objID: - print "Error! Received answer %s,%s for subscription command %s,%s."\ - % (response, objectID, cmdID, objID) + raise FatalTraCIError("Received answer %02x,%s for subscription command %02x,%s." % (response, objectID, cmdID, objID)) + +def _subscribeContext(cmdID, begin, end, objID, domain, dist, varIDs): + _message.queue.append(cmdID) + length = 1+1+4+4+4+len(objID)+1+8+1+len(varIDs) + if length<=255: + _message.string += struct.pack("!B", length) + else: + _message.string += struct.pack("!Bi", 0, length+4) + _message.string += struct.pack("!Biii", cmdID, begin, end, len(objID)) + objID + _message.string += struct.pack("!BdB", domain, dist, len(varIDs)) + for v in varIDs: + _message.string += struct.pack("!B", v) + result = _sendExact() + response, objectID = _readSubscription(result) + if response - cmdID != 16 or objectID != objID: + raise FatalTraCIError("Received answer %02x,%s for context subscription command %02x,%s." % (response, objectID, cmdID, objID)) def init(port=8813, numRetries=10, host="localhost", label="default"): if _embedded: @@ -251,11 +362,14 @@ _message.string += struct.pack("!BBi", 1+1+4, constants.CMD_SIMSTEP2, step) result = _sendExact() for module in _modules.itervalues(): - module._resetSubscriptionResults() + module.subscriptionResults.reset() numSubs = result.readInt() + responses = [] while numSubs > 0: - _readSubscription(result) + response, objectID = _readSubscription(result) + responses.append((objectID, response)) numSubs -= 1 + return responses def getVersion(): command = constants.CMD_GETVERSION @@ -265,7 +379,7 @@ result.readLength() response = result.read("!B")[0] if response != command: - print "Error! Received answer %s for command %s." % (response, command) + raise FatalTraCIError("Received answer %s for command %s." % (response, command)) return result.readInt(), result.readString() def close(): diff -Nru sumo-0.15.0~dfsg/tools/traci/constants.py sumo-0.16.0~dfsg/tools/traci/constants.py --- sumo-0.15.0~dfsg/tools/traci/constants.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/constants.py 2012-12-04 00:26:11.000000000 +0000 @@ -2,7 +2,7 @@ @file constants.py This script contains TraCI constant definitions from /src/traci-server/TraCIConstants.h -generated by "rebuildConstants.py" on 2012-01-10 23:45:56.134670. +generated by "rebuildConstants.py" on 2012-12-03 12:37:11.425000. SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2009-2012 DLR (http://www.dlr.de/) and contributors @@ -14,7 +14,8 @@ # **************************************** # VERSION # **************************************** -TRACI_VERSION = 3 +TRACI_VERSION = 5 + # **************************************** # COMMANDS @@ -22,7 +23,7 @@ # command: get version CMD_GETVERSION = 0x00 -# command: simulation step (new version) +# command: simulation step CMD_SIMSTEP2 = 0x02 # command: stop node @@ -37,23 +38,17 @@ # command: change target CMD_CHANGETARGET = 0x31 -# command: Position Conversion -CMD_POSITIONCONVERSION = 0x71 - -# command: Distance Request -CMD_DISTANCEREQUEST = 0x72 - # command: add vehicle CMD_ADDVEHICLE = 0x74 -# command: move node -CMD_MOVENODE = 0x80 - # command: close sumo CMD_CLOSE = 0x7F - +# command: subscribe induction loop (e1) context +CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = 0x80 +# response: subscribe induction loop (e1) context +RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = 0x90 # command: get induction loop (e1) variable CMD_GET_INDUCTIONLOOP_VARIABLE = 0xa0 # response: get induction loop (e1) variable @@ -63,6 +58,10 @@ # response: subscribe induction loop (e1) variable RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = 0xe0 +# command: subscribe areal detector (e3) context +CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = 0x81 +# response: subscribe areal detector (e3) context +RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = 0x91 # command: get multi-entry/multi-exit detector (e3) variable CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = 0xa1 # response: get areal detector (e3) variable @@ -72,6 +71,10 @@ # response: subscribe areal detector (e3) variable RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = 0xe1 +# command: subscribe traffic lights context +CMD_SUBSCRIBE_TL_CONTEXT = 0x82 +# response: subscribe traffic lights context +RESPONSE_SUBSCRIBE_TL_CONTEXT = 0x92 # command: get traffic lights variable CMD_GET_TL_VARIABLE = 0xa2 # response: get traffic lights variable @@ -83,6 +86,10 @@ # response: subscribe traffic lights variable RESPONSE_SUBSCRIBE_TL_VARIABLE = 0xe2 +# command: subscribe lane context +CMD_SUBSCRIBE_LANE_CONTEXT = 0x83 +# response: subscribe lane context +RESPONSE_SUBSCRIBE_LANE_CONTEXT = 0x93 # command: get lane variable CMD_GET_LANE_VARIABLE = 0xa3 # response: get lane variable @@ -94,6 +101,10 @@ # response: subscribe lane variable RESPONSE_SUBSCRIBE_LANE_VARIABLE = 0xe3 +# command: subscribe vehicle context +CMD_SUBSCRIBE_VEHICLE_CONTEXT = 0x84 +# response: subscribe vehicle context +RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT = 0x94 # command: get vehicle variable CMD_GET_VEHICLE_VARIABLE = 0xa4 # response: get vehicle variable @@ -105,6 +116,10 @@ # response: subscribe vehicle variable RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE = 0xe4 +# command: subscribe vehicle type context +CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT = 0x85 +# response: subscribe vehicle type context +RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT = 0x95 # command: get vehicle type variable CMD_GET_VEHICLETYPE_VARIABLE = 0xa5 # response: get vehicle type variable @@ -116,6 +131,10 @@ # response: subscribe vehicle type variable RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE = 0xe5 +# command: subscribe route context +CMD_SUBSCRIBE_ROUTE_CONTEXT = 0x86 +# response: subscribe route context +RESPONSE_SUBSCRIBE_ROUTE_CONTEXT = 0x96 # command: get route variable CMD_GET_ROUTE_VARIABLE = 0xa6 # response: get route variable @@ -127,6 +146,10 @@ # response: subscribe route variable RESPONSE_SUBSCRIBE_ROUTE_VARIABLE = 0xe6 +# command: subscribe poi context +CMD_SUBSCRIBE_POI_CONTEXT = 0x87 +# response: subscribe poi context +RESPONSE_SUBSCRIBE_POI_CONTEXT = 0x97 # command: get poi variable CMD_GET_POI_VARIABLE = 0xa7 # response: get poi variable @@ -138,6 +161,10 @@ # response: subscribe poi variable RESPONSE_SUBSCRIBE_POI_VARIABLE = 0xe7 +# command: subscribe polygon context +CMD_SUBSCRIBE_POLYGON_CONTEXT = 0x88 +# response: subscribe polygon context +RESPONSE_SUBSCRIBE_POLYGON_CONTEXT = 0x98 # command: get polygon variable CMD_GET_POLYGON_VARIABLE = 0xa8 # response: get polygon variable @@ -149,6 +176,10 @@ # response: subscribe polygon variable RESPONSE_SUBSCRIBE_POLYGON_VARIABLE = 0xe8 +# command: subscribe junction context +CMD_SUBSCRIBE_JUNCTION_CONTEXT = 0x89 +# response: subscribe junction context +RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT = 0x99 # command: get junction variable CMD_GET_JUNCTION_VARIABLE = 0xa9 # response: get junction variable @@ -160,6 +191,10 @@ # response: subscribe junction variable RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE = 0xe9 +# command: subscribe edge context +CMD_SUBSCRIBE_EDGE_CONTEXT = 0x8a +# response: subscribe edge context +RESPONSE_SUBSCRIBE_EDGE_CONTEXT = 0x9a # command: get edge variable CMD_GET_EDGE_VARIABLE = 0xaa # response: get edge variable @@ -171,6 +206,10 @@ # response: subscribe edge variable RESPONSE_SUBSCRIBE_EDGE_VARIABLE = 0xea +# command: subscribe simulation context +CMD_SUBSCRIBE_SIM_CONTEXT = 0x8b +# response: subscribe simulation context +RESPONSE_SUBSCRIBE_SIM_CONTEXT = 0x9b # command: get simulation variable CMD_GET_SIM_VARIABLE = 0xab # response: get simulation variable @@ -182,6 +221,10 @@ # response: subscribe simulation variable RESPONSE_SUBSCRIBE_SIM_VARIABLE = 0xeb +# command: subscribe GUI context +CMD_SUBSCRIBE_GUI_CONTEXT = 0x8c +# response: subscribe GUI context +RESPONSE_SUBSCRIBE_GUI_CONTEXT = 0x9c # command: get GUI variable CMD_GET_GUI_VARIABLE = 0xac # response: get GUI variable @@ -194,7 +237,6 @@ RESPONSE_SUBSCRIBE_GUI_VARIABLE = 0xec - # **************************************** # POSITION REPRESENTATIONS # **************************************** @@ -210,7 +252,6 @@ POSITION_ROADMAP = 0x04 - # **************************************** # DATA TYPES # **************************************** @@ -240,7 +281,6 @@ TYPE_COLOR = 0x11 - # **************************************** # RESULT TYPES # **************************************** @@ -257,7 +297,6 @@ INVALID_INT_VALUE = -1 - # **************************************** # TRAFFIC LIGHT PHASES # **************************************** @@ -273,7 +312,6 @@ TLPHASE_NOSIGNAL = 0x05 - # **************************************** # DIFFERENT DISTANCE REQUESTS # **************************************** @@ -283,6 +321,20 @@ REQUEST_DRIVINGDIST = 0x01 +# **************************************** +# VEHICLE REMOVAL REASONS +# **************************************** +# vehicle started teleport +REMOVE_TELEPORT = 0x00 +# vehicle removed while parking +REMOVE_PARKING = 0x01 +# vehicle arrived +REMOVE_ARRIVED = 0x02 +# vehicle was vaporized +REMOVE_VAPORIZED = 0x03 +# vehicle finished route during teleport +REMOVE_TELEPORT_ARRIVED = 0x04 + # **************************************** # VARIABLE TYPES (for CMD_GET_*_VARIABLE) @@ -293,6 +345,12 @@ # count of instances (get: all) ID_COUNT = 0x01 +# subscribe object variables (get: all) +OBJECT_VARIABLES_SUBSCRIPTION = 0x02 + +# subscribe context variables (get: all) +SURROUNDING_VARIABLES_SUBSCRIPTION = 0x03 + # last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges) LAST_STEP_VEHICLE_NUMBER = 0x10 @@ -477,6 +535,8 @@ # how speed is set (set: vehicle) VAR_SPEEDSETMODE = 0xb3 +# move vehicle, VTD version (set: vehicle) +VAR_MOVE_TO_VTD = 0xb4 @@ -501,6 +561,10 @@ # current noise emission of a node (get: vehicle, lane, edge) VAR_NOISEEMISSION = 0x66 +# current person number (get: vehicle) +VAR_PERSON_NUMBER = 0x67 +VAR_BUS_STOP_WAITING = 0x67 + # current time step (get: simulation) @@ -570,7 +634,6 @@ VAR_ROUTE_VALID = 0x92 - # zoom VAR_VIEW_ZOOM = 0xa0 @@ -590,4 +653,3 @@ VAR_TRACK_VEHICLE = 0xa6 - diff -Nru sumo-0.15.0~dfsg/tools/traci/edge.py sumo-0.16.0~dfsg/tools/traci/edge.py --- sumo-0.15.0~dfsg/tools/traci/edge.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/edge.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file edge.py @author Michael Behrisch @date 2011-03-17 -@version $Id: edge.py 11663 2012-01-06 09:47:01Z behrisch $ +@version $Id: edge.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -32,7 +32,7 @@ tc.LAST_STEP_VEHICLE_NUMBER: traci.Storage.readInt, tc.LAST_STEP_VEHICLE_HALTING_NUMBER: traci.Storage.readInt, tc.LAST_STEP_VEHICLE_ID_LIST: traci.Storage.readStringList} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, edgeID): result = traci._sendReadOneStringCmd(tc.CMD_GET_EDGE_VARIABLE, varID, edgeID) @@ -184,17 +184,9 @@ Subscribe to one or more edge values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_EDGE_VARIABLE, begin, end, edgeID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(edgeID, varID, data): - if edgeID not in subscriptionResults: - subscriptionResults[edgeID] = {} - subscriptionResults[edgeID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(edgeID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -205,9 +197,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if edgeID == None: - return subscriptionResults - return subscriptionResults.get(edgeID, None) + return subscriptionResults.get(edgeID) + +def subscribeContext(edgeID, domain, dist, varIDs=(tc.LAST_STEP_VEHICLE_NUMBER,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_EDGE_CONTEXT, begin, end, edgeID, domain, dist, varIDs) + +def getContextSubscriptionResults(edgeID=None): + return subscriptionResults.getContext(edgeID) def adaptTraveltime(edgeID, time): diff -Nru sumo-0.15.0~dfsg/tools/traci/gui.py sumo-0.16.0~dfsg/tools/traci/gui.py --- sumo-0.15.0~dfsg/tools/traci/gui.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/gui.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2011-03-09 -@version $Id: gui.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: gui.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -21,7 +21,7 @@ tc.VAR_VIEW_OFFSET: lambda(result): result.read("!dd"), tc.VAR_VIEW_SCHEMA: traci.Storage.readString, tc.VAR_VIEW_BOUNDARY: lambda(result): (result.read("!dd"), result.read("!dd"))} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, viewID): result = traci._sendReadOneStringCmd(tc.CMD_GET_GUI_VARIABLE, varID, viewID) @@ -69,17 +69,9 @@ Subscribe to one or more gui values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_GUI_VARIABLE, begin, end, viewID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(viewID, varID, data): - if viewID not in subscriptionResults: - subscriptionResults[viewID] = {} - subscriptionResults[viewID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(viewID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -90,9 +82,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if viewID == None: - return subscriptionResults - return subscriptionResults.get(viewID, None) + return subscriptionResults.get(viewID) + +def subscribeContext(viewID, domain, dist, varIDs=(tc.VAR_VIEW_OFFSET,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_GUI_CONTEXT, begin, end, viewID, domain, dist, varIDs) + +def getContextSubscriptionResults(viewID=None): + return subscriptionResults.getContext(viewID) def setZoom(viewID, zoom): diff -Nru sumo-0.15.0~dfsg/tools/traci/inductionloop.py sumo-0.16.0~dfsg/tools/traci/inductionloop.py --- sumo-0.15.0~dfsg/tools/traci/inductionloop.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/inductionloop.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2011-03-16 -@version $Id: inductionloop.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: inductionloop.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -43,7 +43,7 @@ tc.LAST_STEP_LENGTH: traci.Storage.readDouble, tc.LAST_STEP_TIME_SINCE_DETECTION: traci.Storage.readDouble, tc.LAST_STEP_VEHICLE_DATA: readVehicleData} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, loopID): result = traci._sendReadOneStringCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, varID, loopID) @@ -126,17 +126,9 @@ Subscribe to one or more induction loop values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE, begin, end, loopID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(loopID, varID, data): - if loopID not in subscriptionResults: - subscriptionResults[loopID] = {} - subscriptionResults[loopID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(loopID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -147,6 +139,11 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if loopID == None: - return subscriptionResults - return subscriptionResults.get(loopID, None) + return subscriptionResults.get(loopID) + +def subscribeContext(loopID, domain, dist, varIDs=(tc.LAST_STEP_VEHICLE_NUMBER,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT, begin, end, loopID, domain, dist, varIDs) + +def getContextSubscriptionResults(loopID=None): + return subscriptionResults.getContext(loopID) diff -Nru sumo-0.15.0~dfsg/tools/traci/junction.py sumo-0.16.0~dfsg/tools/traci/junction.py --- sumo-0.15.0~dfsg/tools/traci/junction.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/junction.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file junction.py @author Michael Behrisch @date 2011-03-17 -@version $Id: junction.py 11453 2011-11-02 09:40:25Z behrisch $ +@version $Id: junction.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -16,7 +16,7 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStringList, tc.VAR_POSITION: lambda(result): result.read("!dd")} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, junctionID): result = traci._sendReadOneStringCmd(tc.CMD_GET_JUNCTION_VARIABLE, varID, junctionID) @@ -43,17 +43,9 @@ Subscribe to one or more junction values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_JUNCTION_VARIABLE, begin, end, junctionID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(junctionID, varID, data): - if junctionID not in subscriptionResults: - subscriptionResults[junctionID] = {} - subscriptionResults[junctionID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(junctionID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -64,6 +56,11 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if junctionID == None: - return subscriptionResults - return subscriptionResults.get(junctionID, None) + return subscriptionResults.get(junctionID) + +def subscribeContext(junctionID, domain, dist, varIDs=(tc.VAR_POSITION,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_JUNCTION_CONTEXT, begin, end, junctionID, domain, dist, varIDs) + +def getContextSubscriptionResults(junctionID=None): + return subscriptionResults.getContext(junctionID) diff -Nru sumo-0.15.0~dfsg/tools/traci/lane.py sumo-0.16.0~dfsg/tools/traci/lane.py --- sumo-0.15.0~dfsg/tools/traci/lane.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/lane.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2011-03-17 -@version $Id: lane.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: lane.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -64,7 +64,7 @@ tc.LAST_STEP_VEHICLE_NUMBER: traci.Storage.readInt, tc.LAST_STEP_VEHICLE_HALTING_NUMBER: traci.Storage.readInt, tc.LAST_STEP_VEHICLE_ID_LIST: traci.Storage.readStringList} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, laneID): result = traci._sendReadOneStringCmd(tc.CMD_GET_LANE_VARIABLE, varID, laneID) @@ -246,17 +246,9 @@ Subscribe to one or more lane values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_LANE_VARIABLE, begin, end, laneID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(laneID, varID, data): - if laneID not in subscriptionResults: - subscriptionResults[laneID] = {} - subscriptionResults[laneID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(laneID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -267,9 +259,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if laneID == None: - return subscriptionResults - return subscriptionResults.get(laneID, None) + return subscriptionResults.get(laneID) + +def subscribeContext(laneID, domain, dist, varIDs=(tc.LAST_STEP_VEHICLE_NUMBER,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_LANE_CONTEXT, begin, end, laneID, domain, dist, varIDs) + +def getContextSubscriptionResults(laneID=None): + return subscriptionResults.getContext(laneID) def setAllowed(laneID, allowedClasses): diff -Nru sumo-0.15.0~dfsg/tools/traci/multientryexit.py sumo-0.16.0~dfsg/tools/traci/multientryexit.py --- sumo-0.15.0~dfsg/tools/traci/multientryexit.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/multientryexit.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file multientryexit.py @author Michael Behrisch @date 2011-03-16 -@version $Id: multientryexit.py 11453 2011-11-02 09:40:25Z behrisch $ +@version $Id: multientryexit.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -19,7 +19,7 @@ tc.LAST_STEP_MEAN_SPEED: traci.Storage.readDouble, tc.LAST_STEP_VEHICLE_ID_LIST: traci.Storage.readStringList, tc.LAST_STEP_VEHICLE_HALTING_NUMBER: traci.Storage.readInt} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, detID): result = traci._sendReadOneStringCmd(tc.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, varID, detID) @@ -67,17 +67,9 @@ Subscribe to one or more detector values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, begin, end, detID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(detID, varID, data): - if detID not in subscriptionResults: - subscriptionResults[detID] = {} - subscriptionResults[detID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(detID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -88,6 +80,11 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if detID == None: - return subscriptionResults - return subscriptionResults.get(detID, None) + return subscriptionResults.get(detID) + +def subscribeContext(detID, domain, dist, varIDs=(tc.LAST_STEP_VEHICLE_NUMBER,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT, begin, end, detID, domain, dist, varIDs) + +def getContextSubscriptionResults(detID=None): + return subscriptionResults.getContext(detID) diff -Nru sumo-0.15.0~dfsg/tools/traci/poi.py sumo-0.16.0~dfsg/tools/traci/poi.py --- sumo-0.15.0~dfsg/tools/traci/poi.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/poi.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Lena Kalleske @date 2008-10-09 -@version $Id: poi.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: poi.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -19,7 +19,7 @@ tc.VAR_TYPE: traci.Storage.readString, tc.VAR_POSITION: lambda(result): result.read("!dd"), tc.VAR_COLOR: lambda(result): result.read("!BBBB")} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, poiID): result = traci._sendReadOneStringCmd(tc.CMD_GET_POI_VARIABLE, varID, poiID) @@ -60,17 +60,9 @@ Subscribe to one or more poi values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_POI_VARIABLE, begin, end, poiID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(poiID, varID, data): - if poiID not in subscriptionResults: - subscriptionResults[poiID] = {} - subscriptionResults[poiID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(poiID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -81,9 +73,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if poiID == None: - return subscriptionResults - return subscriptionResults.get(poiID, None) + return subscriptionResults.get(poiID) + +def subscribeContext(poiID, domain, dist, varIDs=(tc.VAR_POSITION,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_POI_CONTEXT, begin, end, poiID, domain, dist, varIDs) + +def getContextSubscriptionResults(poiID=None): + return subscriptionResults.getContext(poiID) def setType(poiID, poiType): diff -Nru sumo-0.15.0~dfsg/tools/traci/polygon.py sumo-0.16.0~dfsg/tools/traci/polygon.py --- sumo-0.15.0~dfsg/tools/traci/polygon.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/polygon.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file polygon.py @author Michael Behrisch @date 2011-03-16 -@version $Id: polygon.py 11453 2011-11-02 09:40:25Z behrisch $ +@version $Id: polygon.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -18,7 +18,7 @@ tc.VAR_TYPE: traci.Storage.readString, tc.VAR_SHAPE: traci.Storage.readShape, tc.VAR_COLOR: lambda(result): result.read("!BBBB")} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, polygonID): result = traci._sendReadOneStringCmd(tc.CMD_GET_POLYGON_VARIABLE, varID, polygonID) @@ -59,17 +59,9 @@ Subscribe to one or more polygon values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_POLYGON_VARIABLE, begin, end, polygonID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(polygonID, varID, data): - if polygonID not in subscriptionResults: - subscriptionResults[polygonID] = {} - subscriptionResults[polygonID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(polygonID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -80,9 +72,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if polygonID == None: - return subscriptionResults - return subscriptionResults.get(polygonID, None) + return subscriptionResults.get(polygonID) + +def subscribeContext(polygonID, domain, dist, varIDs=(tc.VAR_SHAPE,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_POLYGON_CONTEXT, begin, end, polygonID, domain, dist, varIDs) + +def getContextSubscriptionResults(polygonID=None): + return subscriptionResults.getContext(polygonID) def setType(polygonID, polygonType): diff -Nru sumo-0.15.0~dfsg/tools/traci/route.py sumo-0.16.0~dfsg/tools/traci/route.py --- sumo-0.15.0~dfsg/tools/traci/route.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/route.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Lena Kalleske @date 2008-10-09 -@version $Id: route.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: route.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -17,7 +17,7 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStringList, tc.VAR_EDGES: traci.Storage.readStringList} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, routeID): result = traci._sendReadOneStringCmd(tc.CMD_GET_ROUTE_VARIABLE, varID, routeID) @@ -44,17 +44,9 @@ Subscribe to one or more route values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_ROUTE_VARIABLE, begin, end, routeID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(routeID, varID, data): - if routeID not in subscriptionResults: - subscriptionResults[routeID] = {} - subscriptionResults[routeID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(routeID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -65,9 +57,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if routeID == None: - return subscriptionResults - return subscriptionResults.get(routeID, None) + return subscriptionResults.get(routeID) + +def subscribeContext(routeID, domain, dist, varIDs=(tc.ID_LIST,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_ROUTE_CONTEXT, begin, end, routeID, domain, dist, varIDs) + +def getContextSubscriptionResults(routeID=None): + return subscriptionResults.getContext(routeID) def add(routeID, edges): diff -Nru sumo-0.15.0~dfsg/tools/traci/simulation.py sumo-0.16.0~dfsg/tools/traci/simulation.py --- sumo-0.15.0~dfsg/tools/traci/simulation.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/simulation.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file simulation.py @author Michael Behrisch @date 2011-03-15 -@version $Id: simulation.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: simulation.py 13076 2012-11-29 07:05:59Z behrisch $ Python implementation of the TraCI interface. @@ -28,7 +28,7 @@ tc.VAR_TELEPORT_ENDING_VEHICLES_IDS: traci.Storage.readStringList, tc.VAR_DELTA_T: traci.Storage.readInt, tc.VAR_NET_BOUNDING_BOX: lambda(result): (result.read("!dd"), result.read("!dd"))} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID): result = traci._sendReadOneStringCmd(tc.CMD_GET_SIM_VARIABLE, varID, "") @@ -57,29 +57,25 @@ def getDepartedNumber(): """getDepartedNumber() -> integer - - . + returns the number vehicles which departed in the last time step. """ return _getUniversal(tc.VAR_DEPARTED_VEHICLES_NUMBER) def getDepartedIDList(): """getDepartedIDList() -> list(string) - - . + returns the list of ids of all vehicles which departed in the last time step. """ return _getUniversal(tc.VAR_DEPARTED_VEHICLES_IDS) def getArrivedNumber(): """getArrivedNumber() -> integer - - . + returns the number vehicles which arrived in the last time step. """ return _getUniversal(tc.VAR_ARRIVED_VEHICLES_NUMBER) def getArrivedIDList(): """getArrivedIDList() -> list(string) - - . + returns the list of ids of all vehicles which arrived in the last time step. """ return _getUniversal(tc.VAR_ARRIVED_VEHICLES_IDS) @@ -136,23 +132,35 @@ posType = tc.POSITION_2D if toGeo: posType = tc.POSITION_LAT_LON - traci._beginMessage(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "", 1+4 + 1+4+len(edgeID)+8+1 + 1+8+8) + traci._beginMessage(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "", 1+4 + 1+4+len(edgeID)+8+1 + 1+1) traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2) traci._message.string += struct.pack("!Bi", tc.POSITION_ROADMAP, len(edgeID)) + edgeID - traci._message.string += struct.pack("!dBBdd", pos, laneIndex, posType, 0., 0.) + traci._message.string += struct.pack("!dBBB", pos, laneIndex, tc.TYPE_UBYTE, posType) return traci._checkResult(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "").read("!dd") def convertRoad(x, y, isGeo=False): posType = tc.POSITION_2D if isGeo: posType = tc.POSITION_LAT_LON - traci._beginMessage(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "", 1+4 + 1+8+8 + 1+4+8+1) + traci._beginMessage(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "", 1+4 + 1+8+8 + 1+1) traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2) traci._message.string += struct.pack("!Bdd", posType, x, y) - traci._message.string += struct.pack("!BidB", tc.POSITION_ROADMAP, 0, 0., 0) + traci._message.string += struct.pack("!BB", tc.TYPE_UBYTE, tc.POSITION_ROADMAP) result = traci._checkResult(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "") return result.readString(), result.readDouble(), result.read("!B")[0] +def convertGeo(x, y, fromGeo=False): + fromType = tc.POSITION_2D + toType = tc.POSITION_LAT_LON + if fromGeo: + fromType = tc.POSITION_LAT_LON + toType = tc.POSITION_2D + traci._beginMessage(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "", 1+4 + 1+8+8 + 1+1) + traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2) + traci._message.string += struct.pack("!Bdd", fromType, x, y) + traci._message.string += struct.pack("!BB", tc.TYPE_UBYTE, toType) + return traci._checkResult(tc.CMD_GET_SIM_VARIABLE, tc.POSITION_CONVERSION, "").read("!dd") + def getDistance2D(x1, y1, x2, y2, isGeo=False, isDriving=False): """getDistance2D(double, double, double, double, boolean, boolean) -> double @@ -192,15 +200,9 @@ Subscribe to one or more simulation values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_SIM_VARIABLE, begin, end, "x", varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(objectID, varID, data): - subscriptionResults[varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(): """getSubscriptionResults() -> dict(integer: ) @@ -208,4 +210,4 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - return subscriptionResults + return subscriptionResults.get("x") diff -Nru sumo-0.15.0~dfsg/tools/traci/traciControl.py sumo-0.16.0~dfsg/tools/traci/traciControl.py --- sumo-0.15.0~dfsg/tools/traci/traciControl.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/traciControl.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,936 +0,0 @@ -# -*- coding: utf-8 -*- -""" -@file traciControl.py -@author Michael Behrisch -@author Lena Kalleske -@author Daniel Krajzewicz -@date 2008-10-09 -@version $Id: traciControl.py 11671 2012-01-07 20:14:30Z behrisch $ - -Python implementation of the TraCI interface. - -SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors -All rights reserved -""" -import socket, time, struct -import traciconstants as tc - -RESULTS = {0x00: "OK", 0x01: "Not implemented", 0xFF: "Error"} - -class FatalTraCIError: - def __init__(self, desc): - self._desc = desc - -class Phase: - def __init__(self, duration, duration1, duration2, phaseDef): - self._duration = duration - self._duration1 = duration1 - self._duration2 = duration2 - self._phaseDef = phaseDef - - def write(self): - print("Phase:") - print("duration: ", self._duration) - print("duration1: ", self._duration1) - print("duration2: ", self._duration2) - print("phaseDef: ", self._phaseDef) - -class Logic: - def __init__(self, subID, type, subParameter, currentPhaseIndex, phases): - self._subID = subID - self._type = type - self._subParameter = subParameter - self._currentPhaseIndex = currentPhaseIndex - self._phases = phases - - def write(self): - print("Logic:") - print("subID:", self._subID) - print("type:", self._type) - print("subParameter:", self._subParameter) - print("currentPhaseIndex:", self._currentPhaseIndex) - for i in range(len(self._phases)): - self._phases[i].write() - -class Message: - string = "" - queue = [] - - - -_socket = socket.socket() -_message = Message() - -class Storage: - def __init__(self, content): - self._content = content - self._pos = 0 - - def read(self, format): - oldPos = self._pos - self._pos += struct.calcsize(format) - return struct.unpack(format, self._content[oldPos:self._pos]) - - def readString(self): - length = self.read("!i")[0] - return self.read("!%ss" % length)[0] - - def readStringList(self): - n = self.read("!i")[0] - list = [] - for i in range(n): - list.append(self.readString()) - return list - - def ready(self): - return self._pos < len(self._content) - - -def _recvExact(): - global _socket - try: - result = "" - while len(result) < 4: - t = _socket.recv(4 - len(result)) - if not t: - return None - result += t - length = struct.unpack("!i", result)[0] - 4 - result = "" - while len(result) < length: - t = _socket.recv(length - len(result)) - if not t: - return None - result += t - return Storage(result) - except socket.error: - return None - -def _sendExact(): - global _socket - length = struct.pack("!i", len(_message.string)+4) - _socket.send(length) - _socket.send(_message.string) - _message.string = "" - result = _recvExact() - if not result: - _socket.close() - _socket = None - raise FatalTraCIError("connection closed by SUMO") - for command in _message.queue: - prefix = result.read("!BBB") - err = result.readString() - if prefix[2] or err: - print prefix, RESULTS[prefix[2]], err - elif prefix[1] != command: - print "Error! Received answer %s for command %s." % (prefix[1], command) - elif prefix[1] == tc.CMD_STOP: - length = result.read("!B")[0] - 1 - result.read("!%sx" % length) - _message.queue = [] - return result - -def readHead(result): - length = result.read("!B")[0] # Length - if length==0: - length = result.read("!i")[0] - result.read("!B") # Identifier - result.read("!B") # Variable - result.readString() # Induction Loop ID // Multi-Entry/Multi-Exit Detector ID // Traffic Light ID - result.read("!B") # Return type of the variable - - -def buildSendReadNew1StringParamCmd(domainID, cmdID, objID): - _message.queue.append(domainID) - length = 1+1+1+4+len(objID) - if length<=255: - _message.string += struct.pack("!BBBi", length, domainID, cmdID, len(objID)) + objID - else: - _message.string += struct.pack("!BiBBi", 0, length+4, domainID, cmdID, len(objID)) + objID - result = _sendExact() - readHead(result) - return result - -def beginChangeMessage(domainID, length, cmdID, objID): - _message.queue.append(domainID) - if length<=255: - _message.string += struct.pack("!BBBi", length, domainID, cmdID, len(objID)) + objID - else: - _message.string += struct.pack("!BiBBi", 0, length+4, domainID, cmdID, len(objID)) + objID - -def initTraCI(port, numRetries=10): - global _socket - _socket = socket.socket() - for wait in range(numRetries): - try: - _socket.connect(("localhost", port)) - _socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) - break - except socket.error: - time.sleep(wait) - - -def cmdSimulationStep(step, position=True): - """ - Make simulation step and simulate up to "step" second in sim time. - If *position* is True, then roadmap position coordinates (vehicle number, - edge number, distance from start) will be returned. - If *position* is False - step is made and only empty list is returned. - """ - if position: - return_type = tc.POSITION_ROADMAP - else: - return_type = tc.POSITION_NONE - - _message.queue.append(tc.CMD_SIMSTEP) - _message.string += struct.pack("!BBiB", 1+1+4+1, tc.CMD_SIMSTEP, step, return_type) - result = _sendExact() - updates = [] - while result.ready(): - if result.read("!BB")[1] == tc.CMD_MOVENODE: - updates.append((result.read("!iiB")[0], result.readString(), result.read("!dB")[0])) - return updates - -def cmdSimulationStep2(step): - """ - Make simulation step and simulate up to "step" second in sim time. - """ - _message.queue.append(tc.CMD_SIMSTEP2) - _message.string += struct.pack("!BBi", 1+1+4, tc.CMD_SIMSTEP2, step) - result = _sendExact() - subscriptions = [] -# while result.ready(): -# if result.read("!BB")[1] == tc.CMD_MOVENODE: -# updates.append((result.read("!iiB")[0], result.readString(), result.read("!dB")[0])) - return subscriptions - -def cmdSubscribeDomainVehicle_Position(position=True): - if position: - return_type = tc.POSITION_ROADMAP - else: - return_type = tc.POSITION_NONE - - _message.queue.append(tc.CMD_SIMSTEP) - _message.string += struct.pack("!BBiB", 1+1+8+1, tc.CMD_SIMSTEP, step, return_type) - result = _sendExact() - updates = [] - while result.ready(): - if result.read("!BB")[1] == tc.CMD_MOVENODE: - updates.append((result.read("!iiB")[0], result.readString(), result.read("!dB")[0])) - return updates - -# =================================================== -# induction loop interaction -# =================================================== -def cmdGetInductionLoopVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetInductionLoopVariable_position(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.VAR_POSITION, IndLoopID) - return result.read("!d")[0] # Variable value - -def cmdGetInductionLoopVariable_laneID(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.VAR_LANE_ID, IndLoopID) - return result.readString() - -def cmdGetInductionLoopVariable_lastStepVehicleNumber(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_VEHICLE_NUMBER, IndLoopID) - return result.read("!i")[0] # Variable value - -def cmdGetInductionLoopVariable_lastStepMeanSpeed(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_MEAN_SPEED, IndLoopID) - return result.read("!d")[0] # Variable value - -def cmdGetInductionLoopVariable_vehicleIds(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_VEHICLE_ID_LIST, IndLoopID) - return result.readStringList() # Variable value - -def cmdGetInductionLoopVariable_lastStepOccupancy(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_OCCUPANCY, IndLoopID) - return result.read("!d")[0] # Variable value - -def cmdGetInductionLoopVariable_lastMeanLength(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_LENGTH, IndLoopID) - return result.read("!d")[0] # Variable value - -def cmdGetInductionLoopVariable_timeSinceDetection(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_TIME_SINCE_DETECTION, IndLoopID) - return result.read("!d")[0] # Variable value - -def cmdGetInductionLoopVariable_vehicleData(IndLoopID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_INDUCTIONLOOP_VARIABLE, tc.LAST_STEP_VEHICLE_DATA, IndLoopID) - q = result.read("!Bi")[1] # Length - print q - nbData = result.read("!i")[0] # Number of data - print "%s %s", (IndLoopID, nbData) - data = [] - for i in range(nbData): - result.read("!B") - vehID = result.readString() - print " " + vehID - result.read("!B") - length = result.read("!d")[0] - print " %s" % length - result.read("!B") - entryTime = result.read("!d")[0] - print " %s" % entryTime - result.read("!B") - leaveTime = result.read("!d")[0] - print " %s" % leaveTime - result.read("!B") - typeID = result.readString() - print " %s" % typeID - data.append( [ vehID, length, entryTime, leaveTime, typeID ] ) - return data - - -# =================================================== -# multi-entry/multi-exit detector interaction -# =================================================== -def cmdGetMultiEntryExitDetectorVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetMultiEntryExitDetectorVariable_lastStepVehicleNumber(MultiEntryExitDetID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, tc.LAST_STEP_VEHICLE_NUMBER, MultiEntryExitDetID) - return result.read("!i")[0] # Variable value - -def cmdGetMultiEntryExitDetectorVariable_lastStepMeanSpeed(MultiEntryExitDetID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, tc.LAST_STEP_MEAN_SPEED, MultiEntryExitDetID) - return result.read("!d")[0] # Variable value - -def cmdGetMultiEntryExitDetectorVariable_vehicleIds(MultiEntryExitDetID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, tc.LAST_STEP_VEHICLE_ID_LIST, MultiEntryExitDetID) - return result.readStringList() # Variable value - -def cmdGetMultiEntryExitDetectorVariable_haltingNumber(MultiEntryExitDetID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, tc.LAST_STEP_VEHICLE_HALTING_NUMBER, MultiEntryExitDetID) - return result.read("!i")[0] # Variable value - - - -# =================================================== -# traffic lights interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetTrafficLightsVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetTrafficLightsVariable_stateRYG(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_RED_YELLOW_GREEN_STATE, TLID) - return result.readString() # Variable value - -def cmdGetTrafficLightsVariable_statePBY(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_PHASE_BRAKE_YELLOW_STATE, TLID) - return result.readStringList() # Variable value - -def cmdGetTrafficLightsVariable_completeDefinitionRYG(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_COMPLETE_DEFINITION_RYG, TLID) - result.read("!i") # Length - result.read("!B") # Type of Number of logics - nbLogics = result.read("!i")[0] # Number of logics - logics = [] - for i in range(nbLogics): - result.read("!B") # Type of SubID - subID = result.readString() - result.read("!B") # Type of Type - type = result.read("!i")[0] # Type - result.read("!B") # Type of SubParameter - subParameter = result.read("!i")[0] # SubParameter - result.read("!B") # Type of Current phase index - currentPhaseIndex = result.read("!i")[0] # Current phase index - result.read("!B") # Type of Number of phases - nbPhases = result.read("!i")[0] # Number of phases - phases = [] - for j in range(nbPhases): - result.read("!B") # Type of Duration - duration = result.read("!i")[0] # Duration - result.read("!B") # Type of Duration1 - duration1 = result.read("!i")[0] # Duration1 - result.read("!B") # Type of Duration2 - duration2 = result.read("!i")[0] # Duration2 - result.read("!B") # Type of Phase Definition - phaseDef = result.readString() # Phase Definition - phase = Phase(duration, duration1, duration2, phaseDef) - phases.append(phase) - logic = Logic(subID, type, subParameter, currentPhaseIndex, phases) - logics.append(logic) - return logics - -def cmdGetTrafficLightsVariable_controlledLanes(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_CONTROLLED_LANES, TLID) - return result.readStringList() # Variable value - -def cmdGetTrafficLightsVariable_controlledLinks(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_CONTROLLED_LINKS, TLID) - result.read("!iB") - nbSignals = result.read("!i")[0] # Length - signals = [] - for i in range(nbSignals): - result.read("!B") # Type of Number of Controlled Links - nbControlledLinks = result.read("!i")[0] # Number of Controlled Links - controlledLinks = [] - for j in range(nbControlledLinks): - result.read("!B") # Type of Link j - link = result.readStringList() # Link j - controlledLinks.append(link) - signals.append(controlledLinks) - return signals - - -def cmdGetTrafficLightsVariable_program(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_CURRENT_PROGRAM, TLID) - return result.readString() # Variable value - -def cmdGetTrafficLightsVariable_phase(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_CURRENT_PHASE, TLID) - return result.read("!i")[0] # Variable value - -def cmdGetTrafficLightsVariable_nextSwitchTime(TLID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_TL_VARIABLE, tc.TL_NEXT_SWITCH, TLID) - return result.read("!i")[0] # Variable value - - -# --------------------------------------------------- -# change state -# --------------------------------------------------- -def cmdChangeTrafficLightsVariable_stateRYG(TLID, state): - beginChangeMessage(tc.CMD_SET_TL_VARIABLE, 1+1+1+4+len(TLID)+1+4+len(state), tc.TL_RED_YELLOW_GREEN_STATE, TLID) - _message.string += struct.pack("!B", tc.TYPE_STRING) - _message.string += struct.pack("!i", len(state)) + state - _sendExact() - -def cmdChangeTrafficLightsVariable_phaseIndex(TLID, index): - beginChangeMessage(tc.CMD_SET_TL_VARIABLE, 1+1+1+4+len(TLID)+1+4, tc.TL_PHASE_INDEX, TLID) - _message.string += struct.pack("!Bi", tc.TYPE_INTEGER, index) - _sendExact() - -def cmdChangeTrafficLightsVariable_programID(TLID, programID): - beginChangeMessage(tc.CMD_SET_TL_VARIABLE, 1+1+1+4+len(TLID)+1+4+len(programID), tc.TL_PROGRAM, TLID) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(programID)) + programID - _sendExact() - -def cmdChangeTrafficLightsVariable_phaseDuration(TLID, phaseDuration): - beginChangeMessage(tc.CMD_SET_TL_VARIABLE, 1+1+1+4+len(TLID)+1+4, tc.TL_PHASE_DURATION, TLID) - _message.string += struct.pack("!Bi", tc.TYPE_INTEGER, phaseDuration) - _sendExact() - -def cmdChangeTrafficLightsVariable_completeRYG(TLID, tls): - length = 1+1+1+4+len(TLID) # basic - itemNo = 0 - length = length + 1+4 + 1+4+len(tls._subID) + 1+4 + 1+4 + 1+4 + 1+4 # tls parameter - itemNo = 1+1+1+1+1 - for p in tls._phases: - length = length + 1+4 + 1+4 + 1+4 + 1+4+len(p._phaseDef) - itemNo = itemNo + 4 - beginChangeMessage(tc.CMD_SET_TL_VARIABLE, length, tc.TL_COMPLETE_PROGRAM_RYG, TLID) - _message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, itemNo) # itemNo - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(tls._subID)) + tls._subID # programID - _message.string += struct.pack("!Bi", tc.TYPE_INTEGER, 0) # type - _message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 0) # subitems - _message.string += struct.pack("!Bi", tc.TYPE_INTEGER, tls._currentPhaseIndex) # index - _message.string += struct.pack("!Bi", tc.TYPE_INTEGER, len(tls._phases)) # phaseNo - for p in tls._phases: - _message.string += struct.pack("!BiBiBi", tc.TYPE_INTEGER, p._duration, tc.TYPE_INTEGER, p._duration1, tc.TYPE_INTEGER, p._duration2) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(p._phaseDef)) + p._phaseDef - _sendExact() - - - - -# =================================================== -# vehicle interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetVehicleVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.ID_LIST, "") - return result.readStringList() # Variable value - -def cmdGetVehicleVariable_speed(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_SPEED, vehID) - return result.read("!d")[0] # Variable value - -def cmdGetVehicleVariable_position(vehID): - """ - Returns the position of the named vehicle within the last step [m,m] - """ - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_POSITION, vehID) - return result.read("!dd") - -def cmdGetVehicleVariable_angle(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_ANGLE, vehID) - return result.read("!d")[0] # Variable value - -def cmdGetVehicleVariable_roadID(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_ROAD_ID, vehID) - return result.readString() # Variable value - -def cmdGetVehicleVariable_laneID(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_LANE_ID, vehID) - return result.readString() # Variable value - -def cmdGetVehicleVariable_laneIndex(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_LANE_INDEX, vehID) - return result.read("!i")[0] # Variable value - -def cmdGetVehicleVariable_typeID(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_TYPE, vehID) - return result.readString() # Variable value - -def cmdGetVehicleVariable_routeID(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_ROUTE_ID, vehID) - return result.readString() # Variable value - -def cmdGetVehicleVariable_lanePosition(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_LANEPOSITION, vehID) - return result.read("!d")[0] # Variable value - -def cmdGetVehicleVariable_color(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_COLOR, vehID) - return result.read("!BBBB") # Variable value - -def cmdGetVehicleVariable_bestLanes(vehID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_BEST_LANES, vehID) - result.read("!iB") - nbLanes = result.read("!i")[0] # Length - lanes = [] - for i in range(nbLanes): - result.read("!B") - laneID = result.readString() - length = result.read("!Bf")[1] - occupation = result.read("!Bf")[1] - offset = result.read("!Bb")[1] - allowsContinuation = result.read("!BB")[1] - nextLanesNo = result.read("!Bi")[1] - nextLanes = [] - for j in range(nextLanesNo): - nextLanes.append(result.readString()) - lanes.append( [laneID, length, occupation, offset, allowsContinuation, nextLanes ] ) - return lanes - - -# --------------------------------------------------- -# change state -# --------------------------------------------------- -def cmdChangeVehicleVariable_maxSpeed(vehID, speed): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4, tc.CMD_SETMAXSPEED, vehID) - _message.string += struct.pack("!Bf", tc.TYPE_FLOAT, speed) - _sendExact() - -def cmdChangeVehicleVariable_speed(vehID, speed): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+8, tc.VAR_SPEED, vehID) - _message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, speed) - _sendExact() - -def cmdChangeVehicleVariable_lanePosition(vehID, position): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+8, tc.VAR_LANEPOSITION, vehID) - _message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, position) - _sendExact() - -def cmdChangeVehicleVariable_stop(vehID, edgeID, pos, laneIndex, duration): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4+1+4+len(edgeID)+1+4+1+1+1+4, tc.CMD_STOP, vehID) - _message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 4) - _message.string += struct.pack("!B", tc.TYPE_STRING) - _message.string += struct.pack("!i", len(edgeID)) + edgeID - _message.string += struct.pack("!BfBBBi", tc.TYPE_FLOAT, pos, tc.TYPE_BYTE, laneIndex, tc.TYPE_INTEGER, duration) - _sendExact() - -def cmdChangeVehicleVariable_changeLane(vehID, laneIndex, duration): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4+1+1+1+4, tc.CMD_CHANGELANE, vehID) - _message.string += struct.pack("!BiBBBi", tc.TYPE_COMPOUND, 2, tc.TYPE_BYTE, laneIndex, tc.TYPE_INTEGER, duration) - _sendExact() - -def cmdChangeVehicleVariable_slowDown(vehID, speed, duration): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4+1+4+1+4, tc.CMD_SLOWDOWN, vehID) - _message.string += struct.pack("!BiBfBi", tc.TYPE_COMPOUND, 2, tc.TYPE_FLOAT, speed, tc.TYPE_INTEGER, duration) - _sendExact() - -def cmdChangeVehicleVariable_changeTarget(vehID, edgeID): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4+len(edgeID), tc.CMD_CHANGETARGET, vehID) - _message.string += struct.pack("!B", tc.TYPE_STRING) - _message.string += struct.pack("!i", len(edgeID)) + edgeID - _sendExact() - -def cmdChangeVehicleVariable_changeRoute(vehID, edgeList): - """ - 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 usasge: - cmdChangeVehicleVariable_changeRoute('1', ['1', '2', '4', '6', '7']) - - this changes route for vehicle id 1 to edges 1-2-4-6-7 - """ - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4+sum(map(len, edgeList))+4*len(edgeList), tc.VAR_ROUTE, vehID) - _message.string += struct.pack("!Bi", tc.TYPE_STRINGLIST, len(edgeList)) - for edge in edgeList: - _message.string += struct.pack("!i", len(edge)) + edge - _sendExact() - -def cmdChangeVehicleVariable_moveTo(vehID, laneID, pos): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4+1+4+len(laneID)+8, tc.VAR_MOVE_TO, vehID) - _message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(laneID)) + laneID - _message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, pos) - _sendExact() - -def cmdChangeVehicleVariable_reroute(vehID): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+5, tc.CMD_REROUTE_TRAVELTIME, vehID) - _message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 0) - _sendExact() - -def cmdChangeVehicleVariable_color(vehID, color): - beginChangeMessage(tc.CMD_SET_VEHICLE_VARIABLE, 1+1+1+4+len(vehID)+1+4, tc.VAR_COLOR, vehID) - _message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3])) - _sendExact() - - -# =================================================== -# vehicle type interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetVehicleTypeVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLETYPE_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetVehicleTypeVariable_length(vTypeID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_VEHICLETYPE_VARIABLE, tc.VAR_LENGTH, vTypeID) - return result.read("!d")[0] # Variable value - - - -# =================================================== -# route interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetRouteVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_ROUTE_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetRouteVariable_edges(routeID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_ROUTE_VARIABLE, tc.VAR_EDGES, routeID) - return result.readStringList() # Variable value - - -# =================================================== -# poi interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetPoiVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POI_VARIABLE, tc.ID_LIST, "") - return result.readStringList() # Variable value - -def cmdGetPoiVariable_type(poiID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POI_VARIABLE, tc.VAR_TYPE, poiID) - return result.readString() # Variable value - -def cmdGetPoiVariable_color(poiID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POI_VARIABLE, tc.VAR_COLOR, poiID) - return result.read("!BBBB") # Variable value - -def cmdGetPoiVariable_position(poiID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POI_VARIABLE, tc.VAR_POSITION, poiID) - return result.read("!dd") # Variable value - - -# =================================================== -# polygon interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetPolygonVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POLYGON_VARIABLE, tc.ID_LIST, "") - return result.readStringList() # Variable value - -def cmdGetPolygonVariable_type(polyID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POLYGON_VARIABLE, tc.VAR_TYPE, poiID) - return result.readString() # Variable value - -def cmdGetPolygonVariable_color(polyID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POLYGON_VARIABLE, tc.VAR_COLOR, poiID) - return result.read("!BBBB") # Variable value - -def cmdGetPolygonVariable_shape(polyID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_POLYGON_VARIABLE, tc.VAR_SHAPE, poiID) - length = result.read("!B")[0] - shape = [] - for i in length: - shape.append(result.read("!dd")) - - -# --------------------------------------------------- -# change state -# --------------------------------------------------- -def cmdChangePolygonVariable_type(polyID, type): - beginChangeMessage(tc.CMD_SET_POLYGON_VARIABLE, 1+1+1+4+len(polyID)+1+4+len(type), tc.VAR_TYPE, polyID) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(type)) + type - _sendExact() - -def cmdChangePolygonVariable_color(polyID, color): - beginChangeMessage(tc.CMD_SET_POLYGON_VARIABLE, 1+1+1+4+len(polyID)+1+4, tc.VAR_COLOR, polyID) - _message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3])) - _sendExact() - -def cmdChangePolygonVariable_shape(polyID, shape): - beginChangeMessage(tc.CMD_SET_POLYGON_VARIABLE, 1+1+1+4+len(polyID)+1+1+8*len(shape), tc.VAR_SHAPE, polyID) - _message.string += struct.pack("!BB", tc.TYPE_POLYGON, len(shape)) - for p in shape: - _message.string += struct.pack("!dd", p[0], p[1]) - _sendExact() - -def cmdChangePolygonVariable_add(polyID, type, color, fill, layer, shape): - length = 1+1+1+4+len(polyID)+ 1+4 + 1+4+len(type) + 1+4 + 1+1 + 1+4 + 1+1+len(shape)*8 - beginChangeMessage(tc.CMD_SET_POLYGON_VARIABLE, length, tc.ADD, polyID) - _message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 5) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(type)) + type - _message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3])) - if fill: - _message.string += struct.pack("!BB", tc.TYPE_UBYTE, 1) - else: - _message.string += struct.pack("!BB", tc.TYPE_UBYTE, 0) - _message.string += struct.pack("!Bi", tc.TYPE_INTEGER, layer) - _message.string += struct.pack("!BB", tc.TYPE_POLYGON, len(shape)) - for p in shape: - _message.string += struct.pack("!dd", p[0], p[1]) - _sendExact() - - - -# =================================================== -# nodes (junction/intersection) interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetJunctionVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_JUNCTION_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetJunctionVariable_position(nodeID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_JUNCTION_VARIABLE, tc.VAR_POSITION, nodeID) - return result.read("!dd") # Variable value - - - -# =================================================== -# lanes interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetLaneVariable_idList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.ID_LIST, "x") - return result.readStringList() # Variable value - -def cmdGetLaneVariable_length(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_LENGTH, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_speed(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_MAXSPEED, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_allowed(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LANE_ALLOWED, laneID) - return result.readStringList() # Variable value - -def cmdGetLaneVariable_disallowed(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LANE_DISALLOWED, laneID) - return result.readStringList() # Variable value - -def cmdGetLaneVariable_linkNumber(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LANE_LINK_NUMBER, laneID) - return result.read("!B")[0] # Variable value - -def cmdGetLaneVariable_edgeID(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LANE_EDGE_ID, laneID) - return result.readString() # Variable value - -def cmdGetLaneVariable_speed(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_MAXSPEED, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_CO2emission(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_CO2EMISSION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_COemission(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_COEMISSION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_HCemission(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_HCEMISSION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_PMxemission(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_PMXEMISSION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_NOxemission(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_NOXEMISSION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_fuelConsumption(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_FUELCONSUMPTION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_noiseEmission(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.VAR_NOISEEMISSION, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_meanSpeed(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LAST_STEP_MEAN_SPEED, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_occupancy(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LAST_STEP_OCCUPANCY, laneID) - return result.read("!d")[0] # Variable value - -def cmdGetLaneVariable_vehicleIDs(laneID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_LANE_VARIABLE, tc.LAST_STEP_VEHICLE_ID_LIST, laneID) - return result.readStringList() # Variable value - - -# --------------------------------------------------- -# change state -# --------------------------------------------------- -def cmdChangeLaneVariable_allowed(laneID, allowedClasses): - beginChangeMessage(tc.CMD_SET_LANE_VARIABLE, 1+1+1+4+len(laneID)+1+4+sum(map(len, allowedClasses))+4*len(allowedClasses), tc.LANE_ALLOWED, laneID) - _message.string += struct.pack("!Bi", tc.TYPE_STRINGLIST, len(allowedClasses)) - for c in allowedClasses: - _message.string += struct.pack("!i", len(c)) + c - _sendExact() - -def cmdChangeLaneVariable_disallowed(laneID, disallowedClasses): - beginChangeMessage(tc.CMD_SET_LANE_VARIABLE, 1+1+1+4+len(laneID)+1+4+sum(map(len, disallowedClasses))+4*len(disallowedClasses), tc.LANE_DISALLOWED, laneID) - _message.string += struct.pack("!Bi", tc.TYPE_STRINGLIST, len(disallowedClasses)) - for c in disallowedClasses: - _message.string += struct.pack("!i", len(c)) + c - _sendExact() - -def cmdChangeLaneVariable_maxSpeed(laneID, speed): - beginChangeMessage(tc.CMD_SET_LANE_VARIABLE, 1+1+1+4+len(laneID)+1+4, tc.VAR_MAXSPEED, laneID) - _message.string += struct.pack("!Bf", tc.TYPE_FLOAT, speed) - _sendExact() - -def cmdChangeLaneVariable_length(laneID, length): - beginChangeMessage(tc.CMD_SET_LANE_VARIABLE, 1+1+1+4+len(laneID)+1+4, tc.VAR_LENGTH, laneID) - _message.string += struct.pack("!Bf", tc.TYPE_FLOAT, length) - _sendExact() - - - -# =================================================== -# simulation interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetSimulationVariable_currentTime(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_SIM_VARIABLE, tc.VAR_TIME_STEP, "x") - return result.read("!i")[0] # Variable value - -def cmdGetSimulationVariable_departedIDList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_SIM_VARIABLE, tc.VAR_DEPARTED_VEHICLES_IDS, "x") - return result.readStringList() # Variable value - -def cmdGetSimulationVariable_arrivedIDList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_SIM_VARIABLE, tc.VAR_ARRIVED_VEHICLES_IDS, "x") - return result.readStringList() # Variable value - -def cmdGetSimulationVariable_startingTeleportIDList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_SIM_VARIABLE, tc.VAR_TELEPORT_STARTING_VEHICLES_IDS, "x") - return result.readStringList() # Variable value - -def cmdGetSimulationVariable_endingTeleportIDList(): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_SIM_VARIABLE, tc.VAR_TELEPORT_ENDING_VEHICLES_IDS, "x") - return result.readStringList() # Variable value - - - -# =================================================== -# view interaction -# =================================================== -# --------------------------------------------------- -# get state -# --------------------------------------------------- -def cmdGetViewVariable_zoom(viewID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_GUI_VARIABLE, tc.VAR_VIEW_ZOOM, viewID) - return result.read("!d")[0] # Variable value - -def cmdGetViewVariable_offset(viewID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_GUI_VARIABLE, tc.VAR_VIEW_OFFSET, viewID) - return result.read("!dd") # Variable value - -def cmdGetViewVariable_netSize(viewID): - result = buildSendReadNew1StringParamCmd(tc.CMD_GET_GUI_VARIABLE, tc.VAR_NET_SIZE, viewID) - return result.read("!dd") # Variable value - - -# --------------------------------------------------- -# change state -# --------------------------------------------------- -def cmdChangeViewVariable_scheme(viewID, schemeName): - beginChangeMessage(tc.CMD_SET_GUI_VARIABLE, 1+1+1+4+len(viewID)+1+4+len(schemeName), tc.VAR_VIEW_SCHEMA, viewID) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(schemeName)) + schemeName - _sendExact() - -def cmdChangeViewVariable_zoom(viewID, zoom): - beginChangeMessage(tc.CMD_SET_GUI_VARIABLE, 1+1+1+4+len(viewID)+1+4, tc.VAR_VIEW_ZOOM, viewID) - _message.string += struct.pack("!Bf", tc.TYPE_FLOAT, zoom) - _sendExact() - -def cmdChangeViewVariable_offset(viewID, offset): - beginChangeMessage(tc.CMD_SET_GUI_VARIABLE, 1+1+1+4+len(viewID)+1+4+4, tc.VAR_VIEW_OFFSET, viewID) - _message.string += struct.pack("!Bff", tc.POSITION_2D, offset[0], offset[1]) - _sendExact() - -def cmdChangeViewVariable_screenshot(viewID, filename): - beginChangeMessage(tc.CMD_SET_GUI_VARIABLE, 1+1+1+4+len(viewID)+1+4+len(filename), tc.VAR_SCREENSHOT, viewID) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(filename)) + filename - _sendExact() - -def cmdChangeViewVariable_track(viewID, vehID): - beginChangeMessage(tc.CMD_SET_GUI_VARIABLE, 1+1+1+4+len(viewID)+1+4+len(vehID), tc.VAR_TRACK_VEHICLE, viewID) - _message.string += struct.pack("!Bi", tc.TYPE_STRING, len(vehID)) + vehID - _sendExact() - - - - - - -# =================================================== -# -# =================================================== -def cmdStopNode(edge, objectID, pos=1., duration=10000): - _message.queue.append(tc.CMD_STOP) - _message.string += struct.pack("!BBiBi", 1+1+4+1+4+len(edge)+4+1+4+8, tc.CMD_STOP, objectID, tc.POSITION_ROADMAP, len(edge)) + edge - _message.string += struct.pack("!dBdi", pos, 0, 1., duration) - -def cmdChangeTarget(edge, objectID): - _message.queue.append(tc.CMD_CHANGETARGET) - _message.string += struct.pack("!BBii", 1+1+4+4+len(edge), tc.CMD_CHANGETARGET, objectID, len(edge)) + edge - -def cmdClose(): - global _socket - if _socket: - _message.queue.append(tc.CMD_CLOSE) - _message.string += struct.pack("!BB", 1+1, tc.CMD_CLOSE) - _sendExact() - _socket.close() - diff -Nru sumo-0.15.0~dfsg/tools/traci/traciconstants.py sumo-0.16.0~dfsg/tools/traci/traciconstants.py --- sumo-0.15.0~dfsg/tools/traci/traciconstants.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/traciconstants.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -""" -@file traciconstants.py - -This file exists for backward compatiblity only. - -SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ -Copyright (C) 2009-2012 DLR (http://www.dlr.de/) and contributors -All rights reserved -""" -from constants import * - -import sys -print >> sys.stderr, """traciconstants.py and traciControl.py are deprecated. -Please use the new Python API for TraCI.""" diff -Nru sumo-0.15.0~dfsg/tools/traci/trafficlights.py sumo-0.16.0~dfsg/tools/traci/trafficlights.py --- sumo-0.15.0~dfsg/tools/traci/trafficlights.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/trafficlights.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file trafficlights.py @author Michael Behrisch @date 2011-03-16 -@version $Id: trafficlights.py 11453 2011-11-02 09:40:25Z behrisch $ +@version $Id: trafficlights.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -96,7 +96,7 @@ tc.TL_CURRENT_PROGRAM: traci.Storage.readString, tc.TL_CURRENT_PHASE: traci.Storage.readInt, tc.TL_NEXT_SWITCH: traci.Storage.readInt} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, tlsID): result = traci._sendReadOneStringCmd(tc.CMD_GET_TL_VARIABLE, varID, tlsID) @@ -165,17 +165,9 @@ Subscribe to one or more traffic light values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_TL_VARIABLE, begin, end, tlsID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(tlsID, varID, data): - if tlsID not in subscriptionResults: - subscriptionResults[tlsID] = {} - subscriptionResults[tlsID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(tlsID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -186,9 +178,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if tlsID == None: - return subscriptionResults - return subscriptionResults.get(tlsID, None) + return subscriptionResults.get(tlsID) + +def subscribeContext(tlsID, domain, dist, varIDs=(tc.TL_CURRENT_PHASE,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_TL_CONTEXT, begin, end, tlsID, domain, dist, varIDs) + +def getContextSubscriptionResults(tlsID=None): + return subscriptionResults.getContext(tlsID) def setRedYellowGreenState(tlsID, state): diff -Nru sumo-0.15.0~dfsg/tools/traci/vehicle.py sumo-0.16.0~dfsg/tools/traci/vehicle.py --- sumo-0.15.0~dfsg/tools/traci/vehicle.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/vehicle.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Lena Kalleske @date 2011-03-09 -@version $Id: vehicle.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: vehicle.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -74,7 +74,7 @@ tc.VAR_TAU: traci.Storage.readDouble, tc.VAR_BEST_LANES: _readBestLanes, tc.DISTANCE_REQUEST: traci.Storage.readDouble} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, vehID): result = traci._sendReadOneStringCmd(tc.CMD_GET_VEHICLE_VARIABLE, varID, vehID) @@ -376,17 +376,9 @@ Subscribe to one or more vehicle values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_VEHICLE_VARIABLE, begin, end, vehID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(vehID, varID, data): - if vehID not in subscriptionResults: - subscriptionResults[vehID] = {} - subscriptionResults[vehID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(vehID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -397,9 +389,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if vehID == None: - return subscriptionResults - return subscriptionResults.get(vehID, None) + return subscriptionResults.get(vehID) + +def subscribeContext(vehID, domain, dist, varIDs=(tc.VAR_ROAD_ID, tc.VAR_LANEPOSITION), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_VEHICLE_CONTEXT, begin, end, vehID, domain, dist, varIDs) + +def getContextSubscriptionResults(vehID=None): + return subscriptionResults.getContext(vehID) def setMaxSpeed(vehID, speed): @@ -473,7 +470,7 @@ traci._sendIntCmd(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_SIGNALS, vehID, signals) def moveTo(vehID, laneID, pos): - traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_MOVE_TO, vehID, 1+4+1+4+len(laneID)+8) + traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_MOVE_TO, vehID, 1+4+1+4+len(laneID)+1+8) traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2) traci._message.string += struct.pack("!Bi", tc.TYPE_STRING, len(laneID)) + laneID traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, pos) @@ -540,3 +537,18 @@ traci._message.string += struct.pack("!BdBd", tc.TYPE_DOUBLE, pos, tc.TYPE_DOUBLE, speed) traci._message.string += struct.pack("!BB", tc.TYPE_BYTE, lane) traci._sendExact() + +def remove(vehID, reason=tc.REMOVE_VAPORIZED): + '''Remove vehicle with the given ID for the give reason. + Reasons are defined in module constants and start with REMOVE_''' + traci._sendByteCmd(tc.CMD_SET_VEHICLE_VARIABLE, tc.REMOVE, vehID, reason) + +def moveToVTD(vehID, edgeID, lane, x, y): + traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_MOVE_TO_VTD, vehID, 1+4+1+4+len(edgeID)+1+4+1+8+1+8) + traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 4) + traci._message.string += struct.pack("!Bi", tc.TYPE_STRING, len(edgeID)) + edgeID + traci._message.string += struct.pack("!Bi", tc.TYPE_INTEGER, lane) + traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, x) + traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, y) + traci._sendExact() + diff -Nru sumo-0.15.0~dfsg/tools/traci/vehicletype.py sumo-0.16.0~dfsg/tools/traci/vehicletype.py --- sumo-0.15.0~dfsg/tools/traci/vehicletype.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/traci/vehicletype.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Lena Kalleske @date 2008-10-09 -@version $Id: vehicletype.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: vehicletype.py 12906 2012-10-30 11:02:27Z behrisch $ Python implementation of the TraCI interface. @@ -30,7 +30,7 @@ tc.VAR_MINGAP: traci.Storage.readDouble, tc.VAR_WIDTH: traci.Storage.readDouble, tc.VAR_COLOR: lambda(result): result.read("!BBBB")} -subscriptionResults = {} +subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC) def _getUniversal(varID, typeID): result = traci._sendReadOneStringCmd(tc.CMD_GET_VEHICLETYPE_VARIABLE, varID, typeID) @@ -148,17 +148,9 @@ Subscribe to one or more vehicle type values for the given interval. A call to this method clears all previous subscription results. """ - _resetSubscriptionResults() + subscriptionResults.reset() traci._subscribe(tc.CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE, begin, end, typeID, varIDs) -def _resetSubscriptionResults(): - subscriptionResults.clear() - -def _addSubscriptionResult(typeID, varID, data): - if typeID not in subscriptionResults: - subscriptionResults[typeID] = {} - subscriptionResults[typeID][varID] = _RETURN_VALUE_FUNC[varID](data) - def getSubscriptionResults(typeID=None): """getSubscriptionResults(string) -> dict(integer: ) @@ -169,9 +161,14 @@ It is not possible to retrieve older subscription results than the ones from the last time step. """ - if typeID == None: - return subscriptionResults - return subscriptionResults.get(typeID, None) + return subscriptionResults.get(typeID) + +def subscribeContext(typeID, domain, dist, varIDs=(tc.VAR_MAXSPEED,), begin=0, end=2**31-1): + subscriptionResults.reset() + traci._subscribeContext(tc.CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT, begin, end, typeID, domain, dist, varIDs) + +def getContextSubscriptionResults(typeID=None): + return subscriptionResults.getContext(typeID) def setLength(typeID, length): diff -Nru sumo-0.15.0~dfsg/tools/trip/generateTripsXml.py sumo-0.16.0~dfsg/tools/trip/generateTripsXml.py --- sumo-0.15.0~dfsg/tools/trip/generateTripsXml.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/trip/generateTripsXml.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Yun-Pang Wang @author Michael Behrisch @date 2009-02-09 -@version $Id: generateTripsXml.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: generateTripsXml.py 12897 2012-10-26 07:44:19Z melde $ This script generate a trip file as input data in sumo @@ -27,6 +27,7 @@ This class is to store node attributes and the respective incoming/outgoing links. """ def __init__(self, num): + self._id = "%s" % num self.inEdges = [] self.outEdges = [] self.label = "%s" % num @@ -34,8 +35,12 @@ self.sinkEdges = [] self.sourceConnNodes = [] self.sinkConnNodes = [] + def __repr__(self): return self.label + + def getOutgoing(self): + return self.sourceEdges class Trip: """ @@ -51,6 +56,7 @@ def __repr__(self): return self.label + # This class is uesed to store link information and estimate # as well as flow and capacity for the flow computation and some parameters # read from the net. @@ -185,17 +191,17 @@ self._length = 0 elif name == 'succ': self._edge = attrs['edge'] - if self._edge[0]!=':': + if self._edge[0] != ':': self._edgeObj = self._net.getEdge(self._edge) - elif name == 'succlane' and self._edge!="": + elif name == 'succlane' and self._edge != "": l = attrs['lane'] if l != "SUMO_NO_DESTINATION": toEdge = self._net.getEdge(l[:l.rfind('_')]) - newEdge = Edge(self._edge+"_"+l[:l.rfind('_')], self._edgeObj.target, toEdge.source) + newEdge = Edge(self._edge + "_" + l[:l.rfind('_')], self._edgeObj.target, toEdge.source) self._net.addEdge(newEdge) self._edgeObj.finalizer = l[:l.rfind('_')] elif name == 'lane' and self._edge != '': - self._maxSpeed = max(self._maxSpeed, float(attrs['maxspeed'])) + self._maxSpeed = max(self._maxSpeed, float(attrs['speed'])) self._laneNumber = self._laneNumber + 1 self._length = float(attrs['length']) @@ -215,14 +221,16 @@ self.I = 100 def startElement(self, name, attrs): - if name == 'district': + if name == 'taz': self._districtSource = self._net.newVertex() + self._districtSource._id = attrs['id'] self._districtSource.label = attrs['id'] self._net._startVertices.append(self._districtSource) self._districtSink = self._net.newVertex() + self._districtSink._id = attrs['id'] self._districtSink.label = attrs['id'] self._net._endVertices.append(self._districtSink) - elif name == 'dsink': + elif name == 'tazSink': sinklink = self._net.getEdge(attrs['id']) self.I += 1 conlink = self._districtSink.label + str(self.I) @@ -231,7 +239,7 @@ newEdge.weight = attrs['weight'] self._districtSink.sinkConnNodes.append(sinklink.target) newEdge.connection = 1 - elif name == 'dsource': + elif name == 'tazSource': sourcelink = self._net.getEdge(attrs['id']) self.I += 1 conlink = self._districtSource.label + str(self.I) @@ -242,16 +250,16 @@ newEdge.connection = 2 def endElement(self, name): - if name == 'district': + if name == 'taz': self._district = '' def addVeh(counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap): counts += 1. vehID += 1 - endtime = int((float(begin + period)-0.5)*3600) # The last half hour will not release any vehicles - depart = random.randint(begin*3600, endtime) + endtime = int((float(begin + period) - 0.5) * 3600) # The last half hour will not release any vehicles + depart = random.randint(begin * 3600, endtime) if len(odConnTable[startVertex.label][endVertex.label]) > 0: - connIndex = random.randint(0, len(odConnTable[startVertex.label][endVertex.label])-1) + connIndex = random.randint(0, len(odConnTable[startVertex.label][endVertex.label]) - 1) connPair = odConnTable[startVertex.label][endVertex.label][connIndex] veh = Trip(vehID, depart, connPair[0], connPair[1], startVertex.label, endVertex.label) vehIDtoODMap[str(vehID)] = [startVertex.label, endVertex.label] @@ -261,7 +269,7 @@ def main(options): parser = make_parser() - isBZ2= False + isBZ2 = False dataDir = options.datadir districts = os.path.join(dataDir, options.districtfile) matrix = os.path.join(dataDir, options.mtxfile) @@ -288,7 +296,7 @@ parser.setContentHandler(DistrictsReader(net)) parser.parse(districts) - + matrixPshort, startVertices, endVertices, currentMatrixSum, begin, period = getMatrix(net, options.debug, matrix, matrixSum)[:6] if options.debug: @@ -309,7 +317,7 @@ for end, endVertex in enumerate(endVertices): if startVertex.label != endVertex.label and matrixPshort[start][end] > 0.: if endVertex.label not in odConnTable[startVertex.label]: - odConnTable[startVertex.label][endVertex.label]= [] + odConnTable[startVertex.label][endVertex.label] = [] net.checkRoute(startVertex, endVertex, start, end, P, odConnTable, source, options) else: if options.debug: @@ -326,7 +334,7 @@ matrixSum = 0. fouttrips = file(options.tripfile, 'w') fouttrips.write('\n') - print >> fouttrips, """ + print >> fouttrips, """ """ % datetime.datetime.now() fouttrips.write("\n") @@ -362,8 +370,8 @@ if __name__ == "__main__": departpos = options.departpos for trip in tripList: - fouttrips.write(' \n' \ - %(trip.label, trip.depart, trip.sourceEdge, trip.sinkEdge, trip.sourceDistrict, trip.sinkDistrict, departpos)) + fouttrips.write(' \n' \ + % (trip.label, trip.depart, trip.sourceEdge, trip.sinkEdge, trip.sourceDistrict, trip.sinkDistrict, departpos)) fouttrips.write("") fouttrips.close() @@ -372,7 +380,7 @@ if __name__ == "__main__": optParser = OptionParser() optParser.add_option("-r", "--data-dir", dest="datadir", - default= os.getcwd(), help="give the data directory path") + default=os.getcwd(), help="give the data directory path") optParser.add_option("-n", "--net-file", dest="netfile", help="define the net file (mandatory)") optParser.add_option("-m", "--matrix-file", dest="mtxfile", @@ -382,7 +390,7 @@ optParser.add_option("-l", "--limitlength", action="store_true", dest="limitlength", default=False, help="the route length of possible connections of a given OD pair shall be less than 1.6 * min.length") optParser.add_option("-t", "--trip-file", dest="tripfile", - default= "trips.trips.xml", help="define the output trip filename") + default="trips.trips.xml", help="define the output trip filename") optParser.add_option("-x", "--odestimation", action="store_true", dest="odestimation", default=False, help="generate trips for OD estimation") optParser.add_option("-b", "--debug", action="store_true", @@ -392,13 +400,13 @@ optParser.add_option("-f", "--scale-factor", dest="demandscale", type="float", default=1., help="scale demand by ") optParser.add_option("-D", "--depart-pos", dest="departpos", type="choice", choices=('random', 'free', 'random_free'), - default = 'free', help="choose departure position: random, free, random_free") + default='free', help="choose departure position: random, free, random_free") optParser.add_option("-C", "--get-connections", action="store_true", dest="getconns", - default= True, help="generate the OD connection directory, if set as False, a odConnTables.py should be available in the defined data directory") + default=True, help="generate the OD connection directory, if set as False, a odConnTables.py should be available in the defined data directory") (options, args) = optParser.parse_args() if not options.netfile or not options.mtxfile or not options.districtfile: optParser.print_help() sys.exit() - main(options) \ No newline at end of file + main(options) diff -Nru sumo-0.15.0~dfsg/tools/trip/randomTrips.py sumo-0.16.0~dfsg/tools/trip/randomTrips.py --- sumo-0.15.0~dfsg/tools/trip/randomTrips.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/trip/randomTrips.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file randomTrips.py @author Michael Behrisch @date 2010-03-06 -@version $Id: randomTrips.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: randomTrips.py 12979 2012-11-14 14:42:19Z namdre $ Generates random trips for the given network. @@ -13,68 +13,132 @@ """ import os, sys, random, bisect, datetime, subprocess +import math from optparse import OptionParser sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import sumolib.net -def randomEdge(edges, cumWeights): - r = random.random() * cumWeights[-1] - return edges[bisect.bisect(cumWeights, r)] - -optParser = OptionParser() -optParser.add_option("-n", "--net-file", dest="netfile", - help="define the net file (mandatory)") -optParser.add_option("-o", "--output-trip-file", dest="tripfile", - default="trips.trips.xml", help="define the output trip filename") -optParser.add_option("-r", "--route-file", dest="routefile", - help="generates route file with duarouter") -optParser.add_option("-t", "--trip-id-prefix", dest="tripprefix", - default="t", help="prefix for the trip ids") -optParser.add_option("-a", "--trip-parameters", dest="trippar", - default="", help="additional trip parameters") -optParser.add_option("-b", "--begin", type="int", default=0, help="begin time") -optParser.add_option("-e", "--end", type="int", default=3600, help="end time") -optParser.add_option("-p", "--period", type="int", default=1, help="repetition period") -optParser.add_option("-s", "--seed", type="int", help="random seed") -optParser.add_option("-l", "--length", action="store_true", - default=False, help="weight edge probability by length") -optParser.add_option("-L", "--lanes", action="store_true", - default=False, help="weight edge probability by number of lanes") -optParser.add_option("-v", "--verbose", action="store_true", - default=False, help="tell me what you are doing") -(options, args) = optParser.parse_args() -if not options.netfile: - optParser.print_help() - sys.exit() - -net = sumolib.net.readNet(options.netfile) -if options.seed: - random.seed(options.seed) -probs=[] -total = 0 -for edge in net._edges: - prob = 1 - if options.length: - prob *= edge.getLength() - if options.lanes: - prob *= edge.getLaneNumber() - total += prob - probs.append(total) - -idx = 0 -fouttrips = file(options.tripfile, 'w') -print >> fouttrips, """ - +# euclidean distance between two coordinates in the plane +def euclidean(a, b): + return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) + +# assigns a weight to each edge using weight_fun and then draws from a discrete +# distribution with these weights +class randomEdgeGenerator: + def __init__(self, netfile, weight_fun): + self.net = sumolib.net.readNet(netfile) + self.net_diameter = self.net.getBBoxDiameter() + self.cumulative_weights = [] + self.total_weight = 0 + for edge in self.net._edges: + self.total_weight += weight_fun(edge) + self.cumulative_weights.append(self.total_weight) + + def _get_connected(self, type, attr, maxtries): + for i in range(maxtries): + edge = self.get() + if len(getattr(edge, attr)()) > 0: + return edge + raise Exception("no %s edge found after %s tries" % (type, maxtries)) + + def get_trip(self, min_distance, maxtries=100): + if min_distance > self.net_diameter: + raise Exception("Cannot find trips with min-distance %s for net with diamter %s" % ( + min_distance, self.net_diameter)) + for i in range(maxtries): + source_edge = self.get_source(maxtries) + sink_edge = self.get_sink(maxtries) + distance = euclidean(source_edge.getFromNode().getCoord(), + sink_edge.getToNode().getCoord()) + if distance >= min_distance: + return source_edge, sink_edge + raise Exception("no %s trip found after %s tries" % (type, maxtries)) + + def get_source(self, maxtries=100): + return self._get_connected("source", "getOutgoing", maxtries) + + def get_sink(self, maxtries=100): + return self._get_connected("sink", "getIncoming", maxtries) + + def get(self): + r = random.random() * self.total_weight + index = bisect.bisect(self.cumulative_weights, r) + return self.net._edges[index] + + +def get_options(): + optParser = OptionParser() + optParser.add_option("-n", "--net-file", dest="netfile", + help="define the net file (mandatory)") + optParser.add_option("-o", "--output-trip-file", dest="tripfile", + default="trips.trips.xml", help="define the output trip filename") + optParser.add_option("-r", "--route-file", dest="routefile", + help="generates route file with duarouter") + optParser.add_option("-t", "--trip-id-prefix", dest="tripprefix", + default="", help="prefix for the trip ids") + optParser.add_option("-a", "--trip-parameters", dest="trippar", + default="", help="additional trip parameters") + optParser.add_option("-b", "--begin", type="float", default=0, help="begin time") + optParser.add_option("-e", "--end", type="float", default=3600, help="end time") + optParser.add_option("-p", "--period", type="float", default=1, help="repetition period") + optParser.add_option("-s", "--seed", type="int", help="random seed") + optParser.add_option("-l", "--length", action="store_true", + default=False, help="weight edge probability by length") + optParser.add_option("-L", "--lanes", action="store_true", + default=False, help="weight edge probability by number of lanes") + optParser.add_option("--speed-exponent", type="float", dest="speed_exponent", + default=0.0, help="weight edge probability by speed^ (default 0)") + optParser.add_option("--fringe-factor", type="float", dest="fringe_factor", + default=1.0, help="multiply weight of fringe edges by (default 1") + optParser.add_option("--fringe-threshold", type="float", dest="fringe_threshold", + default=0.0, help="only consider edges with speed above as fringe edges (default 0)") + optParser.add_option("--min-distance", type="float", dest="min_distance", + default=0.0, help="require start and end edges for each trip to be at least m appart (default 0)") + optParser.add_option("-v", "--verbose", action="store_true", + default=False, help="tell me what you are doing") + (options, args) = optParser.parse_args() + if not options.netfile: + optParser.print_help() + sys.exit() + return options + + +def main(options): + if options.seed: + random.seed(options.seed) + + def edge_probability(edge): + prob = 1 + if options.length: + prob *= edge.getLength() + if options.lanes: + prob *= edge.getLaneNumber() + prob *= (edge.getSpeed() ** options.speed_exponent) + if (options.fringe_factor != 1.0 and + edge.getSpeed() > options.fringe_threshold and + edge.is_fringe()): + prob *= options.fringe_factor + return prob + + edge_generator = randomEdgeGenerator(options.netfile, edge_probability) + idx = 0 + with open(options.tripfile, 'w') as fouttrips: + print >> fouttrips, """ + """ % datetime.datetime.now() -for depart in range(options.begin, options.end, options.period): - label = "%s%s" % (options.tripprefix, idx) - sourceEdge = randomEdge(net._edges, probs) - sinkEdge = randomEdge(net._edges, probs) - print >> fouttrips, ' ' \ - % (label, depart, sourceEdge.getID(), sinkEdge.getID(), options.trippar) - idx += 1 -fouttrips.write("") -fouttrips.close() + depart = options.begin + while depart < options.end: + label = "%s%s" % (options.tripprefix, idx) + source_edge, sink_edge = edge_generator.get_trip(options.min_distance) + print >> fouttrips, ' ' % ( + label, depart, source_edge.getID(), sink_edge.getID(), options.trippar) + idx += 1 + depart += options.period + fouttrips.write("") -if options.routefile: - subprocess.call(['duarouter', '-n', options.netfile, '-t', options.tripfile, '-o', options.routefile]) + if options.routefile: + subprocess.call(['duarouter', '-n', options.netfile, '-t', options.tripfile, '-o', options.routefile, '--ignore-errors']) + + +if __name__ == "__main__": + main(get_options()) diff -Nru sumo-0.15.0~dfsg/tools/trip/removeGeometryInTrips.pl sumo-0.16.0~dfsg/tools/trip/removeGeometryInTrips.pl --- sumo-0.15.0~dfsg/tools/trip/removeGeometryInTrips.pl 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/trip/removeGeometryInTrips.pl 2012-12-04 00:26:11.000000000 +0000 @@ -54,7 +54,7 @@ open(INDAT, "< $ARGV[0]"); while() { $tmp = $_; - if($tmp =~ "\) { $tmp = $_; - if($tmp=~"=$min && $depart<=$max) { print $tmp; diff -Nru sumo-0.15.0~dfsg/tools/visualization/mpl_dump_onNet.py sumo-0.16.0~dfsg/tools/visualization/mpl_dump_onNet.py --- sumo-0.15.0~dfsg/tools/visualization/mpl_dump_onNet.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/visualization/mpl_dump_onNet.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: mpl_dump_onNet.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: mpl_dump_onNet.py 12595 2012-08-24 14:07:33Z dkrajzew $ This script reads a network and a dump file and @@ -92,7 +92,7 @@ else: self._id = "" if name == 'lane' and self._id!="": - self._edge2speed[self._id] = float(attrs['maxspeed']) + self._edge2speed[self._id] = float(attrs['speed']) self._edge2lanes[self._id] = self._edge2lanes[self._id] + 1 self._parseLane = True self._currentShapes.append(attrs["shape"]) diff -Nru sumo-0.15.0~dfsg/tools/xml/binary2plain.py sumo-0.16.0~dfsg/tools/xml/binary2plain.py --- sumo-0.15.0~dfsg/tools/xml/binary2plain.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/xml/binary2plain.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,7 +3,7 @@ @file binary2plain.py @author Michael Behrisch @date 2012-03-11 -@version $Id: binary2plain.py 12093 2012-03-13 22:11:37Z behrisch $ +@version $Id: binary2plain.py 13046 2012-11-23 22:57:31Z behrisch $ Converter between SUMO's binary XML and plain XML @@ -25,13 +25,21 @@ LANE = 9 POSITION_2D = 10 POSITION_3D = 11 -COLOR = 12 -NODE_TYPE = 13 -EDGE_FUNCTION = 14 +BOUNDARY = 12 +COLOR = 13 +NODE_TYPE = 14 +EDGE_FUNCTION = 15 +ROUTE = 16 +SCALED2INT = 17 +SCALED2INT_POSITION_2D = 18 +SCALED2INT_POSITION_3D = 19 def read(content, format): return struct.unpack(format, content.read(struct.calcsize(format))) +def readByte(content): + return read(content, "B")[0] + def readInt(content): return read(content, "i")[0] @@ -43,18 +51,100 @@ return read(content, "%ss" % length)[0] def readStringList(content): - n = read(content, "i")[0] + n = readInt(content) list = [] for i in range(n): read(content, "B") #type list.append(readString(content)) return list +def readIntListList(content): + n = readInt(content) + list = [] + for i in range(n): + read(content, "B") #type + n1 = readInt(content) + list.append([]) + for j in range(n1): + read(content, "B") #type + list[-1].append(readInt(content)) + return list + +def readRoute(content): + n = readInt(content) + list = [] + first = readInt(content) + if first < 0: + bits = -first + numFields = 8 * 4 / bits + mask = (1 << bits) - 1 + edge = readInt(content) + list.append(edges[edge]) + n -= 1 + field = numFields + while n > 0: + if field == numFields: + data = readInt(content) + field = 0 + followIndex = (data >> ((numFields - field - 1) * bits)) & mask; + edge = followers[edge][followIndex] + list.append(edges[edge]) + field += 1 + n -= 1 + else: + list.append(edges[first]) + n -= 1 + while n > 0: + list.append(edges[readInt(content)]) + n -= 1 + return list + +def typedValueStr(content): + valType = readByte(content) + if valType == BYTE: + return str(readByte(content)) + elif valType == INTEGER: + return str(readInt(content)) + elif valType == FLOAT: + return '%.2f' % readDouble(content) + elif valType == STRING: + return readString(content) + elif valType == LIST: + l = [] + for i in range(readInt(content)): + l.append(typedValueStr(content)) + return " ".join(l) + elif valType == EDGE: + return edges[readInt(content)] + elif valType == LANE: + return '%s_%s' % (edges[readInt(content)], readByte(content)) + elif valType == POSITION_2D: + return '%.2f,%.2f' % (readDouble(content),readDouble(content)) + elif valType == POSITION_3D: + return '%.2f,%.2f,%.2f' % (readDouble(content),readDouble(content),readDouble(content)) + elif valType == BOUNDARY: + return '%.2f,%.2f,%.2f,%.2f' % (readDouble(content),readDouble(content), + readDouble(content),readDouble(content)) + elif valType == COLOR: + val = read(content, "BBBB") + return '%s,%s,%s' % (val[0]/255.,val[1]/255.,val[2]/255.) + elif valType == NODE_TYPE: + return nodeTypes[readByte(content)] + elif valType == EDGE_FUNCTION: + return edgeTypes[readByte(content)] + elif valType == ROUTE: + return " ".join(readRoute(content)) + elif valType == SCALED2INT: + return '%.2f' % (readInt(content)/100.) + elif valType == SCALED2INT_POSITION_2D: + return '%.2f,%.2f' % (readInt(content)/100.,readInt(content)/100.) + elif valType == SCALED2INT_POSITION_3D: + return '%.2f,%.2f,%.2f' % (readInt(content)/100.,readInt(content)/100.,readInt(content)/100.) out = sys.stdout content = open(sys.argv[1], 'rb') -print read(content, "BBB") #sbx version -print readString(content) #sumo version +read(content, "BBB") #type, sbx version, type +readString(content) #sumo version read(content, "B") #type elements = readStringList(content) read(content, "B") #type @@ -63,46 +153,33 @@ nodeTypes = readStringList(content) read(content, "B") #type edgeTypes = readStringList(content) +read(content, "B") #type +edges = readStringList(content) +read(content, "B") #type +followers = readIntListList(content) stack = [] startOpen = False while True: - typ = read(content, "B") + typ = readByte(content) if typ == XML_TAG_START: if startOpen: out.write(">\n") out.write(" " * len(stack)) - stack.append(readInt(content)) + stack.append(readByte(content)) out.write("<" + elements[stack[-1]]) startOpen = True elif typ == XML_TAG_END: if startOpen: - out.write(">") - out.write("" % elements[stack.pop()]) - readInt(content) + out.write("/>\n") + stack.pop() + startOpen = False + else: + out.write(" " * (len(stack)-1)) + out.write("\n" % elements[stack.pop()]) + readByte(content) + if len(stack) == 0: + break elif typ == XML_ATTRIBUTE: - out.write(" %s=" % attributes[readInt(content)]) - valType = read(content, "B") - if typ == BYTE: - out.write('"%s"' % read(content, "B")) - elif typ == INTEGER: - out.write('"%s"' % readInt(content)) - elif typ == FLOAT: - out.write('"%s"' % readDouble(content)) - elif typ == STRING: - out.write('"%s"' % readInt(content)) - elif typ == LIST: - out.write('"%s"' % readInt(content)) - elif typ == EDGE: - out.write('"%s"' % readInt(content)) - elif typ == LANE: - out.write('"%s"' % readInt(content)) - elif typ == POSITION_2D: - out.write('"%s,%s"' % (readDouble(content),readDouble(content))) - elif typ == POSITION_3D: - out.write('"%s,%s,%s"' % (readInt(content),readDouble(content),readDouble(content))) - elif typ == COLOR: - out.write('"%s,%s,%s"' % read(content, "BBB")) - elif typ == NODE_TYPE: - out.write('"%s"' % nodeTypes[readInt(content)]) - elif typ == EDGE_FUNCTION: - out.write('"%s"' % edgeTypes[readInt(content)]) + out.write(' %s="%s"' % (attributes[readByte(content)], typedValueStr(content))) + else: + print >> sys.stderr, "Unknown type %s" % typ \ No newline at end of file diff -Nru sumo-0.15.0~dfsg/tools/xml/rebuildSchemata.py sumo-0.16.0~dfsg/tools/xml/rebuildSchemata.py --- sumo-0.15.0~dfsg/tools/xml/rebuildSchemata.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/xml/rebuildSchemata.py 2012-12-04 00:26:11.000000000 +0000 @@ -3,9 +3,9 @@ @file rebuildSchemata.py @author Michael Behrisch @date 2011-07-11 -@version $Id: rebuildSchemata.py 11671 2012-01-07 20:14:30Z behrisch $ +@version $Id: rebuildSchemata.py 12434 2012-06-26 19:17:45Z behrisch $ -Let all SUMO binarie write the schema for their config +Let all SUMO binaries write the schema for their config SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2011-2012 DLR (http://www.dlr.de/) and contributors @@ -14,5 +14,5 @@ import os, sys, subprocess homeDir = os.environ.get("SUMO_HOME", os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) binDir = os.environ.get("SUMO_BINDIR", os.path.join(homeDir, "bin")) -for exe in "activitygen dfrouter duarouter jtrrouter netconvert netgen od2trips polyconvert sumo".split(): +for exe in "activitygen dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert sumo".split(): subprocess.call([os.path.join(binDir, exe), "--save-schema", os.path.join(homeDir, "docs", "internet", "xsd" , exe+"Configuration.xsd")]) diff -Nru sumo-0.15.0~dfsg/tools/xml/schemaCheck.py sumo-0.16.0~dfsg/tools/xml/schemaCheck.py --- sumo-0.15.0~dfsg/tools/xml/schemaCheck.py 2012-03-14 00:30:39.000000000 +0000 +++ sumo-0.16.0~dfsg/tools/xml/schemaCheck.py 2012-12-04 00:26:11.000000000 +0000 @@ -4,7 +4,7 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 03.12.2009 -@version $Id: schemaCheck.py 12031 2012-03-07 10:27:11Z behrisch $ +@version $Id: schemaCheck.py 12854 2012-10-17 08:48:36Z dkrajzew $ Checks schema for files matching certain file names using either lxml or SAX2Count.exe depending on availability. @@ -22,7 +22,16 @@ except ImportError: haveLxml = False -def validate(f): +def relative_to_sumo_home(path): + if "/sumo/" in path: + return path[path.index("/sumo/")+6:] + else: + return path + + +def validate(root, f): + root = os.path.abspath(root) + rs = root.replace('\\', '/') try: doc = etree.parse(f) schemaLoc = doc.getroot().get('{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation') @@ -33,46 +42,54 @@ if schemaLoc not in schemes: schemes[schemaLoc] = etree.XMLSchema(etree.parse(schemaLoc)) schemes[schemaLoc].validate(doc) - for entry in schemes[schemaLoc].error_log: - s = str(entry) - if "/sumo/" in s: - s = s[s.index("/sumo/")+6:] - print >> sys.stderr, s + errors = list(schemes[schemaLoc].error_log) + errors.sort() + for entry in errors: + e = os.path.abspath(str(entry)).replace('\\', '/') + e = e[e.find("file:")+7+len(rs):] + print >> sys.stderr, e except: - print >> sys.stderr, "Error on parsing '%s'!" %f + print >> sys.stderr, "Error on parsing '%s'!" % os.path.abspath(f)[len(root):].replace('\\', '/') traceback.print_exc() -def main(srcRoot, err): - toCheck = [ "*.edg.xml", "*.nod.xml", "*.con.xml", "*.typ.xml", +def main(srcRoot, toCheck, err): + if not toCheck: + toCheck = [ "*.edg.xml", "*.nod.xml", "*.con.xml", "*.typ.xml", "*.net.xml", "*.rou.xml", "*.add.xml", "*.????cfg", "net.netgen", "net.netconvert", "net.scenario", "tls.scenario", - "routes.duarouter", "alts.duarouter", "routes.jtrrouter" ] + "routes.duarouter", "alts.duarouter", "routes.jtrrouter", + "*.turns.xml" ] sax2count = "SAX2Count.exe" if 'XERCES_64' in os.environ: sax2count = os.path.join(os.environ['XERCES_64'], "bin", sax2count) elif 'XERCES' in os.environ: sax2count = os.path.join(os.environ['XERCES'], "bin", sax2count) + fileNo = 0 if os.path.exists(srcRoot): if os.path.isdir(srcRoot): for root, dirs, files in os.walk(srcRoot): for pattern in toCheck: for name in glob.glob(os.path.join(root, pattern)): if haveLxml: - validate(name) + validate(srcRoot, name) elif os.name != "posix": subprocess.call(sax2count + " -v=always -f " + name, stdout=open(os.devnull), stderr=err) + fileNo += 1 if '.svn' in dirs: dirs.remove('.svn') else: if haveLxml: - validate(srcRoot) + validate("", srcRoot) elif os.name != "posix": subprocess.call(sax2count + " -v=always -f " + srcRoot, stdout=open(os.devnull), stderr=err) + fileNo += 1 else: print >> err, "cannot open", srcRoot return 1 + print "%s files checked" % fileNo + if haveLxml: for scheme in schemes.itervalues(): if scheme.error_log: @@ -87,4 +104,7 @@ srcRoot = "." if len(sys.argv) > 1: srcRoot = sys.argv[1] - sys.exit(main(srcRoot, sys.stderr)) + toCheck = None + if len(sys.argv) > 2: + toCheck = sys.argv[2].split(",") + sys.exit(main(srcRoot, toCheck, sys.stderr)) diff -Nru sumo-0.15.0~dfsg/tools_filelist sumo-0.16.0~dfsg/tools_filelist --- sumo-0.15.0~dfsg/tools_filelist 2012-03-14 00:30:40.000000000 +0000 +++ sumo-0.16.0~dfsg/tools_filelist 2012-12-04 00:26:11.000000000 +0000 @@ -1,559 +1,569 @@ -tools/tls/tls_check.py -tools/tls/tls_csv2SUMO.py -tools/projects/orinoko/buildConnections.pl -tools/projects/TLS-Evaluationsszenarien/input01.ini -tools/projects/TLS-Evaluationsszenarien/input02.ini -tools/projects/TLS-Evaluationsszenarien/data/000.dat -tools/projects/TLS-Evaluationsszenarien/data/001.dat -tools/projects/TLS-Evaluationsszenarien/data/003.ini -tools/projects/TLS-Evaluationsszenarien/data/002.ini -tools/projects/TLS-Evaluationsszenarien/data/001.ini -tools/projects/TLS-Evaluationsszenarien/data/000.ini -tools/projects/TLS-Evaluationsszenarien/data/002.dat -tools/projects/TLS-Evaluationsszenarien/data/003.dat -tools/projects/TLS-Evaluationsszenarien/input03.ini -tools/projects/TLS-Evaluationsszenarien/input04.ini -tools/projects/TLS-Evaluationsszenarien/plotter.py -tools/projects/TLS-Evaluationsszenarien/changeNet.py -tools/projects/TLS-Evaluationsszenarien/main.py -tools/projects/TLS-Evaluationsszenarien/genRoutes.py -tools/projects/TLS-Evaluationsszenarien/evaluator.py -tools/projects/TLS-Evaluationsszenarien/test.py -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.net.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.rou.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.sumocfg -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross.out -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.det.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.nod.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.netccfg -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.nod.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.add.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.net.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.edg.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.sumocfg -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.netccfg -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.det.xml -tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.con.xml -tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py -tools/projects/TaxiFCD_Krieg/src/analysis/FetchData.py -tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime.py -tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverTime.py -tools/projects/TaxiFCD_Krieg/src/analysis/VelocityCurve.py -tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverRoute.py -tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime_DK.py -tools/projects/TaxiFCD_Krieg/src/analysis/CompareVelocitys.py -tools/projects/TaxiFCD_Krieg/src/analysis/__init__.py -tools/projects/TaxiFCD_Krieg/src/analysis/TraveltimeMulti.py -tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlot.py -tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsOLD.py -tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlotOLD.py -tools/projects/TaxiFCD_Krieg/src/fcdQuality/__init__.py -tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsProcessedFCD.py -tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffects.py -tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py -tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/FCDvsCompleteRoute.py -tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutesMain.py -tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/__init__.py -tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/My_mpl_dump_onNet.py -tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/differentDepartRoutes.py -tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py -tools/projects/TaxiFCD_Krieg/src/util/Reader.py -tools/projects/TaxiFCD_Krieg/src/util/Path.py -tools/projects/TaxiFCD_Krieg/src/util/__init__.py -tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py -tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py -tools/projects/TaxiFCD_Krieg/src/taxiQuantity/SeparateVLSArea.py -tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py -tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py -tools/projects/TaxiFCD_Krieg/src/backup/BackupFolder.pyw -tools/projects/TaxiFCD_Krieg/src/backup/__init__.py -tools/projects/TaxiFCD_Krieg/src/rawFCD/GenerateRawFCD.py -tools/projects/TaxiFCD_Krieg/.pydevproject -tools/projects/TaxiFCD_Krieg/.project -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMONetwork.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPlayer.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLocationListener.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/LineImpl.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PointImpl.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Vector.java +tools/detector/flowrouter.py +tools/detector/deleteUnusedDetectors.py +tools/detector/detector.py +tools/detector/flowFromRoutes.py +tools/detector/aggregateFlows.py +tools/contributed/sumoplayer/AUTHOR +tools/contributed/sumoplayer/build.xml +tools/contributed/sumoplayer/LICENSE +tools/contributed/sumoplayer/lib/javaproj-1.0.4.jar +tools/contributed/sumoplayer/lib/xerces_2_5_0.jar +tools/contributed/sumoplayer/README +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPipedLocationListener.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXHandler.java tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Line.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/LineImpl.java tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PROJTransformer.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Point.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Vector.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PointImpl.java tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/GeoCalc.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Point.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMONetwork.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPlayer.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXNeworkfileHandler.java +tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLocationListener.java tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOGeoCoordinatesResolver.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXHandler.java tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLane.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPipedLocationListener.java -tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXNeworkfileHandler.java -tools/contributed/sumoplayer/build.xml -tools/contributed/sumoplayer/README -tools/contributed/sumoplayer/LICENSE tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py -tools/contributed/sumoplayer/AUTHOR -tools/contributed/sumoplayer/lib/xerces_2_5_0.jar -tools/contributed/sumoplayer/lib/javaproj-1.0.4.jar -tools/contributed/smallmaps/src/main.cpp -tools/contributed/smallmaps/src/fileopen.xpm -tools/contributed/smallmaps/src/filesave.xpm -tools/contributed/smallmaps/src/src.pro -tools/contributed/smallmaps/src/smallmaps.h -tools/contributed/smallmaps/src/Makefile -tools/contributed/smallmaps/src/fileprint.xpm -tools/contributed/smallmaps/src/moc_smallmaps.cpp -tools/contributed/smallmaps/src/smallmaps.cpp -tools/contributed/smallmaps/smallmaps.kdevelop.pcs -tools/contributed/smallmaps/smallmaps.kdevses tools/contributed/smallmaps/Makefile -tools/contributed/smallmaps/README -tools/contributed/smallmaps/smallmaps.pro -tools/contributed/smallmaps/smallmaps.kdevelop tools/contributed/smallmaps/COPYING tools/contributed/smallmaps/AUTHOR -tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/FastStorage.java -tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/Storage.java -tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/Socket.java -tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/FastSocket.java -tools/contributed/traci4j/src/it/polito/appeal/traci/SumoTraciConnection.java -tools/contributed/traci4j/src/it/polito/appeal/traci/TraCIException.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/Query.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/SimStepQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/VehicleQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/MultiVehiclePositionQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/ChangeLaneStateQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/RoadmapQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/ChangeEdgeStateQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/RetrieveEdgeStateQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/DomainQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/SubscribeVehiclesLifecycle.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/ReadVehicleVarQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/CloseQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/query/ChangeVehicleStateQuery.java -tools/contributed/traci4j/src/it/polito/appeal/traci/SumoHttpRetriever.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/Polygon.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/RequestMessage.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/Constants.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/StringList.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/ResponseContainer.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/ResponseMessage.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/StatusResponse.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/Command.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/BoundingBox.java -tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/RoadmapPosition.java -tools/contributed/traci4j/src/it/polito/appeal/traci/VehicleLifecycleObserver.java -tools/contributed/traci4j/src/it/polito/appeal/traci/Lane.java -tools/contributed/traci4j/src/it/polito/appeal/traci/Vehicle.java -tools/contributed/traci4j/.project -tools/contributed/traci4j/test/java/it/polito/appeal/traci/RoadmapPositionTest.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/FastStorageTest.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/protocol/CommandTest.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/protocol/MessageTest.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/QueryRoadsTest.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/EqualsHashcodeTester.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/TraCIServerTest.java -tools/contributed/traci4j/test/java/it/polito/appeal/traci/TraCITest.java -tools/contributed/traci4j/test/sumo_maps/box1l/input_routes.rou.xml -tools/contributed/traci4j/test/sumo_maps/box1l/net.net.xml -tools/contributed/traci4j/test/sumo_maps/box1l/test.sumo.cfg -tools/contributed/traci4j/test/sumo_maps/box1l/three_split.net.xml -tools/contributed/traci4j/test/sumo_maps/variable_speed_signs/input_routes.rou.xml -tools/contributed/traci4j/test/sumo_maps/variable_speed_signs/net.net.xml -tools/contributed/traci4j/test/sumo_maps/variable_speed_signs/test.sumo.cfg -tools/contributed/traci4j/build.xml -tools/contributed/traci4j/README -tools/contributed/traci4j/.settings/org.eclipse.ltk.core.refactoring.prefs -tools/contributed/traci4j/.settings/org.eclipse.jdt.ui.prefs -tools/contributed/traci4j/.classpath -tools/contributed/traci4j/COPYING -tools/contributed/traci4j/examples/it/polito/appeal/traci/examples/GetVehicleInfo.java -tools/contributed/traci4j/examples/it/polito/appeal/traci/examples/OpenStepsClose.java -tools/contributed/traci4j/lib/xml-apis.jar -tools/contributed/traci4j/lib/serializer.jar -tools/contributed/traci4j/lib/junit.jar -tools/contributed/traci4j/lib/xercesImpl.jar -tools/contributed/traci4j/lib/log4j.jar -tools/contributed/traci4j/lib/resolver.jar -tools/contributed/traci4j/lib/org.hamcrest.core_1.1.0.v20090501071000.jar -tools/contributed/trafficmodeler/src/simulation/JobType.java -tools/contributed/trafficmodeler/src/simulation/House.java -tools/contributed/trafficmodeler/src/simulation/Simulation.java -tools/contributed/trafficmodeler/src/simulation/CustomComparator.java -tools/contributed/trafficmodeler/src/simulation/SUMOInstruction.java -tools/contributed/trafficmodeler/src/simulation/SimulationExporter.java -tools/contributed/trafficmodeler/src/simulation/Trip.java -tools/contributed/trafficmodeler/src/simulation/VehicleType.java -tools/contributed/trafficmodeler/src/simulation/Adult.java -tools/contributed/trafficmodeler/src/simulation/Route.java -tools/contributed/trafficmodeler/src/simulation/SUMOInstructionList.java -tools/contributed/trafficmodeler/src/simulation/Child.java -tools/contributed/trafficmodeler/src/simulation/TrafficGenerator.java -tools/contributed/trafficmodeler/src/simulation/Person.java -tools/contributed/trafficmodeler/src/classes/ProjectElement.java -tools/contributed/trafficmodeler/src/classes/TypeSelection.java -tools/contributed/trafficmodeler/src/classes/Constants.java -tools/contributed/trafficmodeler/src/classes/Pair.java -tools/contributed/trafficmodeler/src/classes/Project.java -tools/contributed/trafficmodeler/src/classes/Layer.java -tools/contributed/trafficmodeler/src/shapes/Polygon2D.java -tools/contributed/trafficmodeler/src/shapes/Point2DExt.java +tools/contributed/smallmaps/smallmaps.pro +tools/contributed/smallmaps/smallmaps.kdevelop +tools/contributed/smallmaps/README +tools/contributed/smallmaps/smallmaps.kdevses +tools/contributed/smallmaps/smallmaps.kdevelop.pcs +tools/contributed/smallmaps/src/Makefile +tools/contributed/smallmaps/src/moc_smallmaps.cpp +tools/contributed/smallmaps/src/smallmaps.cpp +tools/contributed/smallmaps/src/fileprint.xpm +tools/contributed/smallmaps/src/main.cpp +tools/contributed/smallmaps/src/src.pro +tools/contributed/smallmaps/src/fileopen.xpm +tools/contributed/smallmaps/src/smallmaps.h +tools/contributed/smallmaps/src/filesave.xpm +tools/contributed/trafficmodeler/jar/SUMOTradegen.jar +tools/contributed/trafficmodeler/jar/colt.jar +tools/contributed/trafficmodeler/javadoc.xml +tools/contributed/trafficmodeler/SUMOConfXML.jardesc +tools/contributed/trafficmodeler/.classpath +tools/contributed/trafficmodeler/.umlproject +tools/contributed/trafficmodeler/.settings/org.eclipse.wst.validation.prefs +tools/contributed/trafficmodeler/.settings/org.eclipse.ltk.core.refactoring.prefs +tools/contributed/trafficmodeler/.settings/org.eclipse.jdt.ui.prefs +tools/contributed/trafficmodeler/.project +tools/contributed/trafficmodeler/src/shapes/AreaExt.java tools/contributed/trafficmodeler/src/shapes/Line2DExt.java +tools/contributed/trafficmodeler/src/shapes/Point2DExt.java +tools/contributed/trafficmodeler/src/shapes/Polygon2D.java tools/contributed/trafficmodeler/src/shapes/PolygonIterator.java -tools/contributed/trafficmodeler/src/shapes/AreaExt.java -tools/contributed/trafficmodeler/src/shapes/Rectangle2DExt.java tools/contributed/trafficmodeler/src/shapes/Ellipse2DExt.java -tools/contributed/trafficmodeler/src/Main.java -tools/contributed/trafficmodeler/src/helpers/DrawingHelper.java -tools/contributed/trafficmodeler/src/helpers/StreamGobbler.java -tools/contributed/trafficmodeler/src/helpers/TimeConverter.java -tools/contributed/trafficmodeler/src/helpers/RandomNumberProvider.java -tools/contributed/trafficmodeler/src/helpers/CursorProvider.java -tools/contributed/trafficmodeler/src/helpers/MultipleTripExpander.java -tools/contributed/trafficmodeler/src/helpers/ApplicationSettings.java -tools/contributed/trafficmodeler/src/helpers/Broadcaster.java +tools/contributed/trafficmodeler/src/shapes/Rectangle2DExt.java +tools/contributed/trafficmodeler/src/classes/Layer.java +tools/contributed/trafficmodeler/src/classes/Pair.java +tools/contributed/trafficmodeler/src/classes/Constants.java +tools/contributed/trafficmodeler/src/classes/ProjectElement.java +tools/contributed/trafficmodeler/src/classes/TypeSelection.java +tools/contributed/trafficmodeler/src/classes/Project.java tools/contributed/trafficmodeler/src/ui/TypeSelectionTableModel.java -tools/contributed/trafficmodeler/src/ui/AffectedLanesTableModel.java -tools/contributed/trafficmodeler/src/ui/dialogs/DlgNewProject.java -tools/contributed/trafficmodeler/src/ui/dialogs/DlgSettings.java tools/contributed/trafficmodeler/src/ui/dialogs/DlgManageVehicleTypes.java tools/contributed/trafficmodeler/src/ui/dialogs/DlgManageJobTypes.java tools/contributed/trafficmodeler/src/ui/dialogs/DlgAddEditVehicleType.java tools/contributed/trafficmodeler/src/ui/dialogs/DlgAddEditJobType.java -tools/contributed/trafficmodeler/src/ui/dialogs/DlgExportSimulation.java tools/contributed/trafficmodeler/src/ui/dialogs/DlgRandomLayerProperties.java tools/contributed/trafficmodeler/src/ui/dialogs/DlgSelectTypes.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlHotSpotProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlEdgeProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlAccidentProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlFlowProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlJunctionProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlAreaFlowProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlSchoolProperties.java -tools/contributed/trafficmodeler/src/ui/propertypanels/PnlTrafficAreaProperties.java -tools/contributed/trafficmodeler/src/ui/controls/SimTimeEdit.java -tools/contributed/trafficmodeler/src/ui/controls/ProjectTreeCellRenderer.java +tools/contributed/trafficmodeler/src/ui/dialogs/DlgExportSimulation.java +tools/contributed/trafficmodeler/src/ui/dialogs/DlgNewProject.java +tools/contributed/trafficmodeler/src/ui/dialogs/DlgSettings.java +tools/contributed/trafficmodeler/src/ui/MainWindow.java +tools/contributed/trafficmodeler/src/ui/filefilters/TDLFileFilter.java +tools/contributed/trafficmodeler/src/ui/filefilters/SUMOFileFilter.java +tools/contributed/trafficmodeler/src/ui/filefilters/ProjectFileFilter.java tools/contributed/trafficmodeler/src/ui/controls/JTrafficLayerTree.java +tools/contributed/trafficmodeler/src/ui/controls/SimTimeEdit.java tools/contributed/trafficmodeler/src/ui/controls/JTrafficLayerTreeModel.java +tools/contributed/trafficmodeler/src/ui/controls/ProjectTreeCellRenderer.java +tools/contributed/trafficmodeler/src/ui/ExportLayersTableModel.java +tools/contributed/trafficmodeler/src/ui/AffectedLanesTableModel.java tools/contributed/trafficmodeler/src/ui/PnlLayers.java tools/contributed/trafficmodeler/src/ui/PnlProperties.java -tools/contributed/trafficmodeler/src/ui/ExportLayersTableModel.java -tools/contributed/trafficmodeler/src/ui/filefilters/TDLFileFilter.java -tools/contributed/trafficmodeler/src/ui/filefilters/ProjectFileFilter.java -tools/contributed/trafficmodeler/src/ui/filefilters/SUMOFileFilter.java -tools/contributed/trafficmodeler/src/ui/MainWindow.java tools/contributed/trafficmodeler/src/ui/Display.java -tools/contributed/trafficmodeler/src/interfaces/HandleListener.java -tools/contributed/trafficmodeler/src/interfaces/DrawableElement.java -tools/contributed/trafficmodeler/src/interfaces/ProjectChangedListener.java -tools/contributed/trafficmodeler/src/interfaces/CurrentLayerChangedListener.java -tools/contributed/trafficmodeler/src/interfaces/SelectionChangedListener.java -tools/contributed/trafficmodeler/src/interfaces/SelectableType.java -tools/contributed/trafficmodeler/src/interfaces/ModifiedCollectionListener.java -tools/contributed/trafficmodeler/src/interfaces/DrawableLayer.java -tools/contributed/trafficmodeler/src/tdl/XMLHelpers.java -tools/contributed/trafficmodeler/src/roadnetwork/RoadNetworkElement.java -tools/contributed/trafficmodeler/src/roadnetwork/RoadNetwork.java -tools/contributed/trafficmodeler/src/roadnetwork/Junction.java -tools/contributed/trafficmodeler/src/roadnetwork/RoadNetworkParser.java -tools/contributed/trafficmodeler/src/roadnetwork/Edge.java -tools/contributed/trafficmodeler/src/roadnetwork/Lane.java -tools/contributed/trafficmodeler/src/trafficdefinition/RandomTrafficDefinitionLayer.java -tools/contributed/trafficmodeler/src/trafficdefinition/HotSpot.java -tools/contributed/trafficmodeler/src/trafficdefinition/UserDefinedTrafficDefinitionLayer.java -tools/contributed/trafficmodeler/src/trafficdefinition/Handle.java -tools/contributed/trafficmodeler/src/trafficdefinition/Flow.java -tools/contributed/trafficmodeler/src/trafficdefinition/AreaFlow.java -tools/contributed/trafficmodeler/src/trafficdefinition/Accident.java -tools/contributed/trafficmodeler/src/trafficdefinition/TrafficDefinitionElement.java -tools/contributed/trafficmodeler/src/trafficdefinition/School.java -tools/contributed/trafficmodeler/src/trafficdefinition/TrafficDefinitionLayer.java -tools/contributed/trafficmodeler/src/trafficdefinition/TrafficArea.java -tools/contributed/trafficmodeler/src/trafficdefinition/ActivityBasedTrafficDefinitionLayer.java -tools/contributed/trafficmodeler/src/enums/SelectionCount.java -tools/contributed/trafficmodeler/src/enums/SelectionType.java -tools/contributed/trafficmodeler/src/enums/MotionRestriction.java -tools/contributed/trafficmodeler/src/enums/ToolType.java -tools/contributed/trafficmodeler/src/enums/TrafficDefinitionLayerType.java -tools/contributed/trafficmodeler/src/enums/EditingMode.java -tools/contributed/trafficmodeler/src/enums/SchoolType.java -tools/contributed/trafficmodeler/src/resources/icons/page_white_stack.png -tools/contributed/trafficmodeler/src/resources/icons/addjobtype.png -tools/contributed/trafficmodeler/src/resources/icons/select.png -tools/contributed/trafficmodeler/src/resources/icons/layeruser.png -tools/contributed/trafficmodeler/src/resources/icons/open.png -tools/contributed/trafficmodeler/src/resources/icons/purge.png -tools/contributed/trafficmodeler/src/resources/icons/layers.png -tools/contributed/trafficmodeler/src/resources/icons/zoom.png -tools/contributed/trafficmodeler/src/resources/icons/deletejobtype.png -tools/contributed/trafficmodeler/src/resources/icons/selectionremove.png -tools/contributed/trafficmodeler/src/resources/icons/layeractivity.png -tools/contributed/trafficmodeler/src/resources/icons/deletelayer.png -tools/contributed/trafficmodeler/src/resources/icons/undelete.png -tools/contributed/trafficmodeler/src/resources/icons/clock.png -tools/contributed/trafficmodeler/src/resources/icons/hotspotin.png -tools/contributed/trafficmodeler/src/resources/icons/shape_rotate_clockwise.png -tools/contributed/trafficmodeler/src/resources/icons/exit.png -tools/contributed/trafficmodeler/src/resources/icons/jobtypes.png -tools/contributed/trafficmodeler/src/resources/icons/clear.png -tools/contributed/trafficmodeler/src/resources/icons/editvehicletype.png -tools/contributed/trafficmodeler/src/resources/icons/palette.png -tools/contributed/trafficmodeler/src/resources/icons/addvehicletype.png +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlFlowProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlAccidentProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlTrafficAreaProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlAreaFlowProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlHotSpotProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlSchoolProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlEdgeProperties.java +tools/contributed/trafficmodeler/src/ui/propertypanels/PnlJunctionProperties.java +tools/contributed/trafficmodeler/src/resources/cursors/ZoomIn.gif +tools/contributed/trafficmodeler/src/resources/cursors/SelectAdd.gif +tools/contributed/trafficmodeler/src/resources/cursors/ZoomOut.gif +tools/contributed/trafficmodeler/src/resources/cursors/hand.gif +tools/contributed/trafficmodeler/src/resources/cursors/SelectRemove.gif +tools/contributed/trafficmodeler/src/resources/cursors/handclosed.gif +tools/contributed/trafficmodeler/src/resources/cursors/Select.gif tools/contributed/trafficmodeler/src/resources/icons/school.png -tools/contributed/trafficmodeler/src/resources/icons/hotspotinout.png -tools/contributed/trafficmodeler/src/resources/icons/hotspotout.png +tools/contributed/trafficmodeler/src/resources/icons/selectionnew.png +tools/contributed/trafficmodeler/src/resources/icons/layerrandom.png +tools/contributed/trafficmodeler/src/resources/icons/layeractivity.png tools/contributed/trafficmodeler/src/resources/icons/flow.png -tools/contributed/trafficmodeler/src/resources/icons/color_swatch.png -tools/contributed/trafficmodeler/src/resources/icons/settings.png -tools/contributed/trafficmodeler/src/resources/icons/editjobtype.png -tools/contributed/trafficmodeler/src/resources/icons/pan.gif +tools/contributed/trafficmodeler/src/resources/icons/page_white_stack.png tools/contributed/trafficmodeler/src/resources/icons/save.png -tools/contributed/trafficmodeler/src/resources/icons/new.png +tools/contributed/trafficmodeler/src/resources/icons/centeronelement.png +tools/contributed/trafficmodeler/src/resources/icons/editjobtype.png +tools/contributed/trafficmodeler/src/resources/icons/color_swatch.png tools/contributed/trafficmodeler/src/resources/icons/traffic_area.png -tools/contributed/trafficmodeler/src/resources/icons/selectionadd.png +tools/contributed/trafficmodeler/src/resources/icons/Thumbs.db +tools/contributed/trafficmodeler/src/resources/icons/hotspotinout.png +tools/contributed/trafficmodeler/src/resources/icons/clock.png tools/contributed/trafficmodeler/src/resources/icons/map.png -tools/contributed/trafficmodeler/src/resources/icons/selectionnew.png -tools/contributed/trafficmodeler/src/resources/icons/deletevehicletype.png -tools/contributed/trafficmodeler/src/resources/icons/accident.png +tools/contributed/trafficmodeler/src/resources/icons/addvehicletype.png +tools/contributed/trafficmodeler/src/resources/icons/palette.png +tools/contributed/trafficmodeler/src/resources/icons/selectionadd.png +tools/contributed/trafficmodeler/src/resources/icons/open.png +tools/contributed/trafficmodeler/src/resources/icons/select.png +tools/contributed/trafficmodeler/src/resources/icons/new.png +tools/contributed/trafficmodeler/src/resources/icons/duplicatelayer.png +tools/contributed/trafficmodeler/src/resources/icons/hotspotout.png +tools/contributed/trafficmodeler/src/resources/icons/addlayer.png +tools/contributed/trafficmodeler/src/resources/icons/pan.gif +tools/contributed/trafficmodeler/src/resources/icons/clear.png +tools/contributed/trafficmodeler/src/resources/icons/layers.png tools/contributed/trafficmodeler/src/resources/icons/delete.png -tools/contributed/trafficmodeler/src/resources/icons/centeronelement.png +tools/contributed/trafficmodeler/src/resources/icons/editvehicletype.png tools/contributed/trafficmodeler/src/resources/icons/vehicletypes.png -tools/contributed/trafficmodeler/src/resources/icons/Thumbs.db -tools/contributed/trafficmodeler/src/resources/icons/addlayer.png +tools/contributed/trafficmodeler/src/resources/icons/deletevehicletype.png +tools/contributed/trafficmodeler/src/resources/icons/settings.png +tools/contributed/trafficmodeler/src/resources/icons/deletelayer.png +tools/contributed/trafficmodeler/src/resources/icons/purge.png +tools/contributed/trafficmodeler/src/resources/icons/jobtypes.png +tools/contributed/trafficmodeler/src/resources/icons/zoom.png +tools/contributed/trafficmodeler/src/resources/icons/layeruser.png +tools/contributed/trafficmodeler/src/resources/icons/accident.png +tools/contributed/trafficmodeler/src/resources/icons/addjobtype.png +tools/contributed/trafficmodeler/src/resources/icons/undelete.png +tools/contributed/trafficmodeler/src/resources/icons/hotspotin.png +tools/contributed/trafficmodeler/src/resources/icons/exit.png +tools/contributed/trafficmodeler/src/resources/icons/deletejobtype.png tools/contributed/trafficmodeler/src/resources/icons/areaflow.png -tools/contributed/trafficmodeler/src/resources/icons/duplicatelayer.png -tools/contributed/trafficmodeler/src/resources/icons/layerrandom.png -tools/contributed/trafficmodeler/src/resources/cursors/hand.gif -tools/contributed/trafficmodeler/src/resources/cursors/Select.gif -tools/contributed/trafficmodeler/src/resources/cursors/ZoomOut.gif -tools/contributed/trafficmodeler/src/resources/cursors/SelectRemove.gif -tools/contributed/trafficmodeler/src/resources/cursors/handclosed.gif -tools/contributed/trafficmodeler/src/resources/cursors/SelectAdd.gif -tools/contributed/trafficmodeler/src/resources/cursors/ZoomIn.gif -tools/contributed/trafficmodeler/javadoc.xml -tools/contributed/trafficmodeler/.project -tools/contributed/trafficmodeler/.umlproject -tools/contributed/trafficmodeler/.settings/org.eclipse.ltk.core.refactoring.prefs -tools/contributed/trafficmodeler/.settings/org.eclipse.wst.validation.prefs -tools/contributed/trafficmodeler/.settings/org.eclipse.jdt.ui.prefs -tools/contributed/trafficmodeler/.classpath +tools/contributed/trafficmodeler/src/resources/icons/shape_rotate_clockwise.png +tools/contributed/trafficmodeler/src/resources/icons/selectionremove.png +tools/contributed/trafficmodeler/src/Main.java +tools/contributed/trafficmodeler/src/simulation/TrafficGenerator.java +tools/contributed/trafficmodeler/src/simulation/SUMOInstructionList.java +tools/contributed/trafficmodeler/src/simulation/Adult.java +tools/contributed/trafficmodeler/src/simulation/Simulation.java +tools/contributed/trafficmodeler/src/simulation/Trip.java +tools/contributed/trafficmodeler/src/simulation/VehicleType.java +tools/contributed/trafficmodeler/src/simulation/SimulationExporter.java +tools/contributed/trafficmodeler/src/simulation/JobType.java +tools/contributed/trafficmodeler/src/simulation/House.java +tools/contributed/trafficmodeler/src/simulation/CustomComparator.java +tools/contributed/trafficmodeler/src/simulation/Person.java +tools/contributed/trafficmodeler/src/simulation/SUMOInstruction.java +tools/contributed/trafficmodeler/src/simulation/Child.java +tools/contributed/trafficmodeler/src/simulation/Route.java +tools/contributed/trafficmodeler/src/enums/ToolType.java +tools/contributed/trafficmodeler/src/enums/TrafficDefinitionLayerType.java +tools/contributed/trafficmodeler/src/enums/EditingMode.java +tools/contributed/trafficmodeler/src/enums/SelectionCount.java +tools/contributed/trafficmodeler/src/enums/SelectionType.java +tools/contributed/trafficmodeler/src/enums/SchoolType.java +tools/contributed/trafficmodeler/src/enums/MotionRestriction.java +tools/contributed/trafficmodeler/src/trafficdefinition/AreaFlow.java +tools/contributed/trafficmodeler/src/trafficdefinition/TrafficDefinitionLayer.java +tools/contributed/trafficmodeler/src/trafficdefinition/HotSpot.java +tools/contributed/trafficmodeler/src/trafficdefinition/TrafficArea.java +tools/contributed/trafficmodeler/src/trafficdefinition/Accident.java +tools/contributed/trafficmodeler/src/trafficdefinition/Flow.java +tools/contributed/trafficmodeler/src/trafficdefinition/School.java +tools/contributed/trafficmodeler/src/trafficdefinition/ActivityBasedTrafficDefinitionLayer.java +tools/contributed/trafficmodeler/src/trafficdefinition/TrafficDefinitionElement.java +tools/contributed/trafficmodeler/src/trafficdefinition/RandomTrafficDefinitionLayer.java +tools/contributed/trafficmodeler/src/trafficdefinition/Handle.java +tools/contributed/trafficmodeler/src/trafficdefinition/UserDefinedTrafficDefinitionLayer.java +tools/contributed/trafficmodeler/src/interfaces/DrawableElement.java +tools/contributed/trafficmodeler/src/interfaces/HandleListener.java +tools/contributed/trafficmodeler/src/interfaces/SelectionChangedListener.java +tools/contributed/trafficmodeler/src/interfaces/ModifiedCollectionListener.java +tools/contributed/trafficmodeler/src/interfaces/ProjectChangedListener.java +tools/contributed/trafficmodeler/src/interfaces/SelectableType.java +tools/contributed/trafficmodeler/src/interfaces/CurrentLayerChangedListener.java +tools/contributed/trafficmodeler/src/interfaces/DrawableLayer.java +tools/contributed/trafficmodeler/src/roadnetwork/RoadNetworkElement.java +tools/contributed/trafficmodeler/src/roadnetwork/Junction.java +tools/contributed/trafficmodeler/src/roadnetwork/Edge.java +tools/contributed/trafficmodeler/src/roadnetwork/RoadNetwork.java +tools/contributed/trafficmodeler/src/roadnetwork/RoadNetworkParser.java +tools/contributed/trafficmodeler/src/roadnetwork/Lane.java +tools/contributed/trafficmodeler/src/helpers/MultipleTripExpander.java +tools/contributed/trafficmodeler/src/helpers/DrawingHelper.java +tools/contributed/trafficmodeler/src/helpers/StreamGobbler.java +tools/contributed/trafficmodeler/src/helpers/CursorProvider.java +tools/contributed/trafficmodeler/src/helpers/RandomNumberProvider.java +tools/contributed/trafficmodeler/src/helpers/TimeConverter.java +tools/contributed/trafficmodeler/src/helpers/ApplicationSettings.java +tools/contributed/trafficmodeler/src/helpers/Broadcaster.java +tools/contributed/trafficmodeler/src/tdl/XMLHelpers.java tools/contributed/trafficmodeler/.checkstyle -tools/contributed/trafficmodeler/jar/colt.jar -tools/contributed/trafficmodeler/jar/SUMOTradegen.jar -tools/contributed/trafficmodeler/SUMOConfXML.jardesc -tools/contributed/Castellon/castellon._sumocfg -tools/contributed/Castellon/sumo.diff -tools/contributed/Castellon/castellon.nod.xml -tools/contributed/Castellon/castellon.con.xml +tools/contributed/traci4j/COPYING +tools/contributed/traci4j/.classpath +tools/contributed/traci4j/build.xml +tools/contributed/traci4j/.settings/org.eclipse.ltk.core.refactoring.prefs +tools/contributed/traci4j/.settings/org.eclipse.jdt.ui.prefs +tools/contributed/traci4j/.project +tools/contributed/traci4j/examples/it/polito/appeal/traci/examples/OpenStepsClose.java +tools/contributed/traci4j/examples/it/polito/appeal/traci/examples/GetVehicleInfo.java +tools/contributed/traci4j/lib/xercesImpl.jar +tools/contributed/traci4j/lib/serializer.jar +tools/contributed/traci4j/lib/junit.jar +tools/contributed/traci4j/lib/xml-apis.jar +tools/contributed/traci4j/lib/log4j.jar +tools/contributed/traci4j/lib/resolver.jar +tools/contributed/traci4j/lib/org.hamcrest.core_1.1.0.v20090501071000.jar +tools/contributed/traci4j/README +tools/contributed/traci4j/test/sumo_maps/box1l/three_split.net.xml +tools/contributed/traci4j/test/sumo_maps/box1l/net.net.xml +tools/contributed/traci4j/test/sumo_maps/box1l/test.sumo.cfg +tools/contributed/traci4j/test/sumo_maps/box1l/input_routes.rou.xml +tools/contributed/traci4j/test/sumo_maps/variable_speed_signs/net.net.xml +tools/contributed/traci4j/test/sumo_maps/variable_speed_signs/test.sumo.cfg +tools/contributed/traci4j/test/sumo_maps/variable_speed_signs/input_routes.rou.xml +tools/contributed/traci4j/test/java/it/polito/appeal/traci/FastStorageTest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/RoadmapPositionTest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/TraCITest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/protocol/CommandTest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/protocol/MessageTest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/QueryRoadsTest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/TraCIServerTest.java +tools/contributed/traci4j/test/java/it/polito/appeal/traci/EqualsHashcodeTester.java +tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/FastSocket.java +tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/FastStorage.java +tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/Socket.java +tools/contributed/traci4j/src/de/uniluebeck/itm/tcpip/Storage.java +tools/contributed/traci4j/src/it/polito/appeal/traci/TraCIException.java +tools/contributed/traci4j/src/it/polito/appeal/traci/Vehicle.java +tools/contributed/traci4j/src/it/polito/appeal/traci/VehicleLifecycleObserver.java +tools/contributed/traci4j/src/it/polito/appeal/traci/SumoHttpRetriever.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/Command.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/RoadmapPosition.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/BoundingBox.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/Constants.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/ResponseMessage.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/ResponseContainer.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/StatusResponse.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/RequestMessage.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/Polygon.java +tools/contributed/traci4j/src/it/polito/appeal/traci/protocol/StringList.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/ChangeEdgeStateQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/VehicleQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/MultiVehiclePositionQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/RetrieveEdgeStateQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/RoadmapQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/SubscribeVehiclesLifecycle.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/Query.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/ChangeVehicleStateQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/SimStepQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/ChangeLaneStateQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/ReadVehicleVarQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/CloseQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/query/DomainQuery.java +tools/contributed/traci4j/src/it/polito/appeal/traci/Lane.java +tools/contributed/traci4j/src/it/polito/appeal/traci/SumoTraciConnection.java +tools/contributed/calibration/cadytsSumoController.jar +tools/contributed/Castellon/castellon.edg.xml +tools/contributed/Castellon/gentraffic.py tools/contributed/Castellon/castellon.rou.xml +tools/contributed/Castellon/castellon.con.xml +tools/contributed/Castellon/castellon.net.xml +tools/contributed/Castellon/castellon.add.xml tools/contributed/Castellon/castellon_example.add.xml +tools/contributed/Castellon/castellon.nod.xml tools/contributed/Castellon/castellon.typ.xml -tools/contributed/Castellon/castellon.add.xml -tools/contributed/Castellon/castellon.net.xml -tools/contributed/Castellon/gentraffic.py -tools/contributed/Castellon/castellon.edg.xml -tools/contributed/calibration/cadytsSumoController.jar +tools/contributed/Castellon/castellon._sumocfg +tools/contributed/Castellon/sumo.diff +tools/shapes/poi_atTLS.py +tools/shapes/CSV2polyconvertXML.py +tools/shapes/pois2inductionLoops.py +tools/shapes/poi_alongRoads.py +tools/sumolib/miscutils.py +tools/sumolib/options.py +tools/sumolib/__init__.py +tools/sumolib/output/inductionloop.py +tools/sumolib/output/__init__.py +tools/sumolib/output/dump.py +tools/sumolib/poi.py +tools/sumolib/net/__init__.py +tools/sumolib/net/node.py +tools/sumolib/net/connection.py +tools/sumolib/net/edge.py +tools/sumolib/net/lane.py +tools/sumolib/net/roundabout.py +tools/traceExporter/.classpath +tools/traceExporter/libs/stax-1.2.0.jar +tools/traceExporter/libs/stax-api-1.0.jar +tools/traceExporter/traceExporter.jar +tools/traceExporter/.project +tools/traceExporter/src/Main.java +tools/traceExporter/src/ansim/NetReader.java +tools/traceExporter/src/ansim/AnsimWriter.java +tools/traceExporter/src/ansim/Converter.java +tools/traceExporter/src/ansim/Parameter.java +tools/traceExporter/src/ansim/Edge.java +tools/traceExporter/src/ansim/Vehicle.java +tools/traceExporter/src/ansim/TraceReader.java +tools/traceExporter/src/ansim/Parser.java +tools/traceExporter/src/ns2/NetReader.java +tools/traceExporter/src/ns2/Converter.java +tools/traceExporter/src/ns2/Parameter.java +tools/traceExporter/src/ns2/VehicleReader.java +tools/traceExporter/src/ns2/Junction.java +tools/traceExporter/src/ns2/Edge.java +tools/traceExporter/src/ns2/MobilityWriter.java +tools/traceExporter/src/ns2/IdRandomizer.java +tools/traceExporter/src/ns2/NetTranslater.java +tools/traceExporter/src/ns2/Parser.java +tools/traceExporter/src/ns2/ConfigWriter.java +tools/traceExporter/src/ns2/VehicleFilter.java +tools/traceExporter/src/ns2/Lane.java +tools/traceExporter/src/ns2/ActivityWriter.java +tools/traceExporter/Makefile.am +tools/traceExporter/manifest.mf tools/generate-ns2.py -tools/detector/flowFromRoutes.py -tools/detector/aggregateFlows.py -tools/detector/detector.py -tools/detector/flowrouter.py -tools/detector/deleteUnusedDetectors.py -tools/output/generateTLSE1Detectors.py -tools/output/generateITetrisIntersectionMetrics.py -tools/output/generateITetrisNetworkMetrics.py -tools/output/timingStats.py +tools/route/route_1htoDay.py +tools/route/routes_Join.py +tools/route/extract_route_edges.py +tools/route/findUTurns.py +tools/route/kShortest.py +tools/route/routecompare.py +tools/route/routes2OD.py +tools/route/route_departOffset.py +tools/route/sort_routes.py +tools/route/route2alts.py +tools/route/route2poly.py +tools/route/routecheck.py +tools/xml/binary2plain.py +tools/xml/configTemplateToWiki.py +tools/xml/addSchema.py +tools/xml/rebuildSchemata.py +tools/xml/schemaCheck.py +tools/build/checkSvnProps.py +tools/build/pythonPropsMSVC.py +tools/build/dailyBuildMSVC.py +tools/build/apply_astyle.py +tools/build/status.py +tools/build/dailyBuildMSVC8.bat +tools/build/version.py +tools/build/checkAuthors.py +tools/build/buildHTMLDocs.py +tools/build/buildServiceUpload.sh +tools/build/mirrorWiki.py +tools/build/ubuntuBuild.sh +tools/build/dailyUpdateMakeGCC +tools/build/wix.py +tools/tls/tls_check.py +tools/tls/tls_csv2SUMO.py +tools/trip/removeTripsIfNotInInterval.pl +tools/trip/randomTrips.py +tools/trip/generateTripsXml.py +tools/trip/route2trips.py +tools/trip/splitTripsByHours.pl +tools/trip/removeGeometryInTrips.pl +tools/game/patchTrafficLights.py +tools/game/logo.gif +tools/game/setup.py +tools/game/kuehne/kuehne.rou.xml +tools/game/kuehne/kuehne.net.xml +tools/game/kuehne/dlr.gif +tools/game/kuehne/kuehne.netgcfg +tools/game/kuehne/settings.xml +tools/game/square/dlr.gif +tools/game/square/square.rou.xml +tools/game/square/square.net.xml +tools/game/square/square.netgcfg +tools/game/square/settings.xml +tools/game/cross/cross.nod.xml +tools/game/cross/cross.tls.add.xml +tools/game/cross/cross.edg.xml +tools/game/cross/cross.settings.xml +tools/game/cross/cross.net.xml +tools/game/cross/cross.netccfg +tools/game/cross/cross.gif +tools/game/cross/cross.rou.xml +tools/game/cross/cross.con.xml +tools/game/cross/cross.tls_opt.add.xml +tools/game/dlr.gif +tools/game/rebuild_networks.sh +tools/game/input_additional.add.xml +tools/game/cross_opt.sumocfg +tools/game/runner.py +tools/game/kuehne.sumocfg +tools/game/square.sumocfg +tools/game/cross.sumocfg +tools/district/districtMapper.py +tools/district/countConnectionsInDistricts.py +tools/district/edgesInDistricts.py tools/output/generateTLSE2Detectors.py +tools/output/timingStats.py +tools/output/generateTLSE1Detectors.py tools/output/netdumpdiff.py -tools/output/generateMeanDataDefinitions.py tools/output/netdumpmean.py +tools/output/analyze_teleports.py +tools/output/generateITetrisIntersectionMetrics.py +tools/output/generateITetrisNetworkMetrics.py tools/output/generateTLSE3Detectors.py -tools/sumolib/output/dump.py -tools/sumolib/output/__init__.py -tools/sumolib/output/inductionloop.py -tools/sumolib/net.py -tools/sumolib/poi.py -tools/sumolib/__init__.py -tools/shapes/poi_alongRoads.py -tools/shapes/CSV2polyconvertXML.py -tools/shapes/poi_atTLS.py -tools/shapes/pois2inductionLoops.py -tools/import/vissim/vissim_parseRoutes.py +tools/output/generateMeanDataDefinitions.py +tools/lib/stop.png +tools/lib/sumopoi.py +tools/lib/sumonet.py +tools/lib/rmsd.py +tools/lib/testUtil.py +tools/lib/play.png +tools/projects/TaxiFCD_Krieg/.pydevproject +tools/projects/TaxiFCD_Krieg/.project +tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py +tools/projects/TaxiFCD_Krieg/src/util/Reader.py +tools/projects/TaxiFCD_Krieg/src/util/__init__.py +tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py +tools/projects/TaxiFCD_Krieg/src/util/Path.py +tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py +tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py +tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py +tools/projects/TaxiFCD_Krieg/src/taxiQuantity/SeparateVLSArea.py +tools/projects/TaxiFCD_Krieg/src/backup/__init__.py +tools/projects/TaxiFCD_Krieg/src/backup/BackupFolder.pyw +tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsOLD.py +tools/projects/TaxiFCD_Krieg/src/fcdQuality/__init__.py +tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlot.py +tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffects.py +tools/projects/TaxiFCD_Krieg/src/fcdQuality/ParamEffectsProcessedFCD.py +tools/projects/TaxiFCD_Krieg/src/fcdQuality/readPlotOLD.py +tools/projects/TaxiFCD_Krieg/src/rawFCD/GenerateRawFCD.py +tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/FCDvsCompleteRoute.py +tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/__init__.py +tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/My_mpl_dump_onNet.py +tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py +tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutesMain.py +tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/differentDepartRoutes.py +tools/projects/TaxiFCD_Krieg/src/analysis/CompareVelocitys.py +tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverRoute.py +tools/projects/TaxiFCD_Krieg/src/analysis/FetchData.py +tools/projects/TaxiFCD_Krieg/src/analysis/VelocityOverTime.py +tools/projects/TaxiFCD_Krieg/src/analysis/__init__.py +tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime_DK.py +tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py +tools/projects/TaxiFCD_Krieg/src/analysis/VelocityCurve.py +tools/projects/TaxiFCD_Krieg/src/analysis/Traveltime.py +tools/projects/TaxiFCD_Krieg/src/analysis/TraveltimeMulti.py +tools/projects/orinoko/buildConnections.pl +tools/projects/TLS-Evaluationsszenarien/evaluator.py +tools/projects/TLS-Evaluationsszenarien/changeNet.py +tools/projects/TLS-Evaluationsszenarien/input04.ini +tools/projects/TLS-Evaluationsszenarien/input02.ini +tools/projects/TLS-Evaluationsszenarien/main.py +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.nod.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.net.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.sumocfg +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.netccfg +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.rou.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross_sat.det.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/cross_sat/cross.out +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.add.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.nod.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.det.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.edg.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.net.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.netccfg +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.con.xml +tools/projects/TLS-Evaluationsszenarien/sumoConfig/one_intersection/cross.sumocfg +tools/projects/TLS-Evaluationsszenarien/input01.ini +tools/projects/TLS-Evaluationsszenarien/input03.ini +tools/projects/TLS-Evaluationsszenarien/plotter.py +tools/projects/TLS-Evaluationsszenarien/test.py +tools/projects/TLS-Evaluationsszenarien/genRoutes.py +tools/projects/TLS-Evaluationsszenarien/data/002.dat +tools/projects/TLS-Evaluationsszenarien/data/000.dat +tools/projects/TLS-Evaluationsszenarien/data/002.ini +tools/projects/TLS-Evaluationsszenarien/data/003.dat +tools/projects/TLS-Evaluationsszenarien/data/001.dat +tools/projects/TLS-Evaluationsszenarien/data/001.ini +tools/projects/TLS-Evaluationsszenarien/data/000.ini +tools/projects/TLS-Evaluationsszenarien/data/003.ini +tools/turn-defs/generateTurnDefs.py +tools/turn-defs/turndefinitions.py +tools/turn-defs/connections.py +tools/turn-defs/collectinghandler.py +tools/xml2cvs.pl +tools/10to11.py +tools/import/visum/visum_parseZaehlstelle.py +tools/import/visum/visum_convertEdgeTypes.py +tools/import/visum/visum_convertTurnPercentages.py +tools/import/visum/visum_convertRoutes.py tools/import/vissim/vissim_parseBusStops.py -tools/import/osm/osmBuild.py +tools/import/vissim/vissim_parseRoutes.py tools/import/osm/osmGet.py tools/import/osm/typemap_example.xml -tools/import/visum/visum_convertRoutes.py -tools/import/visum/visum_convertEdgeTypes.py -tools/import/visum/visum_convertTurnPercentages.py -tools/import/visum/visum_parseZaehlstelle.py -tools/traceExporter/src/Main.java -tools/traceExporter/src/ns2/MobilityWriter.java -tools/traceExporter/src/ns2/ActivityWriter.java -tools/traceExporter/src/ns2/Converter.java -tools/traceExporter/src/ns2/NetTranslater.java -tools/traceExporter/src/ns2/Parameter.java -tools/traceExporter/src/ns2/Parser.java -tools/traceExporter/src/ns2/VehicleFilter.java -tools/traceExporter/src/ns2/Junction.java -tools/traceExporter/src/ns2/NetReader.java -tools/traceExporter/src/ns2/VehicleReader.java -tools/traceExporter/src/ns2/IdRandomizer.java -tools/traceExporter/src/ns2/Edge.java -tools/traceExporter/src/ns2/Lane.java -tools/traceExporter/src/ns2/ConfigWriter.java -tools/traceExporter/src/ansim/AnsimWriter.java -tools/traceExporter/src/ansim/Converter.java -tools/traceExporter/src/ansim/Parameter.java -tools/traceExporter/src/ansim/Parser.java -tools/traceExporter/src/ansim/TraceReader.java -tools/traceExporter/src/ansim/NetReader.java -tools/traceExporter/src/ansim/Edge.java -tools/traceExporter/src/ansim/Vehicle.java -tools/traceExporter/libs/stax-1.2.0.jar -tools/traceExporter/libs/stax-api-1.0.jar -tools/traceExporter/.project -tools/traceExporter/manifest.mf -tools/traceExporter/Makefile.am -tools/traceExporter/.classpath -tools/traceExporter/traceExporter.jar -tools/traci/edge.py -tools/traci/traciconstants.py -tools/traci/poi.py -tools/traci/trafficlights.py -tools/traci/traciControl.py -tools/traci/gui.py -tools/traci/junction.py -tools/traci/simulation.py -tools/traci/polygon.py -tools/traci/lane.py -tools/traci/route.py -tools/traci/multientryexit.py -tools/traci/traciToHex.py -tools/traci/vehicletype.py -tools/traci/__init__.py -tools/traci/rebuildConstants.py -tools/traci/inductionloop.py -tools/traci/constants.py -tools/traci/vehicle.py -tools/xml2cvs.pl +tools/import/osm/osmBuild.py +tools/visualization/mpl_dump_timeline.py +tools/visualization/mpl_dump_onNet.py tools/visualization/mpl_tripinfos_twoAgainst.py tools/visualization/mpl_dump_twoAgainst.py -tools/visualization/mpl_dump_onNet.py -tools/visualization/mpl_dump_timeline.py -tools/route/sort_routes.py -tools/route/routecheck.py -tools/route/routes_Join.py -tools/route/routecompare.py -tools/route/route_departOffset.py -tools/route/routes2OD.py -tools/route/kShortest.py -tools/route/findUTurns.py -tools/route/route_1htoDay.py -tools/route/route2alts.py -tools/xml/configTemplateToWiki.py -tools/xml/rebuildSchemata.py -tools/xml/binary2plain.py -tools/xml/addSchema.py -tools/xml/schemaCheck.py -tools/district/edgesInDistricts.py -tools/district/countConnectionsInDistricts.py -tools/district/districtMapper.py -tools/assign/network.py -tools/assign/matrixDailyToHourly.py +tools/assign/networkStatistics.py +tools/assign/inputs.py tools/assign/duaIterate.py -tools/assign/cadytsIterate.py -tools/assign/dijkstra.py -tools/assign/statisticsElements.py tools/assign/addTaz.py -tools/assign/Assignment.py tools/assign/assign.py -tools/assign/networkStatistics.py -tools/assign/tables.py -tools/assign/outputs.py tools/assign/one-shot.py +tools/assign/statisticsElements.py +tools/assign/cadytsIterate.py +tools/assign/duaIterate_analysis.py tools/assign/routeChoices.py -tools/assign/inputs.py -tools/assign/run.py +tools/assign/network.py +tools/assign/dijkstra.py +tools/assign/outputs.py +tools/assign/Assignment.py +tools/assign/tables.py tools/assign/costFunctionChecker.py tools/assign/elements.py -tools/trip/removeGeometryInTrips.pl -tools/trip/randomTrips.py -tools/trip/route2trips.py -tools/trip/generateTripsXml.py -tools/trip/splitTripsByHours.pl -tools/trip/removeTripsIfNotInInterval.pl -tools/build/dailyUpdateMakeGCC -tools/build/status.py -tools/build/checkSvnProps.py -tools/build/ubuntuBuild.sh -tools/build/version.py -tools/build/mirrorWiki.py -tools/build/dailyBuildMSVC8.bat -tools/build/buildServiceUpload.sh -tools/build/pythonPropsMSVC.py -tools/build/checkAuthors.py -tools/build/apply_astyle.py -tools/build/buildHTMLDocs.py -tools/build/dailyBuildMSVC.py -tools/build/wix.py -tools/10to11.py -tools/removeSVN.py -tools/turn-defs/collectinghandler.py -tools/turn-defs/connections.py -tools/turn-defs/turndefinitions.py -tools/turn-defs/generateTurnDefs.py -tools/net/netcheck.py -tools/net/batch0103to0110.py -tools/net/0103to0110.py -tools/net/netextract_subPart.py -tools/net/netstats.py -tools/net/xmlconnections_mapEdges.py +tools/assign/costMemory.py +tools/assign/run.py +tools/assign/matrixDailyToHourly.py tools/net/reprojectpolys.py -tools/net/OrderedMultiSet.py +tools/net/xmledges_applyOffset.py +tools/net/patchNetFiles.py tools/net/netshiftadaptor.py +tools/net/xmlconnections_mapEdges.py +tools/net/netcheck.py +tools/net/network_statistics.py tools/net/0123to0130.py -tools/net/patchNetFiles.py -tools/net/netdiff.py +tools/net/0103to0110.py +tools/net/visum_mapDistricts.py +tools/net/OrderedMultiSet.py +tools/net/netstats.py tools/net/odConnectionsCheck.py -tools/net/network_statistics.py -tools/net/xmlnodes_applyOffset.py tools/net/netextract.py -tools/net/prepareVISUM.py -tools/net/xmledges_applyOffset.py tools/net/createRoundaboutConnections.py -tools/net/visum_mapDistricts.py -tools/lib/stop.png -tools/lib/rmsd.py -tools/lib/sumopoi.py -tools/lib/sumonet.py -tools/lib/testUtil.py -tools/lib/play.png -tools/game/kuehne.sumocfg -tools/game/square/square.net.xml -tools/game/square/dlr.gif -tools/game/square/square.rou.xml -tools/game/square/square.netgcfg -tools/game/square/settings.xml -tools/game/setup.py -tools/game/input_additional.add.xml -tools/game/kuehne/kuehne.net.xml -tools/game/kuehne/dlr.gif -tools/game/kuehne/kuehne.netgcfg -tools/game/kuehne/kuehne.rou.xml -tools/game/kuehne/settings.xml -tools/game/rebuild_networks.sh -tools/game/runner.py -tools/game/patchTrafficLights.py -tools/game/cross.sumocfg -tools/game/cross_opt.sumocfg -tools/game/dlr.gif -tools/game/cross/cross.nod.xml -tools/game/cross/cross.net.xml -tools/game/cross/cross.edg.xml -tools/game/cross/cross.gif -tools/game/cross/cross.netccfg -tools/game/cross/cross.settings.xml -tools/game/cross/cross.rou.xml -tools/game/cross/cross.tls.add.xml -tools/game/cross/cross.tls_opt.add.xml -tools/game/cross/cross.con.xml -tools/game/logo.gif -tools/game/square.sumocfg +tools/net/xmlnodes_applyOffset.py +tools/net/prepareVISUM.py +tools/net/netdiff.py +tools/net/netextract_subPart.py +tools/net/batch0103to0110.py +tools/traci/inductionloop.py +tools/traci/rebuildConstants.py +tools/traci/__init__.py +tools/traci/trafficlights.py +tools/traci/vehicletype.py +tools/traci/vehicle.py +tools/traci/edge.py +tools/traci/lane.py +tools/traci/traciToHex.py +tools/traci/simulation.py +tools/traci/poi.py +tools/traci/constants.py +tools/traci/route.py +tools/traci/polygon.py +tools/traci/gui.py +tools/traci/multientryexit.py +tools/traci/junction.py +tools/removeSVN.py diff -Nru sumo-0.15.0~dfsg/unittest/Makefile.in sumo-0.16.0~dfsg/unittest/Makefile.in --- sumo-0.15.0~dfsg/unittest/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -109,6 +109,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -139,6 +140,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -173,6 +175,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -206,7 +209,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/unittest/src/Makefile.am sumo-0.16.0~dfsg/unittest/src/Makefile.am --- sumo-0.15.0~dfsg/unittest/src/Makefile.am 2011-12-13 00:02:08.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/Makefile.am 2012-09-25 22:01:27.000000000 +0000 @@ -4,7 +4,7 @@ MEM_LIBS = ../../src/foreign/nvwa/libnvwa.a endif -if MESOSIM +if INTERNAL INTERNAL_LIB = ../../src/internal/libinternal.a INTERNAL_TESTS = ./internal/HeightMapperTest.o endif @@ -47,6 +47,7 @@ ./utils/common/StringUtilsTest.o \ ./utils/common/StringTokenizerTest.o \ ./utils/common/RGBColorTest.o \ +./utils/common/TplConvertTest.o \ ./utils/common/ValueTimeLineTest.o \ ./utils/geom/BoundaryTest.o \ ./utils/geom/PositionVectorTest.o \ diff -Nru sumo-0.15.0~dfsg/unittest/src/Makefile.in sumo-0.16.0~dfsg/unittest/src/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -74,6 +74,7 @@ @WITH_GTEST_TRUE@ ./utils/common/StringUtilsTest.o \ @WITH_GTEST_TRUE@ ./utils/common/StringTokenizerTest.o \ @WITH_GTEST_TRUE@ ./utils/common/RGBColorTest.o \ +@WITH_GTEST_TRUE@ ./utils/common/TplConvertTest.o \ @WITH_GTEST_TRUE@ ./utils/common/ValueTimeLineTest.o \ @WITH_GTEST_TRUE@ ./utils/geom/BoundaryTest.o \ @WITH_GTEST_TRUE@ ./utils/geom/PositionVectorTest.o \ @@ -164,6 +165,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -194,6 +196,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -228,6 +231,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -261,7 +265,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -282,8 +285,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../../src/foreign/nvwa/libnvwa.a -@MESOSIM_TRUE@INTERNAL_LIB = ../../src/internal/libinternal.a -@MESOSIM_TRUE@INTERNAL_TESTS = ./internal/HeightMapperTest.o +@INTERNAL_TRUE@INTERNAL_LIB = ../../src/internal/libinternal.a +@INTERNAL_TRUE@INTERNAL_TESTS = ./internal/HeightMapperTest.o @WITH_GDAL_TRUE@GDAL_LIBS = -l$(LIB_GDAL) @WITH_PROJ_TRUE@PROJ_LIBS = -l$(LIB_PROJ) @WITH_GTEST_TRUE@sumo_unittest_SOURCES = unittest_main.cpp @@ -310,6 +313,7 @@ @WITH_GTEST_TRUE@./utils/common/StringUtilsTest.o \ @WITH_GTEST_TRUE@./utils/common/StringTokenizerTest.o \ @WITH_GTEST_TRUE@./utils/common/RGBColorTest.o \ +@WITH_GTEST_TRUE@./utils/common/TplConvertTest.o \ @WITH_GTEST_TRUE@./utils/common/ValueTimeLineTest.o \ @WITH_GTEST_TRUE@./utils/geom/BoundaryTest.o \ @WITH_GTEST_TRUE@./utils/geom/PositionVectorTest.o \ diff -Nru sumo-0.15.0~dfsg/unittest/src/microsim/Makefile.in sumo-0.16.0~dfsg/unittest/src/microsim/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/microsim/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/microsim/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -91,6 +91,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -121,6 +122,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -155,6 +157,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -188,7 +191,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/unittest/src/netbuild/Makefile.in sumo-0.16.0~dfsg/unittest/src/netbuild/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/netbuild/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/netbuild/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -91,6 +91,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -121,6 +122,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -155,6 +157,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -188,7 +191,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/unittest/src/utils/Makefile.in sumo-0.16.0~dfsg/unittest/src/utils/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/utils/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/utils/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -109,6 +109,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -139,6 +140,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -173,6 +175,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -206,7 +209,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/unittest/src/utils/common/Makefile.am sumo-0.16.0~dfsg/unittest/src/utils/common/Makefile.am --- sumo-0.15.0~dfsg/unittest/src/utils/common/Makefile.am 2010-10-13 23:02:10.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/utils/common/Makefile.am 2012-09-25 22:01:26.000000000 +0000 @@ -1,5 +1,5 @@ noinst_LIBRARIES = libtestcommon.a libtestcommon_a_SOURCES = StringTokenizerTest.cpp \ -StringUtilsTest.cpp \ +StringUtilsTest.cpp TplConvertTest.cpp \ RGBColorTest.cpp ValueTimeLineTest.cpp CommandMock.h diff -Nru sumo-0.15.0~dfsg/unittest/src/utils/common/Makefile.in sumo-0.16.0~dfsg/unittest/src/utils/common/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/utils/common/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/utils/common/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -50,8 +50,8 @@ libtestcommon_a_AR = $(AR) $(ARFLAGS) libtestcommon_a_LIBADD = am_libtestcommon_a_OBJECTS = StringTokenizerTest.$(OBJEXT) \ - StringUtilsTest.$(OBJEXT) RGBColorTest.$(OBJEXT) \ - ValueTimeLineTest.$(OBJEXT) + StringUtilsTest.$(OBJEXT) TplConvertTest.$(OBJEXT) \ + RGBColorTest.$(OBJEXT) ValueTimeLineTest.$(OBJEXT) libtestcommon_a_OBJECTS = $(am_libtestcommon_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -102,6 +102,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -132,6 +133,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -166,6 +168,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -199,7 +202,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -221,7 +223,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libtestcommon.a libtestcommon_a_SOURCES = StringTokenizerTest.cpp \ -StringUtilsTest.cpp \ +StringUtilsTest.cpp TplConvertTest.cpp \ RGBColorTest.cpp ValueTimeLineTest.cpp CommandMock.h all: all-am @@ -275,6 +277,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RGBColorTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringTokenizerTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringUtilsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TplConvertTest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ValueTimeLineTest.Po@am__quote@ .cpp.o: diff -Nru sumo-0.15.0~dfsg/unittest/src/utils/common/TplConvertTest.cpp sumo-0.16.0~dfsg/unittest/src/utils/common/TplConvertTest.cpp --- sumo-0.15.0~dfsg/unittest/src/utils/common/TplConvertTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/utils/common/TplConvertTest.cpp 2012-09-25 22:01:26.000000000 +0000 @@ -0,0 +1,98 @@ +/****************************************************************************/ +/// @file TplConvertTest.cpp +/// @author Michael Behrisch +/// @date Oct 2010 +/// @version $Id: TplConvertTest.cpp 12426 2012-06-26 07:22:25Z behrisch $ +/// +// Tests the class TplConvert +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ +// Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors +/****************************************************************************/ +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// test definitions +// =========================================================================== +/* Test the method '_2int'.*/ +TEST(TplConvert, test_2int) { + EXPECT_EQ(0, TplConvert::_2int("0")); + EXPECT_EQ(1, TplConvert::_2int("+1")); + EXPECT_EQ(-1, TplConvert::_2int("-1")); + EXPECT_THROW(TplConvert::_2int("1e0"), NumberFormatException); + EXPECT_THROW(TplConvert::_2int("100000000000"), NumberFormatException); + EXPECT_THROW(TplConvert::_2int(""), EmptyData); +} + + +/* Test the method '_2long'.*/ +TEST(TplConvert, test_2long) { + EXPECT_EQ(0, TplConvert::_2long("0")); + EXPECT_EQ(1, TplConvert::_2long("+1")); + EXPECT_EQ(-1, TplConvert::_2long("-1")); + EXPECT_THROW(TplConvert::_2long("1e0"), NumberFormatException); + EXPECT_EQ(100000000000, TplConvert::_2long("100000000000")); + EXPECT_THROW(TplConvert::_2long(""), EmptyData); +} + + +/* Test the method '_2SUMOReal'.*/ +TEST(TplConvert, test_2SUMOReal) { + EXPECT_EQ(0, TplConvert::_2SUMOReal("0")); + EXPECT_EQ(1, TplConvert::_2SUMOReal("+1")); + EXPECT_EQ(-1, TplConvert::_2SUMOReal("-1")); + EXPECT_EQ(1, TplConvert::_2SUMOReal("1e0")); + EXPECT_EQ(10, TplConvert::_2SUMOReal("1e1")); + EXPECT_EQ(1, TplConvert::_2SUMOReal("1.")); + EXPECT_EQ(1.1, TplConvert::_2SUMOReal("1.1")); + EXPECT_EQ(.1, TplConvert::_2SUMOReal(".1")); + EXPECT_EQ(1.1, TplConvert::_2SUMOReal("1,1")); + EXPECT_EQ(.1, TplConvert::_2SUMOReal(",1")); + EXPECT_EQ(100000000000, TplConvert::_2SUMOReal("100000000000")); + EXPECT_THROW(TplConvert::_2SUMOReal(""), EmptyData); + EXPECT_THROW(TplConvert::_2SUMOReal("1e0x"), NumberFormatException); + EXPECT_THROW(TplConvert::_2SUMOReal("1x"), NumberFormatException); +} + + +/* Test the method '_2bool'.*/ +TEST(TplConvert, test_2bool) { + // according to gtest issue 322 EXPECT_EQ(false, ...) triggers a gcc bug + EXPECT_EQ(true, TplConvert::_2bool("true")); + EXPECT_FALSE(TplConvert::_2bool("false")); + EXPECT_EQ(true, TplConvert::_2bool("True")); + EXPECT_FALSE(TplConvert::_2bool("False")); + EXPECT_EQ(true, TplConvert::_2bool("yes")); + EXPECT_FALSE(TplConvert::_2bool("no")); + EXPECT_EQ(true, TplConvert::_2bool("on")); + EXPECT_FALSE(TplConvert::_2bool("off")); + EXPECT_EQ(true, TplConvert::_2bool("1")); + EXPECT_FALSE(TplConvert::_2bool("0")); + EXPECT_EQ(true, TplConvert::_2bool("x")); + EXPECT_FALSE(TplConvert::_2bool("-")); + EXPECT_EQ(true, TplConvert::_2bool("ON")); + EXPECT_THROW(TplConvert::_2bool(""), EmptyData); + EXPECT_THROW(TplConvert::_2bool("1e0"), BoolFormatException); + EXPECT_THROW(TplConvert::_2bool("Trari"), BoolFormatException); + EXPECT_THROW(TplConvert::_2bool("yessir"), BoolFormatException); +} diff -Nru sumo-0.15.0~dfsg/unittest/src/utils/geom/Makefile.in sumo-0.16.0~dfsg/unittest/src/utils/geom/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/utils/geom/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/utils/geom/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -93,6 +93,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -123,6 +124,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -157,6 +159,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -190,7 +193,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff -Nru sumo-0.15.0~dfsg/unittest/src/utils/iodevices/Makefile.in sumo-0.16.0~dfsg/unittest/src/utils/iodevices/Makefile.in --- sumo-0.15.0~dfsg/unittest/src/utils/iodevices/Makefile.in 2012-03-14 00:11:54.000000000 +0000 +++ sumo-0.16.0~dfsg/unittest/src/utils/iodevices/Makefile.in 2012-12-04 00:13:21.000000000 +0000 @@ -69,6 +69,7 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -99,6 +100,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -133,6 +135,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -166,7 +169,6 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@